paper_name
stringlengths
11
170
text
stringlengths
8.07k
307k
summary
stringlengths
152
6.16k
paper_id
stringlengths
43
43
An Investigation into the Role of Author Demographics in ICLR Participation and Review
As machine learning conferences grow rapidly , many are concerned that individuals will be left behind on the basis of traits such as gender and geography . We leverage historic ICLR submissions from 2017 to 2021 to investigate the impact of gender and country of origin both on representation and paper review outcomes at ICLR . We also study various hypotheses that could explain gender representation disparities at ICLR , with a focus on factors that impact the likelihood of an author returning to the conference in consecutive years . Finally , we probe the interplay between paper topic and review outcomes , and perform a study on how the inclusion of theorems in a paper and the size of the author list correlates with paper scores . 1 INTRODUCTION . It is well known that the field of computer science has strong representation disparities across both racial/ethnic and gender categories ( Zweben & Bizot , 2021 ; Muro et al. , 2018 ; Dillon Jr et al. , 2015 ) . For example , women comprised just 23.6 % of enrollees in computation graduate programs in 2020 , and only 1.2 % of awarded PhDs were to Black students ( Zweben & Bizot , 2021 ) . While these statistics paint a concerning picture of the field ’ s ability to recruit and retain students from diverse backgrounds , representation at ICLR is considerably more distorted . Last year , Tran et al . ( 2020 ) reported that only 12.1 % of ICLR papers from US universities were lead by a woman first author . Using methods described in this paper , we observe that this number decreased to 10.62 % in 2021 . Gender representation disparity is quite extreme at ICLR , even within the context of well-known disparities in computer science at large . This motivates us to study these representation disparities more deeply , and we seek to identify and analyze theories for why they might exist . In particular , we are interested in whether issues concerning authorship , community , and the review process can be identified as factors that influence the representation of different groups . We consider these issues : • Retention We find that women who attend ICLR are less likely to return to the conference the following year than men . We study a number of factors that may contribute to this effect . We find that women are much more likely to return when they are mentored by a woman and that both women and men are far less likely to return after receiving negative scores during review . At the same time , women are advantaged by working with slightly larger authorship teams , which tends to result in more positive outcomes . • Country of Origin We find that papers from western nations tend to score higher , while papers from East and South Asia score lower than the conference average , although no significant bias against Asian papers is detected when acceptance decisions are made , controlling for reviewer scores . • Topic Breakdown & Theory vs Empirical papers We see that papers containing theorems are far more likely to be accepted than non-theory papers . Further , women tend to submit papers to topics with slightly lower acceptance rates than men . • Industry Affiliations Papers from Google , Facebook , and Microsoft are much more likely to be accepted on average . Interestingly , women first authors are slightly more prevalent among industry papers than among academic papers . While the focus of our study is on demographic differences in review outcomes , a number of recent studies have been conducted on the review process at large , with a focus on reproducibility and quality of reviews ( Rogers & Augenstein , 2020 ; Bharadhwaj et al. , 2020 ; Stelmakh et al. , 2020b ; a ; Fiez et al. , 2020 ; Manzoor & Shah , 2020 ; Shah et al. , 2018 ; Stelmakh et al. , 2019 ) . 2 DATASET CONSTRUCTION . Our analysis is based on a dataset we acquired using the APIs of OpenReview and SemanticScholar , followed by extensive hand-labeling procedures conducted by the authors . From OpenReview , we obtained titles , paper text , author lists , emails , scores , and reviews for ICLR papers from 2017- 2021 . In total , 8,553 submissions were obtained : 2,978 from ICLR 2021 , 2,560 from ICLR 2020 , 1,565 from ICLR 2019 , 960 from ICLR 2018 , and 490 from ICLR 2017 . To identify an author ’ s institution , we used the author ’ s email listed on their OpenReview profile and then mapped them to institutions with the open source World University and Domains dataset . We used SemanticScholar to scrape author- and paper-specific data . Author-specific data includes the number of citations , publications , influential papers , and h-index of each author on the paper . These data was obtained by scraping every paper by each author on SemanticScholar , identifying papers with titles that were either identical or similar as measured by edit distance , and hand-validating to see if identified papers were correct . Paper-specific data includes the number of citations . To study the role that gender plays in the review process , we hand-labeled gender for first and last authors on ICLR 2021 submissions . These labels were produced without relying on an automated process and rather by searching for gendered pronouns that appeared on personal webpages , social media , and CVs if applicable , and choosing the canonical gender for the name otherwise . We chose this process because ICLR has broad international participation , and automated gender inference tools , while more reproducible , are known to have unusually strong biases and inaccuracies on non-western identities ( Santamarı́a & Mihaljević , 2018 ) . We consider only binary gender labels . Future work should consider the experiences of non-binary and transgender people , however these populations can not be easily studied using the statistical methods used in this paper . 3 GENDER REPRESENTATION AT ICLR . Tran et al . ( 2020 ) identified that women are highly under-represented at ICLR ; in 2019 , women made up 23.2 % of all CS PhD students in the US ( Zweben & Bizot , 2020 ) , while only 12.1 % of first authors at ICLR from US universities were women . We find that this disparity widened in 2020 , with women compromising just 10.62 % of first authors and 10.77 % of last authors . For comparison , women comprised 23.4 % of enrollees in doctoral CS programs and 24.8 % of computer science , computer engineering , and information programs combined ( Zweben & Bizot , 2021 ) . There are many complex social and economic factors that likely contribute to the underrepresentation of women in computer science , including confidence gaps between men and women in STEM classrooms ( Lubienski et al. , 2013 ) , stereotypes of skill levels and gender roles in academics ( Lubienski et al. , 2013 ) , differences in workplace treatment between men and women ( Funk & Parker , 2018 ) , and even differences in income after graduation ( Xu , 2015 ) . However , the representation disparity at ICLR is strikingly more lopsided than what is observed in the computer science community at large , which indicates community-specific factors that influence representation . In this section , we consider various hypotheses for why such a strong disparity in representation might exist at ICLR . While there may be a range of sociological factors at play that are outside the scope of our study , we focus on factors that can be analyzed through publicly available data . Throughout this section , we focus on the likelihood of women returning to ICLR after appearing once . We focus only on the return rate of first authors . This is because last authors are unlikely to be first time attendees and often have long professional careers in ML that make them likely to return to the conference regardless of the factors identified below . 3.1 RETENTION . We observe that ICLR has somewhat more difficulty retaining women participants than men . Among first-time conference attendees in 2020 , of the women who appeared as first author on a paper , 19.79 % returned in 2021 , compared to 23.83 % for men . Expanding to account for all 2020 attendees regardless of their number of appearances , this mild discrepancy remains ; the return rate for women was 28.12 % compared to 31.64 % for men . As for why this discrepancy exists , the difference in return rate could be explained in part by outcomes in the review process . We hypothesize that authors receiving strongly negative feedback on their contributions may be less likely to return to the conference and that the relatively lower scores women receive make them less likely to return . Tran et al . ( 2020 ) reported that papers from women first authors on average scored 0.16 points lower than men in 2020 . Our 2021 data shows a present but smaller gender gap with women first authors on average scoring 0.13 points lower than men first authors ( p = 0.03 ) . This gender discrepancy is clearly visible in the score histograms in Figure 1 . There is no discernible gender gap for last authors . ( a ) First Author ( b ) Last Author This hypothesis is indeed supported by the data – review scores strongly correlate with retention rates . A logistic model predicting author return probability as a function of mean reviewer score and gender identifies reviewer scores as a strong factor in predicting author return ( p = 0.015 , Table 1 ) . This trend is a significant factor within both the men and women sub-populations ( see Table 5 in the Appendix ) . In a separate test , women with rejected papers had a return rate of 24.28 % while men with rejected papers had a return rate of 30.28 % ( p = 0.073 ) . Research on small minority peer groups in STEM fields ( Etzkowitz et al. , 1992 ; Rosser & Lane , 2002 ) suggests that the effect of reviewer scores may be stronger for women than for men , however we did not detect this as a significant factor in Table 1 ) . 3.2 AMOUNT OF PROFESSIONAL EXPERIENCE . Negative reviewer scores are commonplace in the machine learning community at large . One may expect experienced authors to be well acquainted with this fact , and therefore less strongly impacted by negative scores than those authors receiving their first ever round of reviews . In this section , we quantify how author experience correlates with the return rate of first authors . We consider the relation between professional experience and first author outcomes , in addition to last author ’ s experience level . We identify “ first-time ” authors as people who did not submit a paper to ICLR in 2017-2019 . Note that we use “ first author ” to refer to author order , and “ first time author ” to refer to lack of prior submissions . We find that first time authors are less likely to return to ICLR than other authors ( p < 0.001 ) . This effect is still highly significant even after controlling for reviewer scores . Women first-time authors return with a rate of 20.36 % , while men first-time authors return with a rate of 24.54 % . The observations in this study are applicable to many attendees , as 65 % of women and 63 % of men are first-time authors . We also consider the number of publications an author has and how it correlates with their return rate . After controlling for reviewer scores1 , we find that the number of publications of the first author was correlated with return rate , but not to a statistically significant degree ( p = 0.143 , Table 6 ) . We find that the number of citations is not a good indicator of return rate , possibly because it varies wildly for young researchers .
The paper conducts an observational study of disparities in the ICLR 2017-2021 reviewing process. The work centers around the analysis of disparities in reviewing scores and acceptance rates across gender, number of authors, countries, papers topics, and industry/academia. The authors present several findings that are likely of interest to the community and provide some potential explanations behind some of such findings.
SP:9694078af3d4815d6a00e315d8d8c796ecd3861b
SALT : Sharing Attention between Linear layer and Transformer for tabular dataset
Handling tabular data with deep learning models is a challenging problem despite their remarkable success in vision and language processing applications . Therefore , many practitioners still rely on classical models such as gradient boosting decision trees ( GBDTs ) rather than deep networks due to their superior performance with tabular data . In this paper , we propose a novel hybrid deep network architecture for tabular data , dubbed SALT ( Sharing Attention between Linear layer and Transformer ) . The proposed SALT consists of two blocks : Transformers and linear layer blocks that take advantage of shared attention matrices . The shared attention matrices enable transformers and linear layers to closely cooperate with each other , and it leads to improved performance and robustness . Our algorithm outperforms tree-based ensemble models and previous deep learning methods in multiple benchmark datasets . We further demonstrate the robustness of the proposed SALT with semi-supervised learning and pre-training with small dataset scenarios . 1 INTRODUCTION . In the fields of vision and natural language processing , deep networks such as CNN , RNN , LSTM and Transformer have gained great popularity with its impressive performance . In particular , Transformer ( Vaswani et al. , 2017 ) designed as language model , improves the performance of lots of deep learning models in various domains , so that there are many powerful models based on Transformer ( e.g . Devlin et al . ( 2019 ) , Brown et al . ( 2020 ) and Dosovitskiy et al . ( 2021 ) ) . Although the deep networks are powerful and used in natural language processing and vision , they are sub-optimal for other types of real-world problems that require to use tabular data , such as fraud detection ( Luo et al. , 2019 ) , product recommendation ( Guo et al. , 2017 ) and disease prediction ( Koppu et al. , 2020 ) . Tabular data has different characteristics from other data . Unlike text data that include vocabularies and words , and image data that include RGB values , the tabular data are usually mixed with different types of complex variables . For example , the tabular data contain continuous variables such as such as age , height , and weight have different ranges of values , and categorical variables which are independent from one another like gender and nationality . For these reasons , deep learning models were not quite successful with tabular data despite its strength in natural language processing and vision fields . Instead of deep learning models , classical models such as tree-based ensemble models are mainly used for tabular data . However , these classical approaches have some limitations . Continuous learning with real-time data is quite difficult using these classical methods . When the tabular data is high-dimensional sparse , the performance of tree-based methods is degraded . Also , the tree-based ensemble methods do not perform well for multi-modality learning and end-to-end systems . Therefore , it is an interesting to study a deep learning models for tabular data . Many studies have been attempted not only to overcome the shortcomings of the classical model with a deep learning model but also to overcome its performance . ( Arik & Pfister , 2020 ) , ( Huang et al. , 2020 ) and ( Somepalli et al. , 2021 ) . In this paper , we propose a new hybrid deep learning model architecture , named as SALT ( Sharing Attention between Linear layer and Transformer ) . We summarize the contributions of our paper as follows : • SALT shares the attention matrices between two blocks . Sharing the attention matrix allows to learn two blocks strongly and effectively . We demonstrate that sharing attention matrices improves the performance better . • SALT introduce the improved embedding method for continuous variables . We demonstrate that this method performs better than others . • SALT has four types of variants depending on which block is used and in what direction the attention matrix is shared . Each variant shows strength in different data . • SALT outperforms the other models on average over a variety of benchmark datasets . It also performs well even in small data environments via semi-supervised and self-supervised learning 2 RELATED WORK . 2.1 TREE-BASED MODELS . Decision trees ( Quinlan , 1986 ) are well-known for their high predictive performance compared to computational complexity . In addition , it has the strength of having explanatory power in units of variables with most statistical information gain . However , decision trees are likely to work well only on specific data because their decision boundaries are perpendicular to the data axis . To improve this drawback and performance , there are many ensemble models of decision trees such as Random forest ( Breiman , 2001 ) and GBDTs ( Gradient Boosting Decision Trees ) . Especially , GBDTs methods such as XGBoost ( Chen & Guestrin , 2016 ) , LightGBM ( Ke et al. , 2017 ) and CatBoost ( Dorogush et al. , 2018 ) are commonly used with powerful performance in lots of machine learning competitions and industrial sites . 2.2 DEEP LEARNING MODELS FOR TABULAR DATA . There are several studies on deep networks to overcome the limitations of tree-based models and outperform the performance of GBDTs . Especially there are deep learning models based on attention mechanism . TabNet ( Arik & Pfister , 2020 ) , for example , is designed to learn similarly to a decision trees , and it has interpretability with the attentive layer . It shows better performance than GBDTs in some dataset . TabTransformer ( Huang et al. , 2020 ) is designed based on Transformer and has contextual embedding values . However , it embeds only categorical variables , so that there is a limitation for continuous variables . There are some models that improve the limitation of TabTransformer ( Song et al. , 2018 ) , ( Somepalli et al. , 2021 ) . They have the contextual embedding values of not only categorical variables but also continuous variables . Especially a model called SAINT ( Somepalli et al. , 2021 ) introduces inter-sample self-attention method and shows powerful performance . But it has a fatal disadvantage that training costs are high . 2.3 TRANSFORMER . Self-attention is the core module of Transformer ( Vaswani et al. , 2017 ) . The self-attention consists of three parameter matrices : K ( keys ) , Q ( queries ) , and V ( values ) . Formally , input embedding values X ∈ Rn×d of n features of dimensions d , are projected using WQ ∈ Rd×dq , WQ ∈ Rd×dq , and WQ ∈ Rd×dq to extract feature representations Q , K , and V . With Q , K , and V , self-attention can be written as , Q = XWQ , K = XWK , V = XWV ( 1 ) Attention ( Q , K , V ) = Softmax ( QKT√ dk ) V ( 2 ) MHA ( Multi Head Attention ) is having multiple attention heads . Multi head allows the attention matrix to have the abundant representations ( Michel et al. , 2019 ) , ( Voita et al. , 2019 ) . Each head attention has different Q , K , and V weight matrices and calculates the attention values with the equation 2 . All heads are then concatenated and multiplied by the weight matrix to generate the final output of the layer . MHA ( Q , K , V ) = Concat ( head1 , ... , headh ) WO ( 3 ) where headi = Attention ( Q , K , V ) and WO is weighted matrix for final output . The dimension dh of each head is typically given as d/Nh . 2.4 GATING MECHANISM . The gating mechanism is an effective method of learning by controlling the information flow path of the LSTM ( Hochreiter & Schmidhuber , 1997 ) . However , the more layers of these mechanisms are stacked , the more likely the gradient is vanishing . As an improved mechanism , gate linear units ( GLU ) is introduced by ( Dauphin et al. , 2017 ) . GLU has been used in many deep learning models and shows the better performance ( Arik & Pfister , 2020 ) , ( Shazeer , 2020 ) . To briefly explain the GLUs , they divide the input in half , take an activation function on one side , and multiply by element with the other . Therefore , the output dimension is half the input dimension . h ( x ) = ( W1X + b1 ) ⊗ σ ( W2X + b2 ) ( 4 ) The gating mechanism is used to control the information flow slightly similar to the self-attention mechanism . The main difference between gating mechanism and self-attention is that gating mechanism controls only the bandwidth of a single element , while self-attention considers information of two different elements . 3 SALT : SHARING ATTENTION BETWEEN LINEAR LAYER AND TRANSFORMER . 3.1 SALT ARCHITECTURE . In this section , we introduce our model , SALT ( Sharing Attention between Linear layer and Transformer ) shown in Figure 1 . SALT uses the input embedding values obtained from the embedding layer . The embedding values have the shape of ’ features ( n ) × embedding dimensions ( d ) ’ . The main body of SALT has two blocks : Transformers block inspired by ( Vaswani et al. , 2017 ) and Linear layer block inspired by ( Liu et al. , 2021 ) . Each block has subblocks by feature-wise and dimensionwise . These two subblocks allow communications between different features and different embedding elements and makes the model robust ( Tolstikhin et al. , 2021 ) . The output values from two blocks become the contextual embedding values . SALT performs fin-tuning and pre-training with contextual embedding values . 3.2 SALT FOR LEARNING . The learning process of SALT is as follows . Let D = { xi , yi } mi=1 be tabular dataset of m samples . The feature ( n ) variables xfeatures ∈ Rn include categorical xcat and continuous variables xcont . SALT adds the special token [ cls ] to the feature variables and takes them as an input values like BERT ( Devlin et al. , 2019 ) . So , xi = [ [ cls ] , xcat , xcont ] is the input values consisting of the feature variables and a special token [ cls ] . The embedding layer E ( · ) converts the input values xi ∈ R ( n+1 ) into d-dimensional values E ( xi ) ∈ R ( n+1 ) ×d . Let Transformer be Transformer ( · ) and Linear layer block be Linearlayer ( · ) . SALT consists of an L stack of these two blocks . Each block returns the output value z and the sharing attention matrices , sf and sd by feature-wise and dimension-wise as the following equations : z ( 1 ) t , s ( 1 ) tf , s ( 1 ) td = Transformer1 ( E ( xi ) ) ( 5 ) z ( 1 ) l , s ( 1 ) lf , s ( 1 ) ld = Linearlayer1 ( E ( xi ) ) ( 6 ) z ( 1 ) t and z ( 1 ) l are the output values of Transformer block and Linear layer block from the first stack , respectively . s ( 1 ) ft and s ( 1 ) dt are the feature-wise attention matrix and dimension-wise attention matrix from Transformer block . s ( 1 ) fl and s ( 1 ) dl are from Linear layer block . The matrices from blocks are calculated in the head direction by function S ( · ) and the calculated matrix becomes the sharing attention matrix for the next blocks . Sf ( sft , sfl ) = concat ( sft , sfl ) Wf ( 7 ) Sd ( sdt , sdl ) = concat ( sdt , sdl ) Wd ( 8 ) Wf , Wd ∈ Rh×2h are weight for projection in the head direction . The two attention matrices obtained from the above equation are sent to the blocks of the next stack . This procedure is repeated until the last stack as the following equations . z ( i ) t , s ( i ) ft , s ( i ) dt = Transformeri ( z ( i−1 ) t , s̃ ( i−1 ) f , s̃ ( i−1 ) d ) ( 9 ) z ( i ) l , s ( i ) fl , s ( i ) dl = Linearlayeri ( z ( i−1 ) l , s̃ ( i−1 ) f , s̃ ( i−1 ) d ) ( 10 ) s̃ ( i ) f = Sf ( s ( i ) ft , s ( i ) fl ) s̃ ( i ) d = Sd ( s ( i ) dt , s ( i ) dl ) ( 11 ) Finally , the output values of the last stack , zLl and z L t are added as the output of SALT . This value also becomes the contextual embedding valuesẼ ( xi ) = [ ẽ ( [ cls ] ) , ẽ ( x1 ) , · · · , ẽ ( xn ) ] . The cls token , ẽ ( [ cls ] ) is used for fine-tuning , and the other values , ẽ ( xi ) are used for pre-training using MLM ( Masked Language Model ) ( Devlin et al. , 2019 ) .
This paper proposes a hybrid deep network, named SALT (Sharing Attention between Linear layer and Transformer). The SALT consists of two blocks: Transformer and linear layer blocks that take advantage of shared attention matrices. They compare SALT with tree-based ensemble models and previous deep learning models on multiple benchmark datasets. It furher shows robustness of the proposed SALT with semi-supervised learning and pre-training with small dataset scenarios. The main body of SALT has two blocks: Transformers block inspired by (Vaswani et al., 2017) and Linear layer block inspired by (Liu et al., 2021). Each block has subblocks by feature-wise and dimension- wise. These two subblocks allow communications between different features and different embed- ding elements and makes the model robust (Tolstikhin et al., 2021). The output values from two blocks become the contextual embedding values. SALT performs fin-tuning and pre-training with contextual embedding values. For supervised learning setting, the mean AUROC score of the proposed SALT improves upon the treebased LightGBM by mere 0.09%, and it improves upon the best deep learning based model SAINT by 0.29%
SP:5d9c3dca9bf4570f1fabb4c8e2b5f3084f78546c
SALT : Sharing Attention between Linear layer and Transformer for tabular dataset
Handling tabular data with deep learning models is a challenging problem despite their remarkable success in vision and language processing applications . Therefore , many practitioners still rely on classical models such as gradient boosting decision trees ( GBDTs ) rather than deep networks due to their superior performance with tabular data . In this paper , we propose a novel hybrid deep network architecture for tabular data , dubbed SALT ( Sharing Attention between Linear layer and Transformer ) . The proposed SALT consists of two blocks : Transformers and linear layer blocks that take advantage of shared attention matrices . The shared attention matrices enable transformers and linear layers to closely cooperate with each other , and it leads to improved performance and robustness . Our algorithm outperforms tree-based ensemble models and previous deep learning methods in multiple benchmark datasets . We further demonstrate the robustness of the proposed SALT with semi-supervised learning and pre-training with small dataset scenarios . 1 INTRODUCTION . In the fields of vision and natural language processing , deep networks such as CNN , RNN , LSTM and Transformer have gained great popularity with its impressive performance . In particular , Transformer ( Vaswani et al. , 2017 ) designed as language model , improves the performance of lots of deep learning models in various domains , so that there are many powerful models based on Transformer ( e.g . Devlin et al . ( 2019 ) , Brown et al . ( 2020 ) and Dosovitskiy et al . ( 2021 ) ) . Although the deep networks are powerful and used in natural language processing and vision , they are sub-optimal for other types of real-world problems that require to use tabular data , such as fraud detection ( Luo et al. , 2019 ) , product recommendation ( Guo et al. , 2017 ) and disease prediction ( Koppu et al. , 2020 ) . Tabular data has different characteristics from other data . Unlike text data that include vocabularies and words , and image data that include RGB values , the tabular data are usually mixed with different types of complex variables . For example , the tabular data contain continuous variables such as such as age , height , and weight have different ranges of values , and categorical variables which are independent from one another like gender and nationality . For these reasons , deep learning models were not quite successful with tabular data despite its strength in natural language processing and vision fields . Instead of deep learning models , classical models such as tree-based ensemble models are mainly used for tabular data . However , these classical approaches have some limitations . Continuous learning with real-time data is quite difficult using these classical methods . When the tabular data is high-dimensional sparse , the performance of tree-based methods is degraded . Also , the tree-based ensemble methods do not perform well for multi-modality learning and end-to-end systems . Therefore , it is an interesting to study a deep learning models for tabular data . Many studies have been attempted not only to overcome the shortcomings of the classical model with a deep learning model but also to overcome its performance . ( Arik & Pfister , 2020 ) , ( Huang et al. , 2020 ) and ( Somepalli et al. , 2021 ) . In this paper , we propose a new hybrid deep learning model architecture , named as SALT ( Sharing Attention between Linear layer and Transformer ) . We summarize the contributions of our paper as follows : • SALT shares the attention matrices between two blocks . Sharing the attention matrix allows to learn two blocks strongly and effectively . We demonstrate that sharing attention matrices improves the performance better . • SALT introduce the improved embedding method for continuous variables . We demonstrate that this method performs better than others . • SALT has four types of variants depending on which block is used and in what direction the attention matrix is shared . Each variant shows strength in different data . • SALT outperforms the other models on average over a variety of benchmark datasets . It also performs well even in small data environments via semi-supervised and self-supervised learning 2 RELATED WORK . 2.1 TREE-BASED MODELS . Decision trees ( Quinlan , 1986 ) are well-known for their high predictive performance compared to computational complexity . In addition , it has the strength of having explanatory power in units of variables with most statistical information gain . However , decision trees are likely to work well only on specific data because their decision boundaries are perpendicular to the data axis . To improve this drawback and performance , there are many ensemble models of decision trees such as Random forest ( Breiman , 2001 ) and GBDTs ( Gradient Boosting Decision Trees ) . Especially , GBDTs methods such as XGBoost ( Chen & Guestrin , 2016 ) , LightGBM ( Ke et al. , 2017 ) and CatBoost ( Dorogush et al. , 2018 ) are commonly used with powerful performance in lots of machine learning competitions and industrial sites . 2.2 DEEP LEARNING MODELS FOR TABULAR DATA . There are several studies on deep networks to overcome the limitations of tree-based models and outperform the performance of GBDTs . Especially there are deep learning models based on attention mechanism . TabNet ( Arik & Pfister , 2020 ) , for example , is designed to learn similarly to a decision trees , and it has interpretability with the attentive layer . It shows better performance than GBDTs in some dataset . TabTransformer ( Huang et al. , 2020 ) is designed based on Transformer and has contextual embedding values . However , it embeds only categorical variables , so that there is a limitation for continuous variables . There are some models that improve the limitation of TabTransformer ( Song et al. , 2018 ) , ( Somepalli et al. , 2021 ) . They have the contextual embedding values of not only categorical variables but also continuous variables . Especially a model called SAINT ( Somepalli et al. , 2021 ) introduces inter-sample self-attention method and shows powerful performance . But it has a fatal disadvantage that training costs are high . 2.3 TRANSFORMER . Self-attention is the core module of Transformer ( Vaswani et al. , 2017 ) . The self-attention consists of three parameter matrices : K ( keys ) , Q ( queries ) , and V ( values ) . Formally , input embedding values X ∈ Rn×d of n features of dimensions d , are projected using WQ ∈ Rd×dq , WQ ∈ Rd×dq , and WQ ∈ Rd×dq to extract feature representations Q , K , and V . With Q , K , and V , self-attention can be written as , Q = XWQ , K = XWK , V = XWV ( 1 ) Attention ( Q , K , V ) = Softmax ( QKT√ dk ) V ( 2 ) MHA ( Multi Head Attention ) is having multiple attention heads . Multi head allows the attention matrix to have the abundant representations ( Michel et al. , 2019 ) , ( Voita et al. , 2019 ) . Each head attention has different Q , K , and V weight matrices and calculates the attention values with the equation 2 . All heads are then concatenated and multiplied by the weight matrix to generate the final output of the layer . MHA ( Q , K , V ) = Concat ( head1 , ... , headh ) WO ( 3 ) where headi = Attention ( Q , K , V ) and WO is weighted matrix for final output . The dimension dh of each head is typically given as d/Nh . 2.4 GATING MECHANISM . The gating mechanism is an effective method of learning by controlling the information flow path of the LSTM ( Hochreiter & Schmidhuber , 1997 ) . However , the more layers of these mechanisms are stacked , the more likely the gradient is vanishing . As an improved mechanism , gate linear units ( GLU ) is introduced by ( Dauphin et al. , 2017 ) . GLU has been used in many deep learning models and shows the better performance ( Arik & Pfister , 2020 ) , ( Shazeer , 2020 ) . To briefly explain the GLUs , they divide the input in half , take an activation function on one side , and multiply by element with the other . Therefore , the output dimension is half the input dimension . h ( x ) = ( W1X + b1 ) ⊗ σ ( W2X + b2 ) ( 4 ) The gating mechanism is used to control the information flow slightly similar to the self-attention mechanism . The main difference between gating mechanism and self-attention is that gating mechanism controls only the bandwidth of a single element , while self-attention considers information of two different elements . 3 SALT : SHARING ATTENTION BETWEEN LINEAR LAYER AND TRANSFORMER . 3.1 SALT ARCHITECTURE . In this section , we introduce our model , SALT ( Sharing Attention between Linear layer and Transformer ) shown in Figure 1 . SALT uses the input embedding values obtained from the embedding layer . The embedding values have the shape of ’ features ( n ) × embedding dimensions ( d ) ’ . The main body of SALT has two blocks : Transformers block inspired by ( Vaswani et al. , 2017 ) and Linear layer block inspired by ( Liu et al. , 2021 ) . Each block has subblocks by feature-wise and dimensionwise . These two subblocks allow communications between different features and different embedding elements and makes the model robust ( Tolstikhin et al. , 2021 ) . The output values from two blocks become the contextual embedding values . SALT performs fin-tuning and pre-training with contextual embedding values . 3.2 SALT FOR LEARNING . The learning process of SALT is as follows . Let D = { xi , yi } mi=1 be tabular dataset of m samples . The feature ( n ) variables xfeatures ∈ Rn include categorical xcat and continuous variables xcont . SALT adds the special token [ cls ] to the feature variables and takes them as an input values like BERT ( Devlin et al. , 2019 ) . So , xi = [ [ cls ] , xcat , xcont ] is the input values consisting of the feature variables and a special token [ cls ] . The embedding layer E ( · ) converts the input values xi ∈ R ( n+1 ) into d-dimensional values E ( xi ) ∈ R ( n+1 ) ×d . Let Transformer be Transformer ( · ) and Linear layer block be Linearlayer ( · ) . SALT consists of an L stack of these two blocks . Each block returns the output value z and the sharing attention matrices , sf and sd by feature-wise and dimension-wise as the following equations : z ( 1 ) t , s ( 1 ) tf , s ( 1 ) td = Transformer1 ( E ( xi ) ) ( 5 ) z ( 1 ) l , s ( 1 ) lf , s ( 1 ) ld = Linearlayer1 ( E ( xi ) ) ( 6 ) z ( 1 ) t and z ( 1 ) l are the output values of Transformer block and Linear layer block from the first stack , respectively . s ( 1 ) ft and s ( 1 ) dt are the feature-wise attention matrix and dimension-wise attention matrix from Transformer block . s ( 1 ) fl and s ( 1 ) dl are from Linear layer block . The matrices from blocks are calculated in the head direction by function S ( · ) and the calculated matrix becomes the sharing attention matrix for the next blocks . Sf ( sft , sfl ) = concat ( sft , sfl ) Wf ( 7 ) Sd ( sdt , sdl ) = concat ( sdt , sdl ) Wd ( 8 ) Wf , Wd ∈ Rh×2h are weight for projection in the head direction . The two attention matrices obtained from the above equation are sent to the blocks of the next stack . This procedure is repeated until the last stack as the following equations . z ( i ) t , s ( i ) ft , s ( i ) dt = Transformeri ( z ( i−1 ) t , s̃ ( i−1 ) f , s̃ ( i−1 ) d ) ( 9 ) z ( i ) l , s ( i ) fl , s ( i ) dl = Linearlayeri ( z ( i−1 ) l , s̃ ( i−1 ) f , s̃ ( i−1 ) d ) ( 10 ) s̃ ( i ) f = Sf ( s ( i ) ft , s ( i ) fl ) s̃ ( i ) d = Sd ( s ( i ) dt , s ( i ) dl ) ( 11 ) Finally , the output values of the last stack , zLl and z L t are added as the output of SALT . This value also becomes the contextual embedding valuesẼ ( xi ) = [ ẽ ( [ cls ] ) , ẽ ( x1 ) , · · · , ẽ ( xn ) ] . The cls token , ẽ ( [ cls ] ) is used for fine-tuning , and the other values , ẽ ( xi ) are used for pre-training using MLM ( Masked Language Model ) ( Devlin et al. , 2019 ) .
This paper proposed a hybrid deep network architecture for tabular data, dubbed SALT (Sharing Attention between Linear layer and Transformer). There are two blocks in SALT: Transformers and linear layer blocks. And sharing attention matrices are introduced to promote cooperation between these two blocks.
SP:5d9c3dca9bf4570f1fabb4c8e2b5f3084f78546c
SALT : Sharing Attention between Linear layer and Transformer for tabular dataset
Handling tabular data with deep learning models is a challenging problem despite their remarkable success in vision and language processing applications . Therefore , many practitioners still rely on classical models such as gradient boosting decision trees ( GBDTs ) rather than deep networks due to their superior performance with tabular data . In this paper , we propose a novel hybrid deep network architecture for tabular data , dubbed SALT ( Sharing Attention between Linear layer and Transformer ) . The proposed SALT consists of two blocks : Transformers and linear layer blocks that take advantage of shared attention matrices . The shared attention matrices enable transformers and linear layers to closely cooperate with each other , and it leads to improved performance and robustness . Our algorithm outperforms tree-based ensemble models and previous deep learning methods in multiple benchmark datasets . We further demonstrate the robustness of the proposed SALT with semi-supervised learning and pre-training with small dataset scenarios . 1 INTRODUCTION . In the fields of vision and natural language processing , deep networks such as CNN , RNN , LSTM and Transformer have gained great popularity with its impressive performance . In particular , Transformer ( Vaswani et al. , 2017 ) designed as language model , improves the performance of lots of deep learning models in various domains , so that there are many powerful models based on Transformer ( e.g . Devlin et al . ( 2019 ) , Brown et al . ( 2020 ) and Dosovitskiy et al . ( 2021 ) ) . Although the deep networks are powerful and used in natural language processing and vision , they are sub-optimal for other types of real-world problems that require to use tabular data , such as fraud detection ( Luo et al. , 2019 ) , product recommendation ( Guo et al. , 2017 ) and disease prediction ( Koppu et al. , 2020 ) . Tabular data has different characteristics from other data . Unlike text data that include vocabularies and words , and image data that include RGB values , the tabular data are usually mixed with different types of complex variables . For example , the tabular data contain continuous variables such as such as age , height , and weight have different ranges of values , and categorical variables which are independent from one another like gender and nationality . For these reasons , deep learning models were not quite successful with tabular data despite its strength in natural language processing and vision fields . Instead of deep learning models , classical models such as tree-based ensemble models are mainly used for tabular data . However , these classical approaches have some limitations . Continuous learning with real-time data is quite difficult using these classical methods . When the tabular data is high-dimensional sparse , the performance of tree-based methods is degraded . Also , the tree-based ensemble methods do not perform well for multi-modality learning and end-to-end systems . Therefore , it is an interesting to study a deep learning models for tabular data . Many studies have been attempted not only to overcome the shortcomings of the classical model with a deep learning model but also to overcome its performance . ( Arik & Pfister , 2020 ) , ( Huang et al. , 2020 ) and ( Somepalli et al. , 2021 ) . In this paper , we propose a new hybrid deep learning model architecture , named as SALT ( Sharing Attention between Linear layer and Transformer ) . We summarize the contributions of our paper as follows : • SALT shares the attention matrices between two blocks . Sharing the attention matrix allows to learn two blocks strongly and effectively . We demonstrate that sharing attention matrices improves the performance better . • SALT introduce the improved embedding method for continuous variables . We demonstrate that this method performs better than others . • SALT has four types of variants depending on which block is used and in what direction the attention matrix is shared . Each variant shows strength in different data . • SALT outperforms the other models on average over a variety of benchmark datasets . It also performs well even in small data environments via semi-supervised and self-supervised learning 2 RELATED WORK . 2.1 TREE-BASED MODELS . Decision trees ( Quinlan , 1986 ) are well-known for their high predictive performance compared to computational complexity . In addition , it has the strength of having explanatory power in units of variables with most statistical information gain . However , decision trees are likely to work well only on specific data because their decision boundaries are perpendicular to the data axis . To improve this drawback and performance , there are many ensemble models of decision trees such as Random forest ( Breiman , 2001 ) and GBDTs ( Gradient Boosting Decision Trees ) . Especially , GBDTs methods such as XGBoost ( Chen & Guestrin , 2016 ) , LightGBM ( Ke et al. , 2017 ) and CatBoost ( Dorogush et al. , 2018 ) are commonly used with powerful performance in lots of machine learning competitions and industrial sites . 2.2 DEEP LEARNING MODELS FOR TABULAR DATA . There are several studies on deep networks to overcome the limitations of tree-based models and outperform the performance of GBDTs . Especially there are deep learning models based on attention mechanism . TabNet ( Arik & Pfister , 2020 ) , for example , is designed to learn similarly to a decision trees , and it has interpretability with the attentive layer . It shows better performance than GBDTs in some dataset . TabTransformer ( Huang et al. , 2020 ) is designed based on Transformer and has contextual embedding values . However , it embeds only categorical variables , so that there is a limitation for continuous variables . There are some models that improve the limitation of TabTransformer ( Song et al. , 2018 ) , ( Somepalli et al. , 2021 ) . They have the contextual embedding values of not only categorical variables but also continuous variables . Especially a model called SAINT ( Somepalli et al. , 2021 ) introduces inter-sample self-attention method and shows powerful performance . But it has a fatal disadvantage that training costs are high . 2.3 TRANSFORMER . Self-attention is the core module of Transformer ( Vaswani et al. , 2017 ) . The self-attention consists of three parameter matrices : K ( keys ) , Q ( queries ) , and V ( values ) . Formally , input embedding values X ∈ Rn×d of n features of dimensions d , are projected using WQ ∈ Rd×dq , WQ ∈ Rd×dq , and WQ ∈ Rd×dq to extract feature representations Q , K , and V . With Q , K , and V , self-attention can be written as , Q = XWQ , K = XWK , V = XWV ( 1 ) Attention ( Q , K , V ) = Softmax ( QKT√ dk ) V ( 2 ) MHA ( Multi Head Attention ) is having multiple attention heads . Multi head allows the attention matrix to have the abundant representations ( Michel et al. , 2019 ) , ( Voita et al. , 2019 ) . Each head attention has different Q , K , and V weight matrices and calculates the attention values with the equation 2 . All heads are then concatenated and multiplied by the weight matrix to generate the final output of the layer . MHA ( Q , K , V ) = Concat ( head1 , ... , headh ) WO ( 3 ) where headi = Attention ( Q , K , V ) and WO is weighted matrix for final output . The dimension dh of each head is typically given as d/Nh . 2.4 GATING MECHANISM . The gating mechanism is an effective method of learning by controlling the information flow path of the LSTM ( Hochreiter & Schmidhuber , 1997 ) . However , the more layers of these mechanisms are stacked , the more likely the gradient is vanishing . As an improved mechanism , gate linear units ( GLU ) is introduced by ( Dauphin et al. , 2017 ) . GLU has been used in many deep learning models and shows the better performance ( Arik & Pfister , 2020 ) , ( Shazeer , 2020 ) . To briefly explain the GLUs , they divide the input in half , take an activation function on one side , and multiply by element with the other . Therefore , the output dimension is half the input dimension . h ( x ) = ( W1X + b1 ) ⊗ σ ( W2X + b2 ) ( 4 ) The gating mechanism is used to control the information flow slightly similar to the self-attention mechanism . The main difference between gating mechanism and self-attention is that gating mechanism controls only the bandwidth of a single element , while self-attention considers information of two different elements . 3 SALT : SHARING ATTENTION BETWEEN LINEAR LAYER AND TRANSFORMER . 3.1 SALT ARCHITECTURE . In this section , we introduce our model , SALT ( Sharing Attention between Linear layer and Transformer ) shown in Figure 1 . SALT uses the input embedding values obtained from the embedding layer . The embedding values have the shape of ’ features ( n ) × embedding dimensions ( d ) ’ . The main body of SALT has two blocks : Transformers block inspired by ( Vaswani et al. , 2017 ) and Linear layer block inspired by ( Liu et al. , 2021 ) . Each block has subblocks by feature-wise and dimensionwise . These two subblocks allow communications between different features and different embedding elements and makes the model robust ( Tolstikhin et al. , 2021 ) . The output values from two blocks become the contextual embedding values . SALT performs fin-tuning and pre-training with contextual embedding values . 3.2 SALT FOR LEARNING . The learning process of SALT is as follows . Let D = { xi , yi } mi=1 be tabular dataset of m samples . The feature ( n ) variables xfeatures ∈ Rn include categorical xcat and continuous variables xcont . SALT adds the special token [ cls ] to the feature variables and takes them as an input values like BERT ( Devlin et al. , 2019 ) . So , xi = [ [ cls ] , xcat , xcont ] is the input values consisting of the feature variables and a special token [ cls ] . The embedding layer E ( · ) converts the input values xi ∈ R ( n+1 ) into d-dimensional values E ( xi ) ∈ R ( n+1 ) ×d . Let Transformer be Transformer ( · ) and Linear layer block be Linearlayer ( · ) . SALT consists of an L stack of these two blocks . Each block returns the output value z and the sharing attention matrices , sf and sd by feature-wise and dimension-wise as the following equations : z ( 1 ) t , s ( 1 ) tf , s ( 1 ) td = Transformer1 ( E ( xi ) ) ( 5 ) z ( 1 ) l , s ( 1 ) lf , s ( 1 ) ld = Linearlayer1 ( E ( xi ) ) ( 6 ) z ( 1 ) t and z ( 1 ) l are the output values of Transformer block and Linear layer block from the first stack , respectively . s ( 1 ) ft and s ( 1 ) dt are the feature-wise attention matrix and dimension-wise attention matrix from Transformer block . s ( 1 ) fl and s ( 1 ) dl are from Linear layer block . The matrices from blocks are calculated in the head direction by function S ( · ) and the calculated matrix becomes the sharing attention matrix for the next blocks . Sf ( sft , sfl ) = concat ( sft , sfl ) Wf ( 7 ) Sd ( sdt , sdl ) = concat ( sdt , sdl ) Wd ( 8 ) Wf , Wd ∈ Rh×2h are weight for projection in the head direction . The two attention matrices obtained from the above equation are sent to the blocks of the next stack . This procedure is repeated until the last stack as the following equations . z ( i ) t , s ( i ) ft , s ( i ) dt = Transformeri ( z ( i−1 ) t , s̃ ( i−1 ) f , s̃ ( i−1 ) d ) ( 9 ) z ( i ) l , s ( i ) fl , s ( i ) dl = Linearlayeri ( z ( i−1 ) l , s̃ ( i−1 ) f , s̃ ( i−1 ) d ) ( 10 ) s̃ ( i ) f = Sf ( s ( i ) ft , s ( i ) fl ) s̃ ( i ) d = Sd ( s ( i ) dt , s ( i ) dl ) ( 11 ) Finally , the output values of the last stack , zLl and z L t are added as the output of SALT . This value also becomes the contextual embedding valuesẼ ( xi ) = [ ẽ ( [ cls ] ) , ẽ ( x1 ) , · · · , ẽ ( xn ) ] . The cls token , ẽ ( [ cls ] ) is used for fine-tuning , and the other values , ẽ ( xi ) are used for pre-training using MLM ( Masked Language Model ) ( Devlin et al. , 2019 ) .
This paper introduces a Transformer-based architecture for tabular datasets. This architecture combines a Transformer with a gating MLP (gMLP) by sharing the attention matrices. The authors also proposed a new approach to encode continuous variables. The proposed model is evaluated on six binary classification tabular datasets. The proposed model is evaluated in a supervised learning context, but also in a semi-supervised context.
SP:5d9c3dca9bf4570f1fabb4c8e2b5f3084f78546c
Towards General Function Approximation in Zero-Sum Markov Games
√ d factor in the regret when the reward function and transition kernel are parameterized with d-dimensional linear features . In the coordinated setting where both players are controlled by the agent , we propose a model-based algorithm and a model-free algorithm . In the model-based algorithm , we prove that sample complexity can be bounded by a generalization of Witness rank to Markov games . The model-free algorithm enjoys a √ K-regret upper bound where K is the number of episodes . 1 INTRODUCTION . In competitive reinforcement learning , there are two agents competing against each other by taking actions . Their actions together determine the state evolutions and rewards . Function approximation , especially deep neural networks ( LeCun et al. , 2015 ) , contributes to the success of RL in many real world applications , such as Atari ( Mnih et al. , 2013 ) , Go ( Silver et al. , 2015 ) , autonomous driving ( Shalev-Shwartz et al. , 2016 ) , Texas holdem poker ( Sandholm , 2017 ) , and Dota ( Berner et al. , 2019 ) . The goal of competitive reinforcement learning aims to learn the Nash Equilibrium ( NE ) policy in a trial-and-error fashion . In a NE , no agent can be better off by unilaterally deviating from her policy . Most of the existing sample efficient competitive RL algorithms focus on the tabular or linear function approximation cases ( Pérolat et al. , 2017 ; Bai & Jin. , 2020 ; Bai et al. , 2021 ; 2020 ; Xie et al. , 2020 ; Zhang et al. , 2020 ) . The huge empirical success of neural network based RL methods has remained largely unexplained . Thus , there exists a wide gap between theory and practice in competitive RL with general function approximation . One demanding question to ask is : Can we establish provably efficient competitive RL algorithms with general function approximation ? In this paper , we make a step towards answering this question by providing structural conditions and complexity measures of Markov Games and function classes that allow for efficient learning . We focus on episodic zero-sum Markov Game ( MG ) with simultaneous move , where each episode consists of H time steps and two players act simultaneously at each time step . The state space is arbitrarily large and can be infinite . We consider two function approximation settings : 1 ) use a general function class F to approximate the action-value function ( Q function ) ; 2 ) use a general function classM to approximate the environment . To this end , we introduce algorithms based on optimistic principles . Due to subtle game-theoretic issues , naive optimism is no longer working in Markov games where minimax optimization is performed . To deal with this issue , we use the algorithmic idea called ‘ alternate optimism ’ . Specifically , we develop algorithms for both coordinated and decoupled setting . In the decoupled setting , the agent controls one player and plays against an arbitrary and potentially adversarial opponent . The sample efficiency is measured by the gap between the learned value and value of the Nash Equilibrium . In the coordinated setting , the agent controls both players and the goal is to find the approximate Nash Equilibrium , i.e . with small duality gap . We identify key complexity measures of function classes to examine the effectiveness of elimination . By doing so , we prove upper bounds on sample complexity and regrets of the presented procedures that are independent of the number of states . Our contributions are summarized into the following two folds : • In the decoupled setting , we introduce Minimax Eluder dimension–a new complexity measure for competitive RL problems . We propose an algorithm that incurs at most Õ ( H √ dEK logNF ) 1 regret in K episodes where dE denotes the Minimax Eluder di- mension NF denotes the covering number of function class , with probability at least 1− p. As a special case , this result improves Xie et al . ( 2020 ) by a √ d multiplicative factor in their setting when the reward function and transition kernel are linearly parameterized and d is the dimension of feature mapping . • In coordinated settings , we propose both model-based and model free algorithms . In the model-based setting , we generalize the witness rank ( Sun et al. , 2019a ) to competitive RL . We prove that Õ ( H3W 2/ϵ2 ) samples are enough to learn a policy ϵ-close to the Nash Equilibrium , where W is witness rank . In the model-free setting , we develop algorithm for agnostic learning with a candidate policy class Π . The algorithm incurs at most Õ ( H √ dK log ( NFNΠ ) ) regret . Here d is a variant of Minimax Eluder dimension and NΠ denotes the covering number of policy class . 1.1 RELATED WORKS . There is a rich literature studying the learning and decision-making of Markov Games ( Littman & Szepesvari , 1996 ; Greenwald et al. , 2003 ; Grau-Moya et al. , 2018 ; Pérolat et al. , 2018 ; Srinivasan et al. , 2018 ; Sidford et al. , 2020 ; Wei et al. , 2017 ; Pérolat et al. , 2017 ; Bai & Jin. , 2020 ; Bai et al. , 2021 ; 2020 ; Zhang et al. , 2020 ; Zhao et al. , 2021 ) . The most related to us are perhaps ( Xie et al. , 2020 ; Chen et al. , 2021 ; Jin et al. , 2021b ) , where the authors address the challenge of explorationexploitation tradeoff in large state spaces . Due to space constraint , a detailed literature discussion is deferred to Appendix A . 1.2 TECHNICAL CHALLENGES . Previous work ( Xie et al. , 2020 ) imposes optimistic bonus on the action-value functions in every stateaction pairs and performs planning by the Coarse Correlated Equilibrium ( CCE ) on the optimistic value functions . To achieve improved rates , we leverage the idea of ‘ global optimism ’ ( Zanette et al. , 2020 ; Jin et al. , 2021a ; Du et al. , 2021 ) , which maintains a constraint set of candidate functions that do not deviate much from the empirical estimates and performs optimistic planning on the initial state . However , going beyond MDPs towards MGs , two problems arise . First , the concentration property of functions in constraint set is hard to characterize due to multi-agent interplay . For this , we use the concentration methods in Jin et al . ( 2021a ) and extend it from MDPs to MGs . The second and more prominent issue is the exploration and exploitation tradeoff . Since ‘ global optimism ’ only obtains optimism along the trajectories of behaviour policies , it may not guarantee optimism on the trajectories of target policies ( i.e . NE ) . As a result , directly using CCE to plan will cause the duality gaps to diverge . To deal with this problem , we apply ‘ alternate optimism ’ to guide explorations , which was previously used in Wei et al . ( 2017 ) for model-based methods . The ‘ alternate optimism ’ used in this work is slightly different for value-based methods . We prove two regret decomposition lemmata to support this optimism principle . 2 PRELIMINARIES . We consider two-player zero-sum simultaneous-moves episodic Markov game , defined by the tuple ( S , A1 , A2 , r , P , H ) 1We use Õ to hide logarithmic terms in H , 1/p and K. where S is the state space , Ai is a finite set of actions that player i ∈ { 1 , 2 } can take , r is the reward function , P is the transition kernel and H is the number of time steps . At each time step h ∈ [ H ] , player P1 and P2 take actions a ∈ A1 and b ∈ A2 respectively upon observing the state x ∈ S , and then both receive the reward rh ( x , a , b ) . The system then transitions to a new state x′ ∼ Ph ( ·|x , a , b ) according to the transition kernel P. Throughout this paper , we assume for simplicity that A1 = A2 = A and that the rewards rh ( x , a , b ) are deterministic functions of the tuple ( x , a , b ) taking values in [ −1 , 1 ] . Turn-based games are special cases of simultaneous games in the sense that at each state the reward and transition are independent of one player ’ s action ( Xie et al. , 2020 ) . Generalizations to A1 ̸= A2 and stochastic reward are also straightforward . Denote by ∆ : = ∆ ( A ) the probability simplex over the action space A . A stochastic policy of P1 is a length-H sequence of functions π : = { πh : S 7→ ∆ } h∈ [ H ] . At each step h ∈ [ H ] and state x ∈ S , P1 takes an action sampled from the distribution πh ( x ) over A . Similarly , a stochastic policy of P2 is given by the sequence ν : = { νh : S 7→ ∆ } h∈ [ H ] . The learning happens in K episodes . In each episode k , each player P1 and P2 proposes a policy πk and νk respectively based on history up to the end of episode k − 1 and then executes the policy to observe the trajectories { xkh , akh , bkh } Hh=1 . For a fixed policy pair ( π , ν ) , the value function and Q functions for zero-sum game is defined by V π , νh0 ( x ) : = E [ H∑ h=h0 rh ( xh , ah , bh ) |xh0 = x ] , Qπ , νh0 ( x , a , b ) : = E [ H∑ h=h0 rh ( xh , ah , bh ) |xh0 = x , ah0 = a , bh0 = b ] , where the expectation is over ah ∼ πh ( xh ) , bh ∼ νh ( xh ) and xh+1 ∼ Ph ( ·|xh , ah , bh ) . V π , ν1 and Qπ , ν1 are often abbreviated to V π , ν and Qπ , ν . In zero-sum games , PI aims to maximize V π , ν ( x1 ) and P2 aims to minimize V π , ν ( x1 ) . Given policy π of P1 , the best response policy of P2 is defined by ν∗π : = argminνV π , ν ( x1 ) . Similarly given policy ν of P2 , the best response policy of P1 is defined by π∗ν : = argmaxπV π , ν ( x1 ) . Then from definitions , V π , ν ∗ π ( x1 ) ≤ V π ∗ , ν∗ ( x1 ) ≤ V π ∗ ν , ν ( x1 ) and the equality holds for the Nash Equilibrium ( NE ) of the game ( π∗ , ν∗ ) . We abbreviate V π ∗ , ν∗ ( x1 ) as V ∗ and Qπ ∗ , ν∗ ( x1 ) as Q∗ . V ∗ is often referred to as the value of the game . As common in Markov games literature ( Pérolat et al. , 2015 ) , we will use the following Bellman operator ThQh+1 ( x , a , b ) : = r ( x , a , b ) + E x′∼Ph ( ·|x , a , b ) [ max π′ min ν′ V π ′ , ν′ h+1 ( x ′ ) ] , ( 1 ) and the following Bellman operator for fixed P1 ’ s policy T πh Qh+1 ( x , a , b ) : = r ( x , a , b ) + E x′∼Ph ( ·|x , a , b ) [ min ν′ V π , ν ′ h+1 ( x ′ ) ] . ( 2 ) Notations For a integer H , [ H ] denotes the set { 1 , 2 , . . . , H } . For a finite set S , |S| denotes its cardinality . For a matrix A ∈ Rd , Ai , ∗ and A∗ , j denote the i-th row and j-th column of A respectively . For a function f : S 7→ R , ∥f∥∞ denotes sups∈S |f ( s ) | . We use N ( F , ϵ ) to denote the ϵ-covering number of F under metric d ( f , g ) = maxh ∥fh − gh∥∞ .
This paper presents sample efficient algorithms for learning in two-player zero-sum markov games. The algorithms are for decoupled and coordinated settings, the latter of which is based on 'alternate optimism'. The authors also extend the Eluder dimension of MDPs to to zero-sum markov games using the minimax Bellman operator.
SP:fb48170c7291081f7cbb2b9ece5c088a1e568718
Towards General Function Approximation in Zero-Sum Markov Games
√ d factor in the regret when the reward function and transition kernel are parameterized with d-dimensional linear features . In the coordinated setting where both players are controlled by the agent , we propose a model-based algorithm and a model-free algorithm . In the model-based algorithm , we prove that sample complexity can be bounded by a generalization of Witness rank to Markov games . The model-free algorithm enjoys a √ K-regret upper bound where K is the number of episodes . 1 INTRODUCTION . In competitive reinforcement learning , there are two agents competing against each other by taking actions . Their actions together determine the state evolutions and rewards . Function approximation , especially deep neural networks ( LeCun et al. , 2015 ) , contributes to the success of RL in many real world applications , such as Atari ( Mnih et al. , 2013 ) , Go ( Silver et al. , 2015 ) , autonomous driving ( Shalev-Shwartz et al. , 2016 ) , Texas holdem poker ( Sandholm , 2017 ) , and Dota ( Berner et al. , 2019 ) . The goal of competitive reinforcement learning aims to learn the Nash Equilibrium ( NE ) policy in a trial-and-error fashion . In a NE , no agent can be better off by unilaterally deviating from her policy . Most of the existing sample efficient competitive RL algorithms focus on the tabular or linear function approximation cases ( Pérolat et al. , 2017 ; Bai & Jin. , 2020 ; Bai et al. , 2021 ; 2020 ; Xie et al. , 2020 ; Zhang et al. , 2020 ) . The huge empirical success of neural network based RL methods has remained largely unexplained . Thus , there exists a wide gap between theory and practice in competitive RL with general function approximation . One demanding question to ask is : Can we establish provably efficient competitive RL algorithms with general function approximation ? In this paper , we make a step towards answering this question by providing structural conditions and complexity measures of Markov Games and function classes that allow for efficient learning . We focus on episodic zero-sum Markov Game ( MG ) with simultaneous move , where each episode consists of H time steps and two players act simultaneously at each time step . The state space is arbitrarily large and can be infinite . We consider two function approximation settings : 1 ) use a general function class F to approximate the action-value function ( Q function ) ; 2 ) use a general function classM to approximate the environment . To this end , we introduce algorithms based on optimistic principles . Due to subtle game-theoretic issues , naive optimism is no longer working in Markov games where minimax optimization is performed . To deal with this issue , we use the algorithmic idea called ‘ alternate optimism ’ . Specifically , we develop algorithms for both coordinated and decoupled setting . In the decoupled setting , the agent controls one player and plays against an arbitrary and potentially adversarial opponent . The sample efficiency is measured by the gap between the learned value and value of the Nash Equilibrium . In the coordinated setting , the agent controls both players and the goal is to find the approximate Nash Equilibrium , i.e . with small duality gap . We identify key complexity measures of function classes to examine the effectiveness of elimination . By doing so , we prove upper bounds on sample complexity and regrets of the presented procedures that are independent of the number of states . Our contributions are summarized into the following two folds : • In the decoupled setting , we introduce Minimax Eluder dimension–a new complexity measure for competitive RL problems . We propose an algorithm that incurs at most Õ ( H √ dEK logNF ) 1 regret in K episodes where dE denotes the Minimax Eluder di- mension NF denotes the covering number of function class , with probability at least 1− p. As a special case , this result improves Xie et al . ( 2020 ) by a √ d multiplicative factor in their setting when the reward function and transition kernel are linearly parameterized and d is the dimension of feature mapping . • In coordinated settings , we propose both model-based and model free algorithms . In the model-based setting , we generalize the witness rank ( Sun et al. , 2019a ) to competitive RL . We prove that Õ ( H3W 2/ϵ2 ) samples are enough to learn a policy ϵ-close to the Nash Equilibrium , where W is witness rank . In the model-free setting , we develop algorithm for agnostic learning with a candidate policy class Π . The algorithm incurs at most Õ ( H √ dK log ( NFNΠ ) ) regret . Here d is a variant of Minimax Eluder dimension and NΠ denotes the covering number of policy class . 1.1 RELATED WORKS . There is a rich literature studying the learning and decision-making of Markov Games ( Littman & Szepesvari , 1996 ; Greenwald et al. , 2003 ; Grau-Moya et al. , 2018 ; Pérolat et al. , 2018 ; Srinivasan et al. , 2018 ; Sidford et al. , 2020 ; Wei et al. , 2017 ; Pérolat et al. , 2017 ; Bai & Jin. , 2020 ; Bai et al. , 2021 ; 2020 ; Zhang et al. , 2020 ; Zhao et al. , 2021 ) . The most related to us are perhaps ( Xie et al. , 2020 ; Chen et al. , 2021 ; Jin et al. , 2021b ) , where the authors address the challenge of explorationexploitation tradeoff in large state spaces . Due to space constraint , a detailed literature discussion is deferred to Appendix A . 1.2 TECHNICAL CHALLENGES . Previous work ( Xie et al. , 2020 ) imposes optimistic bonus on the action-value functions in every stateaction pairs and performs planning by the Coarse Correlated Equilibrium ( CCE ) on the optimistic value functions . To achieve improved rates , we leverage the idea of ‘ global optimism ’ ( Zanette et al. , 2020 ; Jin et al. , 2021a ; Du et al. , 2021 ) , which maintains a constraint set of candidate functions that do not deviate much from the empirical estimates and performs optimistic planning on the initial state . However , going beyond MDPs towards MGs , two problems arise . First , the concentration property of functions in constraint set is hard to characterize due to multi-agent interplay . For this , we use the concentration methods in Jin et al . ( 2021a ) and extend it from MDPs to MGs . The second and more prominent issue is the exploration and exploitation tradeoff . Since ‘ global optimism ’ only obtains optimism along the trajectories of behaviour policies , it may not guarantee optimism on the trajectories of target policies ( i.e . NE ) . As a result , directly using CCE to plan will cause the duality gaps to diverge . To deal with this problem , we apply ‘ alternate optimism ’ to guide explorations , which was previously used in Wei et al . ( 2017 ) for model-based methods . The ‘ alternate optimism ’ used in this work is slightly different for value-based methods . We prove two regret decomposition lemmata to support this optimism principle . 2 PRELIMINARIES . We consider two-player zero-sum simultaneous-moves episodic Markov game , defined by the tuple ( S , A1 , A2 , r , P , H ) 1We use Õ to hide logarithmic terms in H , 1/p and K. where S is the state space , Ai is a finite set of actions that player i ∈ { 1 , 2 } can take , r is the reward function , P is the transition kernel and H is the number of time steps . At each time step h ∈ [ H ] , player P1 and P2 take actions a ∈ A1 and b ∈ A2 respectively upon observing the state x ∈ S , and then both receive the reward rh ( x , a , b ) . The system then transitions to a new state x′ ∼ Ph ( ·|x , a , b ) according to the transition kernel P. Throughout this paper , we assume for simplicity that A1 = A2 = A and that the rewards rh ( x , a , b ) are deterministic functions of the tuple ( x , a , b ) taking values in [ −1 , 1 ] . Turn-based games are special cases of simultaneous games in the sense that at each state the reward and transition are independent of one player ’ s action ( Xie et al. , 2020 ) . Generalizations to A1 ̸= A2 and stochastic reward are also straightforward . Denote by ∆ : = ∆ ( A ) the probability simplex over the action space A . A stochastic policy of P1 is a length-H sequence of functions π : = { πh : S 7→ ∆ } h∈ [ H ] . At each step h ∈ [ H ] and state x ∈ S , P1 takes an action sampled from the distribution πh ( x ) over A . Similarly , a stochastic policy of P2 is given by the sequence ν : = { νh : S 7→ ∆ } h∈ [ H ] . The learning happens in K episodes . In each episode k , each player P1 and P2 proposes a policy πk and νk respectively based on history up to the end of episode k − 1 and then executes the policy to observe the trajectories { xkh , akh , bkh } Hh=1 . For a fixed policy pair ( π , ν ) , the value function and Q functions for zero-sum game is defined by V π , νh0 ( x ) : = E [ H∑ h=h0 rh ( xh , ah , bh ) |xh0 = x ] , Qπ , νh0 ( x , a , b ) : = E [ H∑ h=h0 rh ( xh , ah , bh ) |xh0 = x , ah0 = a , bh0 = b ] , where the expectation is over ah ∼ πh ( xh ) , bh ∼ νh ( xh ) and xh+1 ∼ Ph ( ·|xh , ah , bh ) . V π , ν1 and Qπ , ν1 are often abbreviated to V π , ν and Qπ , ν . In zero-sum games , PI aims to maximize V π , ν ( x1 ) and P2 aims to minimize V π , ν ( x1 ) . Given policy π of P1 , the best response policy of P2 is defined by ν∗π : = argminνV π , ν ( x1 ) . Similarly given policy ν of P2 , the best response policy of P1 is defined by π∗ν : = argmaxπV π , ν ( x1 ) . Then from definitions , V π , ν ∗ π ( x1 ) ≤ V π ∗ , ν∗ ( x1 ) ≤ V π ∗ ν , ν ( x1 ) and the equality holds for the Nash Equilibrium ( NE ) of the game ( π∗ , ν∗ ) . We abbreviate V π ∗ , ν∗ ( x1 ) as V ∗ and Qπ ∗ , ν∗ ( x1 ) as Q∗ . V ∗ is often referred to as the value of the game . As common in Markov games literature ( Pérolat et al. , 2015 ) , we will use the following Bellman operator ThQh+1 ( x , a , b ) : = r ( x , a , b ) + E x′∼Ph ( ·|x , a , b ) [ max π′ min ν′ V π ′ , ν′ h+1 ( x ′ ) ] , ( 1 ) and the following Bellman operator for fixed P1 ’ s policy T πh Qh+1 ( x , a , b ) : = r ( x , a , b ) + E x′∼Ph ( ·|x , a , b ) [ min ν′ V π , ν ′ h+1 ( x ′ ) ] . ( 2 ) Notations For a integer H , [ H ] denotes the set { 1 , 2 , . . . , H } . For a finite set S , |S| denotes its cardinality . For a matrix A ∈ Rd , Ai , ∗ and A∗ , j denote the i-th row and j-th column of A respectively . For a function f : S 7→ R , ∥f∥∞ denotes sups∈S |f ( s ) | . We use N ( F , ϵ ) to denote the ϵ-covering number of F under metric d ( f , g ) = maxh ∥fh − gh∥∞ .
This paper studies efficient function approxiamtion in two-player zero-sum Markov games with general function classes. Both decoupled and coordinated settings for learning agents are considered. Model-free algorithms for both settings and model-based algorithm for the leter are provided, all with proved sample complexities.
SP:fb48170c7291081f7cbb2b9ece5c088a1e568718
Towards General Function Approximation in Zero-Sum Markov Games
√ d factor in the regret when the reward function and transition kernel are parameterized with d-dimensional linear features . In the coordinated setting where both players are controlled by the agent , we propose a model-based algorithm and a model-free algorithm . In the model-based algorithm , we prove that sample complexity can be bounded by a generalization of Witness rank to Markov games . The model-free algorithm enjoys a √ K-regret upper bound where K is the number of episodes . 1 INTRODUCTION . In competitive reinforcement learning , there are two agents competing against each other by taking actions . Their actions together determine the state evolutions and rewards . Function approximation , especially deep neural networks ( LeCun et al. , 2015 ) , contributes to the success of RL in many real world applications , such as Atari ( Mnih et al. , 2013 ) , Go ( Silver et al. , 2015 ) , autonomous driving ( Shalev-Shwartz et al. , 2016 ) , Texas holdem poker ( Sandholm , 2017 ) , and Dota ( Berner et al. , 2019 ) . The goal of competitive reinforcement learning aims to learn the Nash Equilibrium ( NE ) policy in a trial-and-error fashion . In a NE , no agent can be better off by unilaterally deviating from her policy . Most of the existing sample efficient competitive RL algorithms focus on the tabular or linear function approximation cases ( Pérolat et al. , 2017 ; Bai & Jin. , 2020 ; Bai et al. , 2021 ; 2020 ; Xie et al. , 2020 ; Zhang et al. , 2020 ) . The huge empirical success of neural network based RL methods has remained largely unexplained . Thus , there exists a wide gap between theory and practice in competitive RL with general function approximation . One demanding question to ask is : Can we establish provably efficient competitive RL algorithms with general function approximation ? In this paper , we make a step towards answering this question by providing structural conditions and complexity measures of Markov Games and function classes that allow for efficient learning . We focus on episodic zero-sum Markov Game ( MG ) with simultaneous move , where each episode consists of H time steps and two players act simultaneously at each time step . The state space is arbitrarily large and can be infinite . We consider two function approximation settings : 1 ) use a general function class F to approximate the action-value function ( Q function ) ; 2 ) use a general function classM to approximate the environment . To this end , we introduce algorithms based on optimistic principles . Due to subtle game-theoretic issues , naive optimism is no longer working in Markov games where minimax optimization is performed . To deal with this issue , we use the algorithmic idea called ‘ alternate optimism ’ . Specifically , we develop algorithms for both coordinated and decoupled setting . In the decoupled setting , the agent controls one player and plays against an arbitrary and potentially adversarial opponent . The sample efficiency is measured by the gap between the learned value and value of the Nash Equilibrium . In the coordinated setting , the agent controls both players and the goal is to find the approximate Nash Equilibrium , i.e . with small duality gap . We identify key complexity measures of function classes to examine the effectiveness of elimination . By doing so , we prove upper bounds on sample complexity and regrets of the presented procedures that are independent of the number of states . Our contributions are summarized into the following two folds : • In the decoupled setting , we introduce Minimax Eluder dimension–a new complexity measure for competitive RL problems . We propose an algorithm that incurs at most Õ ( H √ dEK logNF ) 1 regret in K episodes where dE denotes the Minimax Eluder di- mension NF denotes the covering number of function class , with probability at least 1− p. As a special case , this result improves Xie et al . ( 2020 ) by a √ d multiplicative factor in their setting when the reward function and transition kernel are linearly parameterized and d is the dimension of feature mapping . • In coordinated settings , we propose both model-based and model free algorithms . In the model-based setting , we generalize the witness rank ( Sun et al. , 2019a ) to competitive RL . We prove that Õ ( H3W 2/ϵ2 ) samples are enough to learn a policy ϵ-close to the Nash Equilibrium , where W is witness rank . In the model-free setting , we develop algorithm for agnostic learning with a candidate policy class Π . The algorithm incurs at most Õ ( H √ dK log ( NFNΠ ) ) regret . Here d is a variant of Minimax Eluder dimension and NΠ denotes the covering number of policy class . 1.1 RELATED WORKS . There is a rich literature studying the learning and decision-making of Markov Games ( Littman & Szepesvari , 1996 ; Greenwald et al. , 2003 ; Grau-Moya et al. , 2018 ; Pérolat et al. , 2018 ; Srinivasan et al. , 2018 ; Sidford et al. , 2020 ; Wei et al. , 2017 ; Pérolat et al. , 2017 ; Bai & Jin. , 2020 ; Bai et al. , 2021 ; 2020 ; Zhang et al. , 2020 ; Zhao et al. , 2021 ) . The most related to us are perhaps ( Xie et al. , 2020 ; Chen et al. , 2021 ; Jin et al. , 2021b ) , where the authors address the challenge of explorationexploitation tradeoff in large state spaces . Due to space constraint , a detailed literature discussion is deferred to Appendix A . 1.2 TECHNICAL CHALLENGES . Previous work ( Xie et al. , 2020 ) imposes optimistic bonus on the action-value functions in every stateaction pairs and performs planning by the Coarse Correlated Equilibrium ( CCE ) on the optimistic value functions . To achieve improved rates , we leverage the idea of ‘ global optimism ’ ( Zanette et al. , 2020 ; Jin et al. , 2021a ; Du et al. , 2021 ) , which maintains a constraint set of candidate functions that do not deviate much from the empirical estimates and performs optimistic planning on the initial state . However , going beyond MDPs towards MGs , two problems arise . First , the concentration property of functions in constraint set is hard to characterize due to multi-agent interplay . For this , we use the concentration methods in Jin et al . ( 2021a ) and extend it from MDPs to MGs . The second and more prominent issue is the exploration and exploitation tradeoff . Since ‘ global optimism ’ only obtains optimism along the trajectories of behaviour policies , it may not guarantee optimism on the trajectories of target policies ( i.e . NE ) . As a result , directly using CCE to plan will cause the duality gaps to diverge . To deal with this problem , we apply ‘ alternate optimism ’ to guide explorations , which was previously used in Wei et al . ( 2017 ) for model-based methods . The ‘ alternate optimism ’ used in this work is slightly different for value-based methods . We prove two regret decomposition lemmata to support this optimism principle . 2 PRELIMINARIES . We consider two-player zero-sum simultaneous-moves episodic Markov game , defined by the tuple ( S , A1 , A2 , r , P , H ) 1We use Õ to hide logarithmic terms in H , 1/p and K. where S is the state space , Ai is a finite set of actions that player i ∈ { 1 , 2 } can take , r is the reward function , P is the transition kernel and H is the number of time steps . At each time step h ∈ [ H ] , player P1 and P2 take actions a ∈ A1 and b ∈ A2 respectively upon observing the state x ∈ S , and then both receive the reward rh ( x , a , b ) . The system then transitions to a new state x′ ∼ Ph ( ·|x , a , b ) according to the transition kernel P. Throughout this paper , we assume for simplicity that A1 = A2 = A and that the rewards rh ( x , a , b ) are deterministic functions of the tuple ( x , a , b ) taking values in [ −1 , 1 ] . Turn-based games are special cases of simultaneous games in the sense that at each state the reward and transition are independent of one player ’ s action ( Xie et al. , 2020 ) . Generalizations to A1 ̸= A2 and stochastic reward are also straightforward . Denote by ∆ : = ∆ ( A ) the probability simplex over the action space A . A stochastic policy of P1 is a length-H sequence of functions π : = { πh : S 7→ ∆ } h∈ [ H ] . At each step h ∈ [ H ] and state x ∈ S , P1 takes an action sampled from the distribution πh ( x ) over A . Similarly , a stochastic policy of P2 is given by the sequence ν : = { νh : S 7→ ∆ } h∈ [ H ] . The learning happens in K episodes . In each episode k , each player P1 and P2 proposes a policy πk and νk respectively based on history up to the end of episode k − 1 and then executes the policy to observe the trajectories { xkh , akh , bkh } Hh=1 . For a fixed policy pair ( π , ν ) , the value function and Q functions for zero-sum game is defined by V π , νh0 ( x ) : = E [ H∑ h=h0 rh ( xh , ah , bh ) |xh0 = x ] , Qπ , νh0 ( x , a , b ) : = E [ H∑ h=h0 rh ( xh , ah , bh ) |xh0 = x , ah0 = a , bh0 = b ] , where the expectation is over ah ∼ πh ( xh ) , bh ∼ νh ( xh ) and xh+1 ∼ Ph ( ·|xh , ah , bh ) . V π , ν1 and Qπ , ν1 are often abbreviated to V π , ν and Qπ , ν . In zero-sum games , PI aims to maximize V π , ν ( x1 ) and P2 aims to minimize V π , ν ( x1 ) . Given policy π of P1 , the best response policy of P2 is defined by ν∗π : = argminνV π , ν ( x1 ) . Similarly given policy ν of P2 , the best response policy of P1 is defined by π∗ν : = argmaxπV π , ν ( x1 ) . Then from definitions , V π , ν ∗ π ( x1 ) ≤ V π ∗ , ν∗ ( x1 ) ≤ V π ∗ ν , ν ( x1 ) and the equality holds for the Nash Equilibrium ( NE ) of the game ( π∗ , ν∗ ) . We abbreviate V π ∗ , ν∗ ( x1 ) as V ∗ and Qπ ∗ , ν∗ ( x1 ) as Q∗ . V ∗ is often referred to as the value of the game . As common in Markov games literature ( Pérolat et al. , 2015 ) , we will use the following Bellman operator ThQh+1 ( x , a , b ) : = r ( x , a , b ) + E x′∼Ph ( ·|x , a , b ) [ max π′ min ν′ V π ′ , ν′ h+1 ( x ′ ) ] , ( 1 ) and the following Bellman operator for fixed P1 ’ s policy T πh Qh+1 ( x , a , b ) : = r ( x , a , b ) + E x′∼Ph ( ·|x , a , b ) [ min ν′ V π , ν ′ h+1 ( x ′ ) ] . ( 2 ) Notations For a integer H , [ H ] denotes the set { 1 , 2 , . . . , H } . For a finite set S , |S| denotes its cardinality . For a matrix A ∈ Rd , Ai , ∗ and A∗ , j denote the i-th row and j-th column of A respectively . For a function f : S 7→ R , ∥f∥∞ denotes sups∈S |f ( s ) | . We use N ( F , ϵ ) to denote the ϵ-covering number of F under metric d ( f , g ) = maxh ∥fh − gh∥∞ .
This paper considers zero-sum Markov games in a general regime where the model is parameterized by general function classes. The goal of this research is to investigate reinforcement learning algorithms that learn a Nash policy in a trial-and-error fashion. The level of generality is achieved by introducing two complexity measures: The minimax Eluder dimension and the witness rank. The main result three algorithms with provable regret upper bounds involving covering numbers and the minimax Eluder dimension.
SP:fb48170c7291081f7cbb2b9ece5c088a1e568718
PriorGrad: Improving Conditional Denoising Diffusion Models with Data-Dependent Adaptive Prior
Denoising diffusion probabilistic models have been recently proposed to generate high-quality samples by estimating the gradient of the data density . The framework defines the prior noise as a standard Gaussian distribution , whereas the corresponding data distribution may be more complicated than the standard Gaussian distribution , which potentially introduces inefficiency in denoising the prior noise into the data sample because of the discrepancy between the data and the prior . In this paper , we propose PriorGrad to improve the efficiency of the conditional diffusion model for speech synthesis ( for example , a vocoder using a mel-spectrogram as the condition ) by applying an adaptive prior derived from the data statistics based on the conditional information . We formulate the training and sampling procedures of PriorGrad and demonstrate the advantages of an adaptive prior through a theoretical analysis . Focusing on the speech synthesis domain , we consider the recently proposed diffusion-based speech generative models based on both the spectral and time domains and show that PriorGrad achieves faster convergence and inference with superior performance , leading to an improved perceptual quality and robustness to a smaller network capacity , and thereby demonstrating the efficiency of a data-dependent adaptive prior . 1 INTRODUCTION . Deep generative models have been achieving rapid progress , by which deep neural networks approximate the data distribution and synthesize realistic samples from the model . There is a wide range of this type of approach , ranging from autoregressive models ( Oord et al. , 2016a ; b ) , generative adversarial networks ( Goodfellow et al. , 2014 ; Brock et al. , 2019 ) , variational autoencoders ( Kingma & Welling , 2013 ; Vahdat & Kautz , 2020 ) , and normalizing flows ( Rezende & Mohamed , 2015 ; Kingma & Dhariwal , 2018 ) . Denoising diffusion probabilistic models ( DDPMs ) ( Ho et al. , 2020 ) and score matching ( SM ) ( Song & Ermon , 2019 ) are recently proposed categories that can be used to synthesize high-fidelity samples with competitive or sometimes better quality than previous state-of-the-art approaches . Consequently , there have been a variety of applications based on DDPM or SM ( Saharia et al. , 2021 ; Kawar et al. , 2021 ) . Speech synthesis is one of the most successful applications , where the diffusion model can synthesize spectral or time-domain audio conditioned on text or spectral information , respectively , achieving a competitive quality but faster sampling ( Chen et al. , 2021 ; Kong et al. , 2021 ; Jeong et al. , 2021 ; Lee & Han , 2021 ) than autoregressive models ( Oord et al. , 2016b ; Kalchbrenner et al. , 2018 ) . ∗Work done during an internship at Microsoft Research Asia †Corresponding Authors However , although the diffusion-based speech synthesis models have achieved high-quality speech audio generation , they exhibit potential inefficiency , which may necessitate advanced strategies . For example , the model suffers from a significantly slow convergence during training , and a prohibitively large training computation time is required to learn the approximate reverse diffusion process . We investigate the diffuion-based models and observe the discrepancy between the real data distribution and the choice of the prior . Existing diffusion-based models define a standard Gaussian as the prior distribution and design a non-parametric diffusion process that procedurally destroys the signal into the prior noise . The deep neural network is trained to approximate the reverse diffusion process by estimating the gradient of the data density . Although applying the standard Gaussian as the prior is simple without any assumptions on the target data , it also introduces inefficiency . For example , in time-domain waveform data , the signal has extremely high variability between different segments such as voiced and unvoiced parts . Jointly modeling the voiced and unvoiced segments with the same standard Gaussian prior may be difficult for the model to cover all modes of the data , leading to training inefficiencies and potentially spurious diffusion trajectories . Given the previous reasoning , we assessed the following question : For a conditional diffusion-based model , can we formulate a more informative prior without incorporating additional computational or parameter complexity ? To investigate this , we propose a simple yet effective method , called PriorGrad , that uses adaptive noise by directly computing the mean and variance for the forward diffusion process prior , based on the conditional information . Specifically , using a conditional speech synthesis model , we propose structuring the prior distribution based on the conditional data , such as a mel-spectrogram for the vocoder ( Chen et al. , 2021 ; Kong et al. , 2021 ) and a phoneme for the acoustic model ( Jeong et al. , 2021 ) . By computing the statistics from the conditional data at the frame level ( vocoder ) or phoneme-level ( acoustic model ) granularity and mapping them as the mean and variance of the Gaussian prior , we can structure the noise that is similar to the target data distribution at an instance level , easing the burden of learning the reverse diffusion process . We implemented PriorGrad based on the recently proposed diffusion-based speech generative models ( Kong et al. , 2021 ; Chen et al. , 2021 ; Jeong et al. , 2021 ) , and conducted experiments on the LJSpeech ( Ito & Johnson , 2017 ) dataset . The experimental results demonstrate the benefits of PriorGrad , such as a significantly faster model convergence during training , improved perceptual quality , and an improved tolerance to a reduction in network capacity . Our contributions are as follows : • To the best of our knowledge , our study is one of the first to systematically investigate the effect of using a non-standard Gaussian distribution as the forward diffusion process prior to the conditional generative model . • Compared to previous non-parametric forward diffusion without any assumption , we show that the model performance is significantly improved with faster convergence by leveraging the conditional information as the adaptive prior . • We provide a comprehensive empirical study and analysis of the diffusion model behavior in speech generative models , in both the spectral and waveform domains , and demonstrate the effectiveness of the method , such as a significantly accelerated inference and improved quality . 2 BACKGROUND . In this section , we describe the basic formulation of the diffusion-based model and provide related studies , along with a description of our contribution with PriorGrad . Basic formulation Denoising diffusion probabilistic models ( DDPM ) ( Ho et al. , 2020 ) are recently proposed deep generative models defined by two Markov chains : forward and reverse processes . The forward process procedurally destroys the data x0 into a standard Gaussian xT , as follows : q ( x1 : T |x0 ) = T∏ t=1 q ( xt|xt−1 ) , q ( xt|xt−1 ) : = N ( xt ; √ 1− βtxt−1 , βtI ) , ( 1 ) where q ( xt|xt−1 ) represents the transition probability at the t-th step using a user-defined noise schedule βt ∈ { β1 , ... , βT } . Thus , the noisy distribution of xt is the closed form of q ( xt|x0 ) = N ( xt ; √ ᾱtx0 , ( 1− ᾱt ) I ) , where αt : = 1−βt , ᾱt : = ∏t s=1 αs . q ( xT |x0 ) converges in distribution to the standard Gaussian N ( xT ; 0 , I ) if ᾱT is small enough based on a carefully designed noise schedule . The reverse process that procedurally transforms the prior noise into data is defined as follows : pθ ( x0 : T ) = p ( xT ) T∏ t=1 pθ ( xt−1|xt ) , pθ ( xt−1|xt ) = N ( xt−1 ; µθ ( xt , t ) , Σθ ( xt , t ) ) , ( 2 ) where p ( xT ) = N ( xT ; 0 , I ) and pθ ( xt−1|xt ) corresponds to the reverse of the forward transition probability , parameterized using a deep neural network . We can define the evidence lower bound ( ELBO ) loss as the training objective of the reverse process : L ( θ ) = Eq [ KL ( q ( xT |x0 ) ||p ( xT ) ) + T∑ t=2 KL ( q ( xt−1|xt , x0 ) ||pθ ( xt−1|xt ) ) − log pθ ( x0|x1 ) ] . ( 3 ) As shown in Ho et al . ( 2020 ) , q ( xt−1|xt , x0 ) can be represented by Bayes rule as follows : q ( xt−1|xt , x0 ) = N ( xt−1 ; µ̃ ( xt , x0 ) , β̃tI ) , ( 4 ) µ̃t ( xt , x0 ) : = √ ᾱt−1βt 1− ᾱt x0 + √ αt ( 1− ᾱt−1 ) 1− ᾱt xt , β̃t : = 1− ᾱt−1 1− ᾱt βt . ( 5 ) By fixing p ( xT ) as a standard Gaussian , KL ( q ( xT |x0 ) ||p ( xT ) ) becomes constant and is not parameterized . The original framework in Ho et al . ( 2020 ) fixed Σθ ( xt , t ) as a constant β̃tI and set the standard Gaussian noise as the optimization target instead of µ̃t by reparameterizing x0 = 1√ ᾱt ( xt − √ 1− ᾱt ) from q ( xt|x0 ) to minimize the second and third terms in equation 3 . Based on this setup , in Ho et al . ( 2020 ) , the authors further demonstrated that we can drop the weighting factor of each term and use a simplified training objective that provides a higher sample quality : − ELBO = C + T∑ t=1 Ex0 , [ β2t 2σ2tαt ( 1− ᾱt ) ‖ − θ ( √ ᾱtx0 + √ 1− ᾱt , t ) ‖2 ] , ( 6 ) Lsimple ( θ ) : = Et , x0 , [ ‖ − θ ( xt , t ) ‖2 ] . ( 7 ) Related work Since the introduction of the DDPM , there have been a variety of further studies ( Nichol & Dhariwal , 2021 ; Song et al. , 2020 ) , applications ( Chen et al. , 2021 ; Jeong et al. , 2021 ; Kong et al. , 2021 ; Saharia et al. , 2021 ) , and a symbiosis of diffusion ( Ho et al. , 2020 ; Sohl-Dickstein et al. , 2015 ) and score-based models ( Song & Ermon , 2019 ; 2020 ) as a unified view with stochastic differential equations ( SDEs ) ( Song et al. , 2021 ) . From an application perspective , several conditional generative models have been proposed . Waveform synthesis models ( Chen et al. , 2021 ; Kong et al. , 2021 ) are one of the major applications in which the diffusion model is trained to generate time-domain speech audio from the prior noise , conditioned on a mel-spectrogram . A diffusionbased decoder has also been applied to text-to-spectrogram generation models ( Jeong et al. , 2021 ; Popov et al. , 2021 ) . PriorGrad focuses on improving the efficiency of training such methods from the perspective of a conditional generative model . We investigate the potential inefficiency of the current methods which require unfeasibly large computing resources to train and generate high-quality samples . Studies on formulating an informative prior distribution for deep generative model are not new , and there has been a variety of studies investigating a better prior , ranging from hand-crafted ( Nalisnick & Smyth , 2017 ; Tomczak & Welling , 2018 ) , autoregressive ( Chen et al. , 2017 ) , vector quantization ( Razavi et al. , 2019 ) , prior encoder ( Rezende & Mohamed , 2015 ) , and data-dependent approaches similar to ours ( Li et al. , 2019 ) . We tackle the problem of training inefficiency of diffusion-based models by crafting better priors in a data-dependent manner , where our method can provide a better trajectory and can reduce spurious modes , enabling more efficient training . Nachmani et al . ( 2021 ) used Gamma distribution as the diffusion prior . Note that there has also been a concurrent study conducted on leveraging the prior distribution on the acoustic model , Grad-TTS ( Popov et al. , 2021 ) , in which the effectiveness of using the mean-shifted Gaussian as a prior with the identity variance was investigated . Unlike the method in Popov et al . ( 2021 ) , which enforces the encoder output to match the target mel-spectrogram by using an additional encoder loss , our approach augments the forward diffusion prior directly through data and the encoder has no restriction on latent feature representations . In Popov et al . ( 2021 ) , the forward diffusion prior is jointly trained and may induce additional overhead on convergence as the prior changes throughout the training , whereas our method provides guaranteed convergence through the fixed informative prior .
This work builds on denoising diffusion probabilistic models (DDPM), and argues for to modify the forward and backward diffusion processes such that instead of using an uninformative prior $p(\mathbf{x}_T) = \mathcal{N}(0,\mathbf{I})$, they use a data-dependent prior $p(\mathbf{x}_T) = \mathcal{N}(\mu, \Sigma)$, where the mean and covariance are derived from training data, in a "pre-processing" step. The authors show that, under restrictive conditions, the ELBO obtained with the proposed prior is smaller than that obtained with the uninformative prior. Under similar restrictive conditions, the authors argue that convergence rate of the parameter optimization is better conditioned, and as a consequence faster. This work illustrates the benefits of the proposed method using two applications, one to a vocoder, and one to an acoustic model. Experiments rely on several very recent related work, especially concerning technical details of the architectures, and data pre-processing choices. Overall, two methods are compared, a baseline DDPM and the proposed DDPM that uses training data to build a better prior.
SP:6d8e0727b58e59cb7a9f78f00533fa7a3db77661
PriorGrad: Improving Conditional Denoising Diffusion Models with Data-Dependent Adaptive Prior
Denoising diffusion probabilistic models have been recently proposed to generate high-quality samples by estimating the gradient of the data density . The framework defines the prior noise as a standard Gaussian distribution , whereas the corresponding data distribution may be more complicated than the standard Gaussian distribution , which potentially introduces inefficiency in denoising the prior noise into the data sample because of the discrepancy between the data and the prior . In this paper , we propose PriorGrad to improve the efficiency of the conditional diffusion model for speech synthesis ( for example , a vocoder using a mel-spectrogram as the condition ) by applying an adaptive prior derived from the data statistics based on the conditional information . We formulate the training and sampling procedures of PriorGrad and demonstrate the advantages of an adaptive prior through a theoretical analysis . Focusing on the speech synthesis domain , we consider the recently proposed diffusion-based speech generative models based on both the spectral and time domains and show that PriorGrad achieves faster convergence and inference with superior performance , leading to an improved perceptual quality and robustness to a smaller network capacity , and thereby demonstrating the efficiency of a data-dependent adaptive prior . 1 INTRODUCTION . Deep generative models have been achieving rapid progress , by which deep neural networks approximate the data distribution and synthesize realistic samples from the model . There is a wide range of this type of approach , ranging from autoregressive models ( Oord et al. , 2016a ; b ) , generative adversarial networks ( Goodfellow et al. , 2014 ; Brock et al. , 2019 ) , variational autoencoders ( Kingma & Welling , 2013 ; Vahdat & Kautz , 2020 ) , and normalizing flows ( Rezende & Mohamed , 2015 ; Kingma & Dhariwal , 2018 ) . Denoising diffusion probabilistic models ( DDPMs ) ( Ho et al. , 2020 ) and score matching ( SM ) ( Song & Ermon , 2019 ) are recently proposed categories that can be used to synthesize high-fidelity samples with competitive or sometimes better quality than previous state-of-the-art approaches . Consequently , there have been a variety of applications based on DDPM or SM ( Saharia et al. , 2021 ; Kawar et al. , 2021 ) . Speech synthesis is one of the most successful applications , where the diffusion model can synthesize spectral or time-domain audio conditioned on text or spectral information , respectively , achieving a competitive quality but faster sampling ( Chen et al. , 2021 ; Kong et al. , 2021 ; Jeong et al. , 2021 ; Lee & Han , 2021 ) than autoregressive models ( Oord et al. , 2016b ; Kalchbrenner et al. , 2018 ) . ∗Work done during an internship at Microsoft Research Asia †Corresponding Authors However , although the diffusion-based speech synthesis models have achieved high-quality speech audio generation , they exhibit potential inefficiency , which may necessitate advanced strategies . For example , the model suffers from a significantly slow convergence during training , and a prohibitively large training computation time is required to learn the approximate reverse diffusion process . We investigate the diffuion-based models and observe the discrepancy between the real data distribution and the choice of the prior . Existing diffusion-based models define a standard Gaussian as the prior distribution and design a non-parametric diffusion process that procedurally destroys the signal into the prior noise . The deep neural network is trained to approximate the reverse diffusion process by estimating the gradient of the data density . Although applying the standard Gaussian as the prior is simple without any assumptions on the target data , it also introduces inefficiency . For example , in time-domain waveform data , the signal has extremely high variability between different segments such as voiced and unvoiced parts . Jointly modeling the voiced and unvoiced segments with the same standard Gaussian prior may be difficult for the model to cover all modes of the data , leading to training inefficiencies and potentially spurious diffusion trajectories . Given the previous reasoning , we assessed the following question : For a conditional diffusion-based model , can we formulate a more informative prior without incorporating additional computational or parameter complexity ? To investigate this , we propose a simple yet effective method , called PriorGrad , that uses adaptive noise by directly computing the mean and variance for the forward diffusion process prior , based on the conditional information . Specifically , using a conditional speech synthesis model , we propose structuring the prior distribution based on the conditional data , such as a mel-spectrogram for the vocoder ( Chen et al. , 2021 ; Kong et al. , 2021 ) and a phoneme for the acoustic model ( Jeong et al. , 2021 ) . By computing the statistics from the conditional data at the frame level ( vocoder ) or phoneme-level ( acoustic model ) granularity and mapping them as the mean and variance of the Gaussian prior , we can structure the noise that is similar to the target data distribution at an instance level , easing the burden of learning the reverse diffusion process . We implemented PriorGrad based on the recently proposed diffusion-based speech generative models ( Kong et al. , 2021 ; Chen et al. , 2021 ; Jeong et al. , 2021 ) , and conducted experiments on the LJSpeech ( Ito & Johnson , 2017 ) dataset . The experimental results demonstrate the benefits of PriorGrad , such as a significantly faster model convergence during training , improved perceptual quality , and an improved tolerance to a reduction in network capacity . Our contributions are as follows : • To the best of our knowledge , our study is one of the first to systematically investigate the effect of using a non-standard Gaussian distribution as the forward diffusion process prior to the conditional generative model . • Compared to previous non-parametric forward diffusion without any assumption , we show that the model performance is significantly improved with faster convergence by leveraging the conditional information as the adaptive prior . • We provide a comprehensive empirical study and analysis of the diffusion model behavior in speech generative models , in both the spectral and waveform domains , and demonstrate the effectiveness of the method , such as a significantly accelerated inference and improved quality . 2 BACKGROUND . In this section , we describe the basic formulation of the diffusion-based model and provide related studies , along with a description of our contribution with PriorGrad . Basic formulation Denoising diffusion probabilistic models ( DDPM ) ( Ho et al. , 2020 ) are recently proposed deep generative models defined by two Markov chains : forward and reverse processes . The forward process procedurally destroys the data x0 into a standard Gaussian xT , as follows : q ( x1 : T |x0 ) = T∏ t=1 q ( xt|xt−1 ) , q ( xt|xt−1 ) : = N ( xt ; √ 1− βtxt−1 , βtI ) , ( 1 ) where q ( xt|xt−1 ) represents the transition probability at the t-th step using a user-defined noise schedule βt ∈ { β1 , ... , βT } . Thus , the noisy distribution of xt is the closed form of q ( xt|x0 ) = N ( xt ; √ ᾱtx0 , ( 1− ᾱt ) I ) , where αt : = 1−βt , ᾱt : = ∏t s=1 αs . q ( xT |x0 ) converges in distribution to the standard Gaussian N ( xT ; 0 , I ) if ᾱT is small enough based on a carefully designed noise schedule . The reverse process that procedurally transforms the prior noise into data is defined as follows : pθ ( x0 : T ) = p ( xT ) T∏ t=1 pθ ( xt−1|xt ) , pθ ( xt−1|xt ) = N ( xt−1 ; µθ ( xt , t ) , Σθ ( xt , t ) ) , ( 2 ) where p ( xT ) = N ( xT ; 0 , I ) and pθ ( xt−1|xt ) corresponds to the reverse of the forward transition probability , parameterized using a deep neural network . We can define the evidence lower bound ( ELBO ) loss as the training objective of the reverse process : L ( θ ) = Eq [ KL ( q ( xT |x0 ) ||p ( xT ) ) + T∑ t=2 KL ( q ( xt−1|xt , x0 ) ||pθ ( xt−1|xt ) ) − log pθ ( x0|x1 ) ] . ( 3 ) As shown in Ho et al . ( 2020 ) , q ( xt−1|xt , x0 ) can be represented by Bayes rule as follows : q ( xt−1|xt , x0 ) = N ( xt−1 ; µ̃ ( xt , x0 ) , β̃tI ) , ( 4 ) µ̃t ( xt , x0 ) : = √ ᾱt−1βt 1− ᾱt x0 + √ αt ( 1− ᾱt−1 ) 1− ᾱt xt , β̃t : = 1− ᾱt−1 1− ᾱt βt . ( 5 ) By fixing p ( xT ) as a standard Gaussian , KL ( q ( xT |x0 ) ||p ( xT ) ) becomes constant and is not parameterized . The original framework in Ho et al . ( 2020 ) fixed Σθ ( xt , t ) as a constant β̃tI and set the standard Gaussian noise as the optimization target instead of µ̃t by reparameterizing x0 = 1√ ᾱt ( xt − √ 1− ᾱt ) from q ( xt|x0 ) to minimize the second and third terms in equation 3 . Based on this setup , in Ho et al . ( 2020 ) , the authors further demonstrated that we can drop the weighting factor of each term and use a simplified training objective that provides a higher sample quality : − ELBO = C + T∑ t=1 Ex0 , [ β2t 2σ2tαt ( 1− ᾱt ) ‖ − θ ( √ ᾱtx0 + √ 1− ᾱt , t ) ‖2 ] , ( 6 ) Lsimple ( θ ) : = Et , x0 , [ ‖ − θ ( xt , t ) ‖2 ] . ( 7 ) Related work Since the introduction of the DDPM , there have been a variety of further studies ( Nichol & Dhariwal , 2021 ; Song et al. , 2020 ) , applications ( Chen et al. , 2021 ; Jeong et al. , 2021 ; Kong et al. , 2021 ; Saharia et al. , 2021 ) , and a symbiosis of diffusion ( Ho et al. , 2020 ; Sohl-Dickstein et al. , 2015 ) and score-based models ( Song & Ermon , 2019 ; 2020 ) as a unified view with stochastic differential equations ( SDEs ) ( Song et al. , 2021 ) . From an application perspective , several conditional generative models have been proposed . Waveform synthesis models ( Chen et al. , 2021 ; Kong et al. , 2021 ) are one of the major applications in which the diffusion model is trained to generate time-domain speech audio from the prior noise , conditioned on a mel-spectrogram . A diffusionbased decoder has also been applied to text-to-spectrogram generation models ( Jeong et al. , 2021 ; Popov et al. , 2021 ) . PriorGrad focuses on improving the efficiency of training such methods from the perspective of a conditional generative model . We investigate the potential inefficiency of the current methods which require unfeasibly large computing resources to train and generate high-quality samples . Studies on formulating an informative prior distribution for deep generative model are not new , and there has been a variety of studies investigating a better prior , ranging from hand-crafted ( Nalisnick & Smyth , 2017 ; Tomczak & Welling , 2018 ) , autoregressive ( Chen et al. , 2017 ) , vector quantization ( Razavi et al. , 2019 ) , prior encoder ( Rezende & Mohamed , 2015 ) , and data-dependent approaches similar to ours ( Li et al. , 2019 ) . We tackle the problem of training inefficiency of diffusion-based models by crafting better priors in a data-dependent manner , where our method can provide a better trajectory and can reduce spurious modes , enabling more efficient training . Nachmani et al . ( 2021 ) used Gamma distribution as the diffusion prior . Note that there has also been a concurrent study conducted on leveraging the prior distribution on the acoustic model , Grad-TTS ( Popov et al. , 2021 ) , in which the effectiveness of using the mean-shifted Gaussian as a prior with the identity variance was investigated . Unlike the method in Popov et al . ( 2021 ) , which enforces the encoder output to match the target mel-spectrogram by using an additional encoder loss , our approach augments the forward diffusion prior directly through data and the encoder has no restriction on latent feature representations . In Popov et al . ( 2021 ) , the forward diffusion prior is jointly trained and may induce additional overhead on convergence as the prior changes throughout the training , whereas our method provides guaranteed convergence through the fixed informative prior .
This paper presents an extension to conditional denoising diffusion models for text-to-speech (TTS). The initial noise in the inference procedure is not sampled from a standard Gaussian but from a data-dependent conditional non-standard Gaussian, which is called PriorGrad. The motivation is to increase inference speed and training convergence. This method is applied to DiffWave used as a vocoder, and also applied to DiffWave used as an acoustic model (phonemes to mel spect).
SP:6d8e0727b58e59cb7a9f78f00533fa7a3db77661
PriorGrad: Improving Conditional Denoising Diffusion Models with Data-Dependent Adaptive Prior
Denoising diffusion probabilistic models have been recently proposed to generate high-quality samples by estimating the gradient of the data density . The framework defines the prior noise as a standard Gaussian distribution , whereas the corresponding data distribution may be more complicated than the standard Gaussian distribution , which potentially introduces inefficiency in denoising the prior noise into the data sample because of the discrepancy between the data and the prior . In this paper , we propose PriorGrad to improve the efficiency of the conditional diffusion model for speech synthesis ( for example , a vocoder using a mel-spectrogram as the condition ) by applying an adaptive prior derived from the data statistics based on the conditional information . We formulate the training and sampling procedures of PriorGrad and demonstrate the advantages of an adaptive prior through a theoretical analysis . Focusing on the speech synthesis domain , we consider the recently proposed diffusion-based speech generative models based on both the spectral and time domains and show that PriorGrad achieves faster convergence and inference with superior performance , leading to an improved perceptual quality and robustness to a smaller network capacity , and thereby demonstrating the efficiency of a data-dependent adaptive prior . 1 INTRODUCTION . Deep generative models have been achieving rapid progress , by which deep neural networks approximate the data distribution and synthesize realistic samples from the model . There is a wide range of this type of approach , ranging from autoregressive models ( Oord et al. , 2016a ; b ) , generative adversarial networks ( Goodfellow et al. , 2014 ; Brock et al. , 2019 ) , variational autoencoders ( Kingma & Welling , 2013 ; Vahdat & Kautz , 2020 ) , and normalizing flows ( Rezende & Mohamed , 2015 ; Kingma & Dhariwal , 2018 ) . Denoising diffusion probabilistic models ( DDPMs ) ( Ho et al. , 2020 ) and score matching ( SM ) ( Song & Ermon , 2019 ) are recently proposed categories that can be used to synthesize high-fidelity samples with competitive or sometimes better quality than previous state-of-the-art approaches . Consequently , there have been a variety of applications based on DDPM or SM ( Saharia et al. , 2021 ; Kawar et al. , 2021 ) . Speech synthesis is one of the most successful applications , where the diffusion model can synthesize spectral or time-domain audio conditioned on text or spectral information , respectively , achieving a competitive quality but faster sampling ( Chen et al. , 2021 ; Kong et al. , 2021 ; Jeong et al. , 2021 ; Lee & Han , 2021 ) than autoregressive models ( Oord et al. , 2016b ; Kalchbrenner et al. , 2018 ) . ∗Work done during an internship at Microsoft Research Asia †Corresponding Authors However , although the diffusion-based speech synthesis models have achieved high-quality speech audio generation , they exhibit potential inefficiency , which may necessitate advanced strategies . For example , the model suffers from a significantly slow convergence during training , and a prohibitively large training computation time is required to learn the approximate reverse diffusion process . We investigate the diffuion-based models and observe the discrepancy between the real data distribution and the choice of the prior . Existing diffusion-based models define a standard Gaussian as the prior distribution and design a non-parametric diffusion process that procedurally destroys the signal into the prior noise . The deep neural network is trained to approximate the reverse diffusion process by estimating the gradient of the data density . Although applying the standard Gaussian as the prior is simple without any assumptions on the target data , it also introduces inefficiency . For example , in time-domain waveform data , the signal has extremely high variability between different segments such as voiced and unvoiced parts . Jointly modeling the voiced and unvoiced segments with the same standard Gaussian prior may be difficult for the model to cover all modes of the data , leading to training inefficiencies and potentially spurious diffusion trajectories . Given the previous reasoning , we assessed the following question : For a conditional diffusion-based model , can we formulate a more informative prior without incorporating additional computational or parameter complexity ? To investigate this , we propose a simple yet effective method , called PriorGrad , that uses adaptive noise by directly computing the mean and variance for the forward diffusion process prior , based on the conditional information . Specifically , using a conditional speech synthesis model , we propose structuring the prior distribution based on the conditional data , such as a mel-spectrogram for the vocoder ( Chen et al. , 2021 ; Kong et al. , 2021 ) and a phoneme for the acoustic model ( Jeong et al. , 2021 ) . By computing the statistics from the conditional data at the frame level ( vocoder ) or phoneme-level ( acoustic model ) granularity and mapping them as the mean and variance of the Gaussian prior , we can structure the noise that is similar to the target data distribution at an instance level , easing the burden of learning the reverse diffusion process . We implemented PriorGrad based on the recently proposed diffusion-based speech generative models ( Kong et al. , 2021 ; Chen et al. , 2021 ; Jeong et al. , 2021 ) , and conducted experiments on the LJSpeech ( Ito & Johnson , 2017 ) dataset . The experimental results demonstrate the benefits of PriorGrad , such as a significantly faster model convergence during training , improved perceptual quality , and an improved tolerance to a reduction in network capacity . Our contributions are as follows : • To the best of our knowledge , our study is one of the first to systematically investigate the effect of using a non-standard Gaussian distribution as the forward diffusion process prior to the conditional generative model . • Compared to previous non-parametric forward diffusion without any assumption , we show that the model performance is significantly improved with faster convergence by leveraging the conditional information as the adaptive prior . • We provide a comprehensive empirical study and analysis of the diffusion model behavior in speech generative models , in both the spectral and waveform domains , and demonstrate the effectiveness of the method , such as a significantly accelerated inference and improved quality . 2 BACKGROUND . In this section , we describe the basic formulation of the diffusion-based model and provide related studies , along with a description of our contribution with PriorGrad . Basic formulation Denoising diffusion probabilistic models ( DDPM ) ( Ho et al. , 2020 ) are recently proposed deep generative models defined by two Markov chains : forward and reverse processes . The forward process procedurally destroys the data x0 into a standard Gaussian xT , as follows : q ( x1 : T |x0 ) = T∏ t=1 q ( xt|xt−1 ) , q ( xt|xt−1 ) : = N ( xt ; √ 1− βtxt−1 , βtI ) , ( 1 ) where q ( xt|xt−1 ) represents the transition probability at the t-th step using a user-defined noise schedule βt ∈ { β1 , ... , βT } . Thus , the noisy distribution of xt is the closed form of q ( xt|x0 ) = N ( xt ; √ ᾱtx0 , ( 1− ᾱt ) I ) , where αt : = 1−βt , ᾱt : = ∏t s=1 αs . q ( xT |x0 ) converges in distribution to the standard Gaussian N ( xT ; 0 , I ) if ᾱT is small enough based on a carefully designed noise schedule . The reverse process that procedurally transforms the prior noise into data is defined as follows : pθ ( x0 : T ) = p ( xT ) T∏ t=1 pθ ( xt−1|xt ) , pθ ( xt−1|xt ) = N ( xt−1 ; µθ ( xt , t ) , Σθ ( xt , t ) ) , ( 2 ) where p ( xT ) = N ( xT ; 0 , I ) and pθ ( xt−1|xt ) corresponds to the reverse of the forward transition probability , parameterized using a deep neural network . We can define the evidence lower bound ( ELBO ) loss as the training objective of the reverse process : L ( θ ) = Eq [ KL ( q ( xT |x0 ) ||p ( xT ) ) + T∑ t=2 KL ( q ( xt−1|xt , x0 ) ||pθ ( xt−1|xt ) ) − log pθ ( x0|x1 ) ] . ( 3 ) As shown in Ho et al . ( 2020 ) , q ( xt−1|xt , x0 ) can be represented by Bayes rule as follows : q ( xt−1|xt , x0 ) = N ( xt−1 ; µ̃ ( xt , x0 ) , β̃tI ) , ( 4 ) µ̃t ( xt , x0 ) : = √ ᾱt−1βt 1− ᾱt x0 + √ αt ( 1− ᾱt−1 ) 1− ᾱt xt , β̃t : = 1− ᾱt−1 1− ᾱt βt . ( 5 ) By fixing p ( xT ) as a standard Gaussian , KL ( q ( xT |x0 ) ||p ( xT ) ) becomes constant and is not parameterized . The original framework in Ho et al . ( 2020 ) fixed Σθ ( xt , t ) as a constant β̃tI and set the standard Gaussian noise as the optimization target instead of µ̃t by reparameterizing x0 = 1√ ᾱt ( xt − √ 1− ᾱt ) from q ( xt|x0 ) to minimize the second and third terms in equation 3 . Based on this setup , in Ho et al . ( 2020 ) , the authors further demonstrated that we can drop the weighting factor of each term and use a simplified training objective that provides a higher sample quality : − ELBO = C + T∑ t=1 Ex0 , [ β2t 2σ2tαt ( 1− ᾱt ) ‖ − θ ( √ ᾱtx0 + √ 1− ᾱt , t ) ‖2 ] , ( 6 ) Lsimple ( θ ) : = Et , x0 , [ ‖ − θ ( xt , t ) ‖2 ] . ( 7 ) Related work Since the introduction of the DDPM , there have been a variety of further studies ( Nichol & Dhariwal , 2021 ; Song et al. , 2020 ) , applications ( Chen et al. , 2021 ; Jeong et al. , 2021 ; Kong et al. , 2021 ; Saharia et al. , 2021 ) , and a symbiosis of diffusion ( Ho et al. , 2020 ; Sohl-Dickstein et al. , 2015 ) and score-based models ( Song & Ermon , 2019 ; 2020 ) as a unified view with stochastic differential equations ( SDEs ) ( Song et al. , 2021 ) . From an application perspective , several conditional generative models have been proposed . Waveform synthesis models ( Chen et al. , 2021 ; Kong et al. , 2021 ) are one of the major applications in which the diffusion model is trained to generate time-domain speech audio from the prior noise , conditioned on a mel-spectrogram . A diffusionbased decoder has also been applied to text-to-spectrogram generation models ( Jeong et al. , 2021 ; Popov et al. , 2021 ) . PriorGrad focuses on improving the efficiency of training such methods from the perspective of a conditional generative model . We investigate the potential inefficiency of the current methods which require unfeasibly large computing resources to train and generate high-quality samples . Studies on formulating an informative prior distribution for deep generative model are not new , and there has been a variety of studies investigating a better prior , ranging from hand-crafted ( Nalisnick & Smyth , 2017 ; Tomczak & Welling , 2018 ) , autoregressive ( Chen et al. , 2017 ) , vector quantization ( Razavi et al. , 2019 ) , prior encoder ( Rezende & Mohamed , 2015 ) , and data-dependent approaches similar to ours ( Li et al. , 2019 ) . We tackle the problem of training inefficiency of diffusion-based models by crafting better priors in a data-dependent manner , where our method can provide a better trajectory and can reduce spurious modes , enabling more efficient training . Nachmani et al . ( 2021 ) used Gamma distribution as the diffusion prior . Note that there has also been a concurrent study conducted on leveraging the prior distribution on the acoustic model , Grad-TTS ( Popov et al. , 2021 ) , in which the effectiveness of using the mean-shifted Gaussian as a prior with the identity variance was investigated . Unlike the method in Popov et al . ( 2021 ) , which enforces the encoder output to match the target mel-spectrogram by using an additional encoder loss , our approach augments the forward diffusion prior directly through data and the encoder has no restriction on latent feature representations . In Popov et al . ( 2021 ) , the forward diffusion prior is jointly trained and may induce additional overhead on convergence as the prior changes throughout the training , whereas our method provides guaranteed convergence through the fixed informative prior .
The paper proposes to use a data-dependent, adaptive prior for the noise used in conditional DDPMs. In particular, it proposes to move from the standard to the non-standard Gaussian prior. For that, the ELBO loss is reformulated by taking into account adaptive means and variances and the sampling procedure is also adapted. Statistics (directly or indirectly derived) from conditioning signals are used to compute time-wise and instance-based means/standard deviations. An empirical evaluation is conducted on two conditional audio generation tasks: vocoding and acoustic modeling, showing some favorable results.
SP:6d8e0727b58e59cb7a9f78f00533fa7a3db77661
Towards Scheduling Federated Deep Learning using Meta-Gradients for Inter-Hospital Learning
1 INTRODUCTION . Federated learning is a field that has emerged recently due to the abundance of data available today and the risks that this poses to individuals . Privacy ( particularly of personal information ) is of great importance and should be protected by researchers working in machine learning . In parallel , the emergence of electronic health records ( EHRs ) has allowed the digitisation of much personal information pertaining to the health conditions of individuals . EHRs are often used in many machine learning research projects Shailaja et al . ( 2018 ) . This often involves the transfer and storage of very sensitive information which increases the risk of data leakage . As a result , federated learning can minimise this risk by utilising the data at it ’ s source rather than transferring it to the researchers servers to be processed . Machine learning researchers working with EHR data will be all too familiar with the difficulty of gaining access to this information in the first place . It can be a very lengthy and exhausting process ( for good reason ) to gain access and utilise the EHRs of one healthcare institution let alone accessing the datasets of many . Federated learning offers an alternative in that it allows the data of the patients to be utilised while reducing the risk of their privacy being compromised . Federated learning is not without its own limitations however . The different datasets that are stored in the different nodes may have different underlying distributions due to their data collection processes which can make machine learning across multiple domains difficult . There is also the possibility of data at each node being corrupted either maliciously or accidentally , leading to data that is undesirable to use for training . These issues can all lead to difficulties in training and convergence of the overall model being trained . To overcome these limitations , in this work we propose the following setup . Firstly , We use federated learning to i ) protect the privacy of patients by minimising the movement of their data and ii ) improve the quality of our machine learning model by utilising a diverse dataset sourced from different hospitals . As we are ‘ blind ’ to the data at the nodes , we propose the use of a student-teacher network setup . The teacher ( a reinforcement learning agent ) will have access to the local servers and be able to select the appropriate data for the ‘ student ’ ( our model ) to be trained on at that time . The ‘ scheduler ’ will be responsible for directing the teacher to a given data centre to select data for training on . To summarise : ( The Student : ) - the machine learning model we are training . ( The Teacher : ) - a reinforcement learning agent that selects data from a data centre based on the state of the student . This essentially defines a curriculum at each training step for the student . ( The Scheduler : ) - directs the teacher to the appropriate data centre for training . This is also based on the state of the student at each training iteration . Section 2 discusses the related work that has been carried out and Section 3 provides a detailed description of how our algorithm works . Section 4 details the datasets we benchmark our method against . We then present the results in Section 5 and discuss their significance and interesting behaviours of our model in Section 6 . 2 RELATED WORK . Federated learning has been used by researchers to exploit larger pools of data for training Bonawitz et al . ( 2019 ) , preserve data privacy Xu et al . ( 2019 ) and distributing computational resource requirements Yuan & Ma ( 2020 ) . Federated learning has also been used for healthcare applications to simultaneously utilise multiple datasets to train a model on patient data . In this work we create a model that learns in a federal fashion through the interaction of a scheduler that is trained using meta-gradients and a student-teacher algorithm that is trained using reinforcement learning . Meta-learning has been used effectively in Such et al . ( 2019 ) where the loss of a student model on a validation set was used as a signal to update the weights of a generative model . This work demonstrated the rapid and effective training of methods that exploit meta-gradients . Meta-learning was also used in Zahavy et al . ( 2020 ) , where the meta-gradients are used to tune the parameters of an actor-critic algorithm . As a result of the efficacy of this method in these domains we choose to use meta-gradients in order to schedule which data centre the gradients to update are student model will come from . The meta-learned scheduler chooses a node representing a data centre where a student-teacher algorithm is used to sample data . Student-teacher algorithms have been used in multiple works , with the general premise that one algorithm ( teacher ) is trained to train another ( student ) Fan et al . ( 2018 ) ; Liu et al . ( 2017a ) . These methods have also been used with a curriculum Bengio et al . ( 2009 ) , where the curriculum is either pre-defined and exploited by the teacher El-Bouri et al . ( 2020 ) or implicitly learned by the teacher during training Graves et al . ( 2017 ) . Federated learning is a method of training a model ( in our case a deep neural network ) by using data from multiple centres , without having central access to each of them McMahan et al . ( 2017 ) . Local models at each of the data centres are iteratively updated and aggregated to form a global model . At each round of iteration , a central coordinator samples a subset , m , of local models , Sm , and sends them the current global model Gt . Each member of Sm then updates this global model using their local data to create an updated model Lt+1 . These models are then aggregated and are sent back to update the global model as : Gt+1 = Gt + η n m∑ i=1 ( Lt+1i −G t ) ( 1 ) where n is the number of nodes ( i.e. , data centres ) and η acts as a learning rate for replacing the global model with the aggregate of the local models . While this has been shown to work in many cases , Wang et al . ( 2020a ) make the argument that there is inherent difficulty in updating neural networks in this manner . They argue that the permutation invariance of the summation operand renders averaging in the parameter space a naive approach . For meaningful averaging to be done , the permutation must first be undone . 2.1 COMPROMISING FEDERATED LEARNING . One of the vulnerabilities of federated learning is that nodes being compromised can significantly affect the training of the global model Bhagoji et al . ( 2018 ) . Attacks of these sort can either ‘ poison ’ the data found at one of the nodes ( known as an adversarial attack ) or bias the model that is trained at one of the nodes significantly , leading it to highly skew the aggregation step Tolpegin et al . ( 2020 ) . There is also the possibility of the attack being a single-shot attack or a repeated attack Fang et al . ( 2020 ) . In the single shot case , only one of the nodes is compromised whereas in the repeated case , multiple nodes can be compromised at any given time . Many works have been produced in discussing how federated learning can be compromised by introducing a backdoor into the training process Gu et al . ( 2017 ) ; Bagdasaryan et al . ( 2020 ) . A backdoor is an attack that causes a classifier to produce unexpected behaviour if a specific trigger is added to the input space . An example is a sticker being added to an image and associating this with the incorrect label Gu et al . ( 2017 ) . Defences against these attacks have been developed with some authors using pruning of redundant neurons for the core classification task Liu et al . ( 2018 ) , using outlier detection to detect potential triggers Wang et al . ( 2019 ) , and re-training and preprocessing inputs Liu et al . ( 2017b ) . In this work we aim to overcome these limitations and build defence into the training procedure through the use of a student-teacher network that actively selects which data to train on . 3 METHODOLOGY . Our method is comprised of three agents in the training setup , the student , the teacher and the scheduler . 3.1 THE OVERALL SETUP . The overall setup of our federated learning training routine is as follows . We have a scheduler that controls which node we will be learning from ( this can be one-hot or we can select multiple nodes ) . The teacher at the node can then select a batch of data according to the state of the student . The student at the node is a copy of the global student . We use the student to forward pass the batch of data selected by the teacher and return the loss . In the one-hot scheduler scenario , we send back the loss to the global student model to update the weights via backpropagation . In the multi-node learning scenario , we aggregate the losses from all nodes selected and feed these back to the global model for updating . 3.2 DATA PREPROCESSING . The first step we must take in order to exploit our teacher setup is to rank our data according to some metric . Using Wang et al . ( 2020b ) as a guide , we choose to use the Mahalanobis distance expressed as : d ( xn ) = ( ( xn − µ ) T S−1 ( xn − µ ) ) 1 2 ( 2 ) for medical datasets , and the cosine similarity as our similarity metric for image datasets . As the tabular data found in electronic health record systems consist of multiple data types , we encode these using a denoising autoencoder . This trained encoder is distributed to all the nodes so that the data in each node is processed in the same way for consistency . 3.3 THE TEACHER . For the student-teacher interaction we follow the setup in El-Bouri et al . ( 2020 ) . The task of the teacher is to select a batch of data from the curriculum by selecting the index along the curriculum and the ‘ width ’ around that index to include in the selection . The following sequential steps are implemented : • The data at each node is organised into N curriculum batches according to some metric H . • The teacher selects one or more batches for feeding into the student . • A pre-trained autoencoder is used to create a latent representation of the batch . • The student is trained on this batch and it ’ s performance on a separate validation set is recorded . In this work we use the Mahalanobis distance for H for medical data , and cosine similarity for image data as summarised in Wang et al . ( 2020b ) . The teacher is a reinforcement learning agent and therefore is tasked with minimising the Bellman loss function given by : L ( θi ) = ( r + γmax a′ Q ( s′ , a′ ; θ−i ) −Q ( s , a ; θi ) ) 2 ( 3 ) where r is the reward of a state-action ( s , a ) tuple , γ the discount factor , Q is the q-value defining the value of taking an action given a state and θ and θ− are the parameters of the prediction and target ( the version of the teacher that is held constant for K steps to stabilise training as described in Mnih et al . ( 2015 ) ) networks respectively . As we also choose to use an actor-critic setup for the teacher , the action space and Q-function are separately parameterised . This allows a continuous action space and the actor that selects actions is updated using the following loss : ∇θµJ ≈ 1 N ∑ i ∇aQ ( s , a | θQ ) | s=si , a=µ ( si ) ∇θµµ ( s | θ µ ) ( 4 ) where Q is the Q-function and µ is the policy . The teacher can either be pre-trained , or jointly trained with the scheduler . The teacher can also either be trained on the dataset of one node and distributed to the rest or independently trained at each node . The latter is preferable due to the ability of the teacher to adapt to the dataset at hand . However , the former is useful when not all nodes in the federated system have access to computational power . The intuition is that the curriculum strategy learned by the teacher should be general for the task at hand and thereby provide strong performance .
This paper proposes a novel federated learning framework for model training across multiple hospital data centers. There are mainly three components in the framework including a student machine learning model, a teacher reinforcement learning agent, and a scheduler algorithm that directs the teacher to specific data centers. The setup and the details of the whole framework are well presented in the paper. Corresponding experiments are carried out to show the performance of the proposed method.
SP:4357084bf9c1370d8b6a0bb5b244dc8206d42d56
Towards Scheduling Federated Deep Learning using Meta-Gradients for Inter-Hospital Learning
1 INTRODUCTION . Federated learning is a field that has emerged recently due to the abundance of data available today and the risks that this poses to individuals . Privacy ( particularly of personal information ) is of great importance and should be protected by researchers working in machine learning . In parallel , the emergence of electronic health records ( EHRs ) has allowed the digitisation of much personal information pertaining to the health conditions of individuals . EHRs are often used in many machine learning research projects Shailaja et al . ( 2018 ) . This often involves the transfer and storage of very sensitive information which increases the risk of data leakage . As a result , federated learning can minimise this risk by utilising the data at it ’ s source rather than transferring it to the researchers servers to be processed . Machine learning researchers working with EHR data will be all too familiar with the difficulty of gaining access to this information in the first place . It can be a very lengthy and exhausting process ( for good reason ) to gain access and utilise the EHRs of one healthcare institution let alone accessing the datasets of many . Federated learning offers an alternative in that it allows the data of the patients to be utilised while reducing the risk of their privacy being compromised . Federated learning is not without its own limitations however . The different datasets that are stored in the different nodes may have different underlying distributions due to their data collection processes which can make machine learning across multiple domains difficult . There is also the possibility of data at each node being corrupted either maliciously or accidentally , leading to data that is undesirable to use for training . These issues can all lead to difficulties in training and convergence of the overall model being trained . To overcome these limitations , in this work we propose the following setup . Firstly , We use federated learning to i ) protect the privacy of patients by minimising the movement of their data and ii ) improve the quality of our machine learning model by utilising a diverse dataset sourced from different hospitals . As we are ‘ blind ’ to the data at the nodes , we propose the use of a student-teacher network setup . The teacher ( a reinforcement learning agent ) will have access to the local servers and be able to select the appropriate data for the ‘ student ’ ( our model ) to be trained on at that time . The ‘ scheduler ’ will be responsible for directing the teacher to a given data centre to select data for training on . To summarise : ( The Student : ) - the machine learning model we are training . ( The Teacher : ) - a reinforcement learning agent that selects data from a data centre based on the state of the student . This essentially defines a curriculum at each training step for the student . ( The Scheduler : ) - directs the teacher to the appropriate data centre for training . This is also based on the state of the student at each training iteration . Section 2 discusses the related work that has been carried out and Section 3 provides a detailed description of how our algorithm works . Section 4 details the datasets we benchmark our method against . We then present the results in Section 5 and discuss their significance and interesting behaviours of our model in Section 6 . 2 RELATED WORK . Federated learning has been used by researchers to exploit larger pools of data for training Bonawitz et al . ( 2019 ) , preserve data privacy Xu et al . ( 2019 ) and distributing computational resource requirements Yuan & Ma ( 2020 ) . Federated learning has also been used for healthcare applications to simultaneously utilise multiple datasets to train a model on patient data . In this work we create a model that learns in a federal fashion through the interaction of a scheduler that is trained using meta-gradients and a student-teacher algorithm that is trained using reinforcement learning . Meta-learning has been used effectively in Such et al . ( 2019 ) where the loss of a student model on a validation set was used as a signal to update the weights of a generative model . This work demonstrated the rapid and effective training of methods that exploit meta-gradients . Meta-learning was also used in Zahavy et al . ( 2020 ) , where the meta-gradients are used to tune the parameters of an actor-critic algorithm . As a result of the efficacy of this method in these domains we choose to use meta-gradients in order to schedule which data centre the gradients to update are student model will come from . The meta-learned scheduler chooses a node representing a data centre where a student-teacher algorithm is used to sample data . Student-teacher algorithms have been used in multiple works , with the general premise that one algorithm ( teacher ) is trained to train another ( student ) Fan et al . ( 2018 ) ; Liu et al . ( 2017a ) . These methods have also been used with a curriculum Bengio et al . ( 2009 ) , where the curriculum is either pre-defined and exploited by the teacher El-Bouri et al . ( 2020 ) or implicitly learned by the teacher during training Graves et al . ( 2017 ) . Federated learning is a method of training a model ( in our case a deep neural network ) by using data from multiple centres , without having central access to each of them McMahan et al . ( 2017 ) . Local models at each of the data centres are iteratively updated and aggregated to form a global model . At each round of iteration , a central coordinator samples a subset , m , of local models , Sm , and sends them the current global model Gt . Each member of Sm then updates this global model using their local data to create an updated model Lt+1 . These models are then aggregated and are sent back to update the global model as : Gt+1 = Gt + η n m∑ i=1 ( Lt+1i −G t ) ( 1 ) where n is the number of nodes ( i.e. , data centres ) and η acts as a learning rate for replacing the global model with the aggregate of the local models . While this has been shown to work in many cases , Wang et al . ( 2020a ) make the argument that there is inherent difficulty in updating neural networks in this manner . They argue that the permutation invariance of the summation operand renders averaging in the parameter space a naive approach . For meaningful averaging to be done , the permutation must first be undone . 2.1 COMPROMISING FEDERATED LEARNING . One of the vulnerabilities of federated learning is that nodes being compromised can significantly affect the training of the global model Bhagoji et al . ( 2018 ) . Attacks of these sort can either ‘ poison ’ the data found at one of the nodes ( known as an adversarial attack ) or bias the model that is trained at one of the nodes significantly , leading it to highly skew the aggregation step Tolpegin et al . ( 2020 ) . There is also the possibility of the attack being a single-shot attack or a repeated attack Fang et al . ( 2020 ) . In the single shot case , only one of the nodes is compromised whereas in the repeated case , multiple nodes can be compromised at any given time . Many works have been produced in discussing how federated learning can be compromised by introducing a backdoor into the training process Gu et al . ( 2017 ) ; Bagdasaryan et al . ( 2020 ) . A backdoor is an attack that causes a classifier to produce unexpected behaviour if a specific trigger is added to the input space . An example is a sticker being added to an image and associating this with the incorrect label Gu et al . ( 2017 ) . Defences against these attacks have been developed with some authors using pruning of redundant neurons for the core classification task Liu et al . ( 2018 ) , using outlier detection to detect potential triggers Wang et al . ( 2019 ) , and re-training and preprocessing inputs Liu et al . ( 2017b ) . In this work we aim to overcome these limitations and build defence into the training procedure through the use of a student-teacher network that actively selects which data to train on . 3 METHODOLOGY . Our method is comprised of three agents in the training setup , the student , the teacher and the scheduler . 3.1 THE OVERALL SETUP . The overall setup of our federated learning training routine is as follows . We have a scheduler that controls which node we will be learning from ( this can be one-hot or we can select multiple nodes ) . The teacher at the node can then select a batch of data according to the state of the student . The student at the node is a copy of the global student . We use the student to forward pass the batch of data selected by the teacher and return the loss . In the one-hot scheduler scenario , we send back the loss to the global student model to update the weights via backpropagation . In the multi-node learning scenario , we aggregate the losses from all nodes selected and feed these back to the global model for updating . 3.2 DATA PREPROCESSING . The first step we must take in order to exploit our teacher setup is to rank our data according to some metric . Using Wang et al . ( 2020b ) as a guide , we choose to use the Mahalanobis distance expressed as : d ( xn ) = ( ( xn − µ ) T S−1 ( xn − µ ) ) 1 2 ( 2 ) for medical datasets , and the cosine similarity as our similarity metric for image datasets . As the tabular data found in electronic health record systems consist of multiple data types , we encode these using a denoising autoencoder . This trained encoder is distributed to all the nodes so that the data in each node is processed in the same way for consistency . 3.3 THE TEACHER . For the student-teacher interaction we follow the setup in El-Bouri et al . ( 2020 ) . The task of the teacher is to select a batch of data from the curriculum by selecting the index along the curriculum and the ‘ width ’ around that index to include in the selection . The following sequential steps are implemented : • The data at each node is organised into N curriculum batches according to some metric H . • The teacher selects one or more batches for feeding into the student . • A pre-trained autoencoder is used to create a latent representation of the batch . • The student is trained on this batch and it ’ s performance on a separate validation set is recorded . In this work we use the Mahalanobis distance for H for medical data , and cosine similarity for image data as summarised in Wang et al . ( 2020b ) . The teacher is a reinforcement learning agent and therefore is tasked with minimising the Bellman loss function given by : L ( θi ) = ( r + γmax a′ Q ( s′ , a′ ; θ−i ) −Q ( s , a ; θi ) ) 2 ( 3 ) where r is the reward of a state-action ( s , a ) tuple , γ the discount factor , Q is the q-value defining the value of taking an action given a state and θ and θ− are the parameters of the prediction and target ( the version of the teacher that is held constant for K steps to stabilise training as described in Mnih et al . ( 2015 ) ) networks respectively . As we also choose to use an actor-critic setup for the teacher , the action space and Q-function are separately parameterised . This allows a continuous action space and the actor that selects actions is updated using the following loss : ∇θµJ ≈ 1 N ∑ i ∇aQ ( s , a | θQ ) | s=si , a=µ ( si ) ∇θµµ ( s | θ µ ) ( 4 ) where Q is the Q-function and µ is the policy . The teacher can either be pre-trained , or jointly trained with the scheduler . The teacher can also either be trained on the dataset of one node and distributed to the rest or independently trained at each node . The latter is preferable due to the ability of the teacher to adapt to the dataset at hand . However , the former is useful when not all nodes in the federated system have access to computational power . The intuition is that the curriculum strategy learned by the teacher should be general for the task at hand and thereby provide strong performance .
In this work, the authors propose a new federated learning algorithm by adopting a neural scheduling technique. In particular, the neural scheduler is trained without needing to access the local data. Preliminary experiments demonstrate the effectiveness of the proposed algorithm.
SP:4357084bf9c1370d8b6a0bb5b244dc8206d42d56
Towards Scheduling Federated Deep Learning using Meta-Gradients for Inter-Hospital Learning
1 INTRODUCTION . Federated learning is a field that has emerged recently due to the abundance of data available today and the risks that this poses to individuals . Privacy ( particularly of personal information ) is of great importance and should be protected by researchers working in machine learning . In parallel , the emergence of electronic health records ( EHRs ) has allowed the digitisation of much personal information pertaining to the health conditions of individuals . EHRs are often used in many machine learning research projects Shailaja et al . ( 2018 ) . This often involves the transfer and storage of very sensitive information which increases the risk of data leakage . As a result , federated learning can minimise this risk by utilising the data at it ’ s source rather than transferring it to the researchers servers to be processed . Machine learning researchers working with EHR data will be all too familiar with the difficulty of gaining access to this information in the first place . It can be a very lengthy and exhausting process ( for good reason ) to gain access and utilise the EHRs of one healthcare institution let alone accessing the datasets of many . Federated learning offers an alternative in that it allows the data of the patients to be utilised while reducing the risk of their privacy being compromised . Federated learning is not without its own limitations however . The different datasets that are stored in the different nodes may have different underlying distributions due to their data collection processes which can make machine learning across multiple domains difficult . There is also the possibility of data at each node being corrupted either maliciously or accidentally , leading to data that is undesirable to use for training . These issues can all lead to difficulties in training and convergence of the overall model being trained . To overcome these limitations , in this work we propose the following setup . Firstly , We use federated learning to i ) protect the privacy of patients by minimising the movement of their data and ii ) improve the quality of our machine learning model by utilising a diverse dataset sourced from different hospitals . As we are ‘ blind ’ to the data at the nodes , we propose the use of a student-teacher network setup . The teacher ( a reinforcement learning agent ) will have access to the local servers and be able to select the appropriate data for the ‘ student ’ ( our model ) to be trained on at that time . The ‘ scheduler ’ will be responsible for directing the teacher to a given data centre to select data for training on . To summarise : ( The Student : ) - the machine learning model we are training . ( The Teacher : ) - a reinforcement learning agent that selects data from a data centre based on the state of the student . This essentially defines a curriculum at each training step for the student . ( The Scheduler : ) - directs the teacher to the appropriate data centre for training . This is also based on the state of the student at each training iteration . Section 2 discusses the related work that has been carried out and Section 3 provides a detailed description of how our algorithm works . Section 4 details the datasets we benchmark our method against . We then present the results in Section 5 and discuss their significance and interesting behaviours of our model in Section 6 . 2 RELATED WORK . Federated learning has been used by researchers to exploit larger pools of data for training Bonawitz et al . ( 2019 ) , preserve data privacy Xu et al . ( 2019 ) and distributing computational resource requirements Yuan & Ma ( 2020 ) . Federated learning has also been used for healthcare applications to simultaneously utilise multiple datasets to train a model on patient data . In this work we create a model that learns in a federal fashion through the interaction of a scheduler that is trained using meta-gradients and a student-teacher algorithm that is trained using reinforcement learning . Meta-learning has been used effectively in Such et al . ( 2019 ) where the loss of a student model on a validation set was used as a signal to update the weights of a generative model . This work demonstrated the rapid and effective training of methods that exploit meta-gradients . Meta-learning was also used in Zahavy et al . ( 2020 ) , where the meta-gradients are used to tune the parameters of an actor-critic algorithm . As a result of the efficacy of this method in these domains we choose to use meta-gradients in order to schedule which data centre the gradients to update are student model will come from . The meta-learned scheduler chooses a node representing a data centre where a student-teacher algorithm is used to sample data . Student-teacher algorithms have been used in multiple works , with the general premise that one algorithm ( teacher ) is trained to train another ( student ) Fan et al . ( 2018 ) ; Liu et al . ( 2017a ) . These methods have also been used with a curriculum Bengio et al . ( 2009 ) , where the curriculum is either pre-defined and exploited by the teacher El-Bouri et al . ( 2020 ) or implicitly learned by the teacher during training Graves et al . ( 2017 ) . Federated learning is a method of training a model ( in our case a deep neural network ) by using data from multiple centres , without having central access to each of them McMahan et al . ( 2017 ) . Local models at each of the data centres are iteratively updated and aggregated to form a global model . At each round of iteration , a central coordinator samples a subset , m , of local models , Sm , and sends them the current global model Gt . Each member of Sm then updates this global model using their local data to create an updated model Lt+1 . These models are then aggregated and are sent back to update the global model as : Gt+1 = Gt + η n m∑ i=1 ( Lt+1i −G t ) ( 1 ) where n is the number of nodes ( i.e. , data centres ) and η acts as a learning rate for replacing the global model with the aggregate of the local models . While this has been shown to work in many cases , Wang et al . ( 2020a ) make the argument that there is inherent difficulty in updating neural networks in this manner . They argue that the permutation invariance of the summation operand renders averaging in the parameter space a naive approach . For meaningful averaging to be done , the permutation must first be undone . 2.1 COMPROMISING FEDERATED LEARNING . One of the vulnerabilities of federated learning is that nodes being compromised can significantly affect the training of the global model Bhagoji et al . ( 2018 ) . Attacks of these sort can either ‘ poison ’ the data found at one of the nodes ( known as an adversarial attack ) or bias the model that is trained at one of the nodes significantly , leading it to highly skew the aggregation step Tolpegin et al . ( 2020 ) . There is also the possibility of the attack being a single-shot attack or a repeated attack Fang et al . ( 2020 ) . In the single shot case , only one of the nodes is compromised whereas in the repeated case , multiple nodes can be compromised at any given time . Many works have been produced in discussing how federated learning can be compromised by introducing a backdoor into the training process Gu et al . ( 2017 ) ; Bagdasaryan et al . ( 2020 ) . A backdoor is an attack that causes a classifier to produce unexpected behaviour if a specific trigger is added to the input space . An example is a sticker being added to an image and associating this with the incorrect label Gu et al . ( 2017 ) . Defences against these attacks have been developed with some authors using pruning of redundant neurons for the core classification task Liu et al . ( 2018 ) , using outlier detection to detect potential triggers Wang et al . ( 2019 ) , and re-training and preprocessing inputs Liu et al . ( 2017b ) . In this work we aim to overcome these limitations and build defence into the training procedure through the use of a student-teacher network that actively selects which data to train on . 3 METHODOLOGY . Our method is comprised of three agents in the training setup , the student , the teacher and the scheduler . 3.1 THE OVERALL SETUP . The overall setup of our federated learning training routine is as follows . We have a scheduler that controls which node we will be learning from ( this can be one-hot or we can select multiple nodes ) . The teacher at the node can then select a batch of data according to the state of the student . The student at the node is a copy of the global student . We use the student to forward pass the batch of data selected by the teacher and return the loss . In the one-hot scheduler scenario , we send back the loss to the global student model to update the weights via backpropagation . In the multi-node learning scenario , we aggregate the losses from all nodes selected and feed these back to the global model for updating . 3.2 DATA PREPROCESSING . The first step we must take in order to exploit our teacher setup is to rank our data according to some metric . Using Wang et al . ( 2020b ) as a guide , we choose to use the Mahalanobis distance expressed as : d ( xn ) = ( ( xn − µ ) T S−1 ( xn − µ ) ) 1 2 ( 2 ) for medical datasets , and the cosine similarity as our similarity metric for image datasets . As the tabular data found in electronic health record systems consist of multiple data types , we encode these using a denoising autoencoder . This trained encoder is distributed to all the nodes so that the data in each node is processed in the same way for consistency . 3.3 THE TEACHER . For the student-teacher interaction we follow the setup in El-Bouri et al . ( 2020 ) . The task of the teacher is to select a batch of data from the curriculum by selecting the index along the curriculum and the ‘ width ’ around that index to include in the selection . The following sequential steps are implemented : • The data at each node is organised into N curriculum batches according to some metric H . • The teacher selects one or more batches for feeding into the student . • A pre-trained autoencoder is used to create a latent representation of the batch . • The student is trained on this batch and it ’ s performance on a separate validation set is recorded . In this work we use the Mahalanobis distance for H for medical data , and cosine similarity for image data as summarised in Wang et al . ( 2020b ) . The teacher is a reinforcement learning agent and therefore is tasked with minimising the Bellman loss function given by : L ( θi ) = ( r + γmax a′ Q ( s′ , a′ ; θ−i ) −Q ( s , a ; θi ) ) 2 ( 3 ) where r is the reward of a state-action ( s , a ) tuple , γ the discount factor , Q is the q-value defining the value of taking an action given a state and θ and θ− are the parameters of the prediction and target ( the version of the teacher that is held constant for K steps to stabilise training as described in Mnih et al . ( 2015 ) ) networks respectively . As we also choose to use an actor-critic setup for the teacher , the action space and Q-function are separately parameterised . This allows a continuous action space and the actor that selects actions is updated using the following loss : ∇θµJ ≈ 1 N ∑ i ∇aQ ( s , a | θQ ) | s=si , a=µ ( si ) ∇θµµ ( s | θ µ ) ( 4 ) where Q is the Q-function and µ is the policy . The teacher can either be pre-trained , or jointly trained with the scheduler . The teacher can also either be trained on the dataset of one node and distributed to the rest or independently trained at each node . The latter is preferable due to the ability of the teacher to adapt to the dataset at hand . However , the former is useful when not all nodes in the federated system have access to computational power . The intuition is that the curriculum strategy learned by the teacher should be general for the task at hand and thereby provide strong performance .
This paper presents a new federated learning (FL) method augmented with "teacher" and "scheduler". The teacher is a reinforcement learning agent that observes the status of FL clients to inform which data mini-batches the clients should use to train their local model. The scheduler, on the other hand, is a meta-learner observing all the local model updates to decide which nodes (i.e., clients) to distribute the global model. Doing so by the scheduler allows the proposed method to cope with compromised clients. Experimental results using multiple hospital datasets as well as standard image datasets (MNIST and CIFAR-10) show the effectiveness of the proposed approach over some existing methods.
SP:4357084bf9c1370d8b6a0bb5b244dc8206d42d56
Auto-scaling Vision Transformers without Training
1 INTRODUCTION . Transformer ( Vaswani et al. , 2017 ) , a family of architectures based on the self-attention mechanism , is notable for modeling long-range dependencies in the data . The success of transformers has evolved from natural language processing to computer vision . Recently , Vision Transformer ( ViT ) ( Dosovitskiy et al. , 2020 ) , a transformer architecture consisting of self-attention encoder blocks , has been proposed to achieve competitive performance to convolution neural networks ( CNNs ) ( Simonyan & Zisserman , 2014 ; He et al. , 2016 ) on ImageNet ( Deng et al. , 2009 ) . However , it remains elusive on how to effectively design , scale-up , and train ViTs , with three important gaps awaiting . First , Dosovitskiy et al . ( 2020 ) directly hard-split the 2D image into a series of local patches , and learn the representation with a pre-defined number of attention heads and channel expansion ratios . These ad-hoc “ tokenization ” and embedding mainly inherit from language tasks ( Vaswani et al. , 2017 ) but are not customized for vision , which calls for more flexible and principled designs . Second , the learning behaviors of ViT , including ( loss of ) feature diversity ( Zhou et al. , 2021 ) , receptive fields ( Raghu et al. , 2021 ) and augmentations ( Touvron et al. , 2020 ; Jiang et al. , 2021 ) , differ vastly from CNNs . Benefiting from self-attention , ViT can capture global information even with shallow layers , yet its performance is quickly plateaued as going deeper . Strong augmentations are also vital to avoid ViTs from overfitting . These observations indicate that ViT architectures may require uniquely customized scaling-up laws to learn a more meaningful representation hierarchy . Third , training ViTs is both data and computation-consuming . To achieve state-of-the-art performance , ViT requires up to 300 million images and thousands of TPU-days . Although recent works attempt to enhance ViT ’ s data and resource efficiency ( Touvron et al. , 2020 ; Hassani et al. , 2021 ; Pan et al. , 2021 ; Chen et al. , 2021d ) , the heavy computation cost ( e.g. , quadratic with respect to the number of tokens ) is still overwhelming , compared with training CNNs . We point out that the above gaps are inherently connected by the core architecture problem : how to design and scale-up ViTs ? Different from the convolutional layer that directly digests raw pixels , ViTs embed coarse-level local patches as input tokens . Shall we divide an image into non-overlapping tokens of smaller size , or larger but overlapped tokens ? The former could embed more visual details in each token but ignores spatial coherency , while the latter sacrifices the local details but may benefit more spatial correlations among tokens . A further question is on ViT ’ s depth/width trade-off : shall we prefer a wider and shallower ViT , or a narrower but deeper one ? A similar dilemma also persists for ViT training : reducing the number of tokens would effectively speed up the ViT training , but meanwhile might sacrifice the training performance if sticking to coarse tokens from end to end . In this work , we aim to reform the discovery of novel ViT architectures . Our framework , called As-ViT ( Auto-scaling ViT ) , allows for extremely fast , efficient , and principled ViT design and scaling . In short , As-ViT first finds a promising “ seed ” topology for ViT of small depths and widths , then progressively “ grow ” it into different sizes ( number of parameters ) to meet different needs . Specifically , our “ seed ” ViT topology is discovered from a search space relaxed from recent manual ViT designs . To compare different topologies , we automate this process by a training-free architecture search approach and the measurement of ViT ’ s complexity , which are extremely fast and efficient . This training-free search is supported by our comprehensive study of various network complexity metrics , where we find the expected length distortion has the best trade-off between time costs and Kendall-tau correlations . Our “ seed ” ViT topology is then progressively scaled up from a small network to a large one , generating a series of ViT variants in a single run . Each step , the increases of depth and width are automatically and efficiently balanced by comparing network complexities . Furthermore , to address the data-hungry and heavy computation costs of ViTs , we make our ViT tokens elastic , and propose a progressive re-tokenization method for efficient ViT training . We summarize our contributions as below : 1 . We for the first time automate both the backbone design and scaling of ViTs . A “ seed ” ViT topology is first discovered ( in only seven V100 GPU-hours ) , and then its depths and widths are grown with a principled scaling rule in a single run ( five more V100 GPU-hours ) . 2 . To estimate ViT ’ s performance at initialization without any training , we conduct the first comprehensive study of ViT ’ s network complexity measurements . We empirically find the expected length distortion has the best trade-off between the computation costs and its Kendall-tau correlations with ViT ’ s ground-truth accuracy . 3 . During training , we propose a progressive re-tokenization scheme via the change of dilation and stride , which demonstrates to be a highly efficient ViT training strategy that saves up to 56.2 % training FLOPs and 41.1 % training time , while preserving a competitive accuracy . 4 . Our As-ViT achieves strong performance on classification ( 83.5 % top-1 on ImageNet-1k ) and detection ( 52.7 % mAP on COCO ) . 2 WHY WE NEED AUTOMATED DESIGN AND SCALING PRINCIPLE FOR VIT ? . Background and recent development of ViT1 To transform a 2D image into a sequence , ViT ( Dosovitskiy et al. , 2020 ) splits each image into 14 × 14 or 16 × 16 patches and embeds them into a fixed number of tokens ; then following practice of the transformer for language modeling , ViT applies self-attention to learn reweighting masks as relationship modeling for tokens , and leverages FFN ( Feed-Forward Network ) layers to learn feature embeddings . To better facilitate the visual representation learning , recently works try to train deeper ViTs ( Touvron et al. , 2021 ; Zhou et al. , 2021 ) , incorporate convolutions ( Wu et al. , 2021 ; d ’ Ascoli et al. , 2021 ; Yuan et al. , 2021a ) , and design multi-scale feature extractions ( Chen et al. , 2021b ; Zhang et al. , 2021 ; Wang et al. , 2021 ) . Why manual design and scaling may be suboptimal ? As the ViT architecture is still in its infant stage , there is no principle in its design and scaling . Early designs incorporate large token sizes , constant sequence length , and hidden size ( Dosovitskiy et al. , 2020 ; Touvron et al. , 2020 ) , and recent trends include small patches , spatial reduction , and channel doubling ( Zhou et al. , 2021 ; Liu et al. , 2021 ) . They all achieve comparably good performance , leaving the optimal choices unclear . Moreover , different learning behaviors of transformers from CNNs make the scaling law of ViTs 1We generally use the term “ ViT ” to indicate deep networks of self-attention blocks for vision problems . We always include a clear citation when we specifically discuss the ViTs proposed by Dosovitskiy et al . ( 2020 ) . highly unclear . Recent works ( Zhou et al. , 2021 ) demonstrated that attention maps of ViTs gradually become similar in deeper layers , leading to identical feature maps and saturated performance . ViT also generates more uniform representations across layers , enabling early aggregation of global context ( Raghu et al. , 2021 ) . This is contradictory to CNNs as deeper layers help the learning of visual global information ( Chen et al. , 2018 ) . These observations all indicate that previously studied scaling laws ( depth/width allocations ) for CNNs ( Tan & Le , 2019 ) may not be appropriate to ViTs . What principle do we want ? We aim to automatically design and scale-up ViTs , being principled and avoiding manual efforts and potential biases . We also want to answer two questions : 1 ) Does ViT have any preference in its topology ( patch sizes , expansion ratios , number of attention heads , etc. ) ? 2 ) Does ViT necessarily follow the same scaling rule of CNNs ? 3 AUTO-DESIGN & SCALING OF VITS WITH NETWORK COMPLEXITY . To accelerate in ViT designing and avoid tedious manual efforts , we target efficient , automated , and principled search and scaling of ViTs . Specifically , we have two problems to solve : 1 ) with zero training cost ( Section 3.2 ) , how to efficiently find the optimal ViT architecture topology ( Section 3.3 ) ? 2 ) how to scale-up depths and widths of the ViT topology to meet different needs of model sizes ( Section 3.4 ) ? 3.1 EXPANDED TOPOLOGY SPACE FOR VITS . Before designing and scaling , we first briefly introduce our expanded topology search space for our As-ViT ( blue italics in Figure 1 ) . We first embed the input image into patches of a 14 -scale resolution , and adopt a stage-wise spatial reduction and channel doubling strategy . This is for the convenience of dense prediction tasks like detection that require multi-scale features . Table 1 summarizes details of our topology space , and will be explained below . Elastic kernels . Instead of generating non- overlapped image patches , we propose to search for the kernel size . This will enable patches to be overlapped with their neighbors , introducing more spatial correlations among tokens . Moreover , each time we downsample the spatial resolution , we also introduce overlaps when re-embedding local tokens ( implemented by either a linear or a convolutional layer ) . Elastic attention splits . Splitting the attention into local windows is an important design to reduce the computation cost of self-attention without sacrificing much performance ( Zaheer et al. , 2020 ; Liu et al. , 2021 ) . Instead of using a fixed number of splits , we propose to search for elastic attention splits for each stage2 . Note that we try to make our design general and do not use shifted windows ( Liu et al. , 2021 ) . More search dimensions . ViT ( Dosovitskiy et al. , 2020 ) by default leveraged an FFN layer with 4× expanded hidden dimension for each attention block . To enable a more flexible design of ViT architectures , for each stage we further search over the FFN expansion ratio . We also search for the final number of heads for the self-attention module . 2Due to spatial reduction , the 4th stage may already reach a resolution at 7× 7 on ImageNet , and we set its splitting as 1 . 3.2 ASSESSING VIT COMPLEXITY AT INITIALIZATION VIA MANIFOLD PROPAGATION . Training ViTs is slow : hence an architecture search guided by evaluating trained models ’ accuracies will be dauntingly expensive . We note a recent surge of training-free neural architecture search methods for ReLU-based CNNs , leveraging local linear maps ( Mellor et al. , 2020 ) , gradient sensitivity ( Abdelfattah et al. , 2021 ) , number of linear regions ( Chen et al. , 2021e ; f ) , or network topology ( Bhardwaj et al. , 2021 ) . However , ViTs are equipped with more complex non-linear functions : self-attention , softmax , and GeLU . Therefore , we need to measure their learning capacity in a more general way . In our work , we consider measuring the complexity of manifold propagation through ViT , to estimate how complex functions can be approximated by ViTs . Intuitively , a complex network can propagate a simple input into a complex manifold at its output layer , thus likely to possess a strong learning capacity . In our work , we study the manifold complexity of mapping a simple circle input through the ViT : h ( θ ) = √ N [ u0 cos ( θ ) + u1 sin ( θ ) ] . Here , N is the dimension of ViT ’ s input ( e.g . N = 3× 224× 224 for ImageNet images ) , u0 and u1 form an orthonormal basis for a 2-dimensional subspace ofRN in which the circle lives . We further define the ViT network as N , its input-output Jacobian v ( θ ) = ∂θN ( h ( θ ) ) at the input θ , and a ( θ ) = ∂θv ( θ ) . We will calculate expected complexities over a certain number of θs uniformly sampled from [ 0 , 2π ) . In our work , we study three different types of manifold complexities : 1 . Curvature can be defined as the reciprocal of the radius of the osculating circle on the ViT ’ s output manifold . Intuitively , a larger curvature indicates that N ( θ ) changes fast at a certain θ . According to Riemannian geometry ( Lee , 2006 ; Poole et al. , 2016 ) , the curvature can be explicitly calculated as κ = ∫ ( v ( θ ) · v ( θ ) ) −3/2 √ ( v ( θ ) · v ( θ ) ) ( a ( θ ) · a ( θ ) ) − ( v ( θ ) · a ( θ ) ) 2dθ . 2 . Length Distortion in Euclidean space is defined as LE = length ( N ( θ ) ) length ( θ ) = ∫ √ ‖v ( θ ) ‖2dθ . It measures when the network takes a unit-length curve as input , what is the length of the output curve . Since the ground-truth function we want to estimate ( usingN ) is usually very complex , one may also expect that networks with better performance should also generate longer outputs . 3 . The problem of LE is that , stretched outputs not necessarily translate to complex outputs . A simple example : even an appropriately initialized linear network could grow a straight line into a long output ( i.e . a large norm of input-output Jacobian ) . Therefore , one could instead use Length Distortion taking curvature into consideration to measure how quickly the normalized Jacobian v̂ ( θ ) = v ( θ ) / √ v ( θ ) · v ( θ ) changes with respect to θ , defined as LEκ = ∫ √ ‖∂θv̂ ( θ ) ‖2dθ . In our study , we aim to compare the potential of using these three complexity metrics to guide the ViT architecture selection . As the core of neural architecture search is to rank the performance of different architectures , we measure the Kendall-tau correlations ( τ ) between these metrics and models ’ ground-truth accuracies . We randomly sampled 87 ViT topologies from Table 1 ( with L1 = L2 = L3 = L4 = 1 , C = 32 ) , fully train them on ImageNet-1k for 300 epochs ( following the same training recipe of DeiT ( Touvron et al. , 2020 ) ) , and also measure their κ , LE , LEκ at initialization . As shown in Figure 2 , we can clearly see that both κ and LE exhibit high Kendall-tau correlations . κ has a negative correlation , which may indicate that changes of output manifold on the tangent direction are more important to ViT training , instead of on the perpendicular direction . Meanwhile , κ costs too much computation time due to second derivatives . We decide to choose LE as our complexity measure for highly fast ViT topology search and scaling .
In this paper, the author proposes auto-scaling ViT, which is to search seed ViT topology based on number of kernels, attention splits, expansion ratio, depth and width jointly. The searched ViT is trained with a progressive re-tokenization scheme that saves ~40% training time and preserves the accuracy with less parameters. Experiments on ImageNet and MSCOCO show that AS-ViT can reach strong performances on classification and detection.
SP:e673389c880b72a2517d691163467ac077c4ca93
Auto-scaling Vision Transformers without Training
1 INTRODUCTION . Transformer ( Vaswani et al. , 2017 ) , a family of architectures based on the self-attention mechanism , is notable for modeling long-range dependencies in the data . The success of transformers has evolved from natural language processing to computer vision . Recently , Vision Transformer ( ViT ) ( Dosovitskiy et al. , 2020 ) , a transformer architecture consisting of self-attention encoder blocks , has been proposed to achieve competitive performance to convolution neural networks ( CNNs ) ( Simonyan & Zisserman , 2014 ; He et al. , 2016 ) on ImageNet ( Deng et al. , 2009 ) . However , it remains elusive on how to effectively design , scale-up , and train ViTs , with three important gaps awaiting . First , Dosovitskiy et al . ( 2020 ) directly hard-split the 2D image into a series of local patches , and learn the representation with a pre-defined number of attention heads and channel expansion ratios . These ad-hoc “ tokenization ” and embedding mainly inherit from language tasks ( Vaswani et al. , 2017 ) but are not customized for vision , which calls for more flexible and principled designs . Second , the learning behaviors of ViT , including ( loss of ) feature diversity ( Zhou et al. , 2021 ) , receptive fields ( Raghu et al. , 2021 ) and augmentations ( Touvron et al. , 2020 ; Jiang et al. , 2021 ) , differ vastly from CNNs . Benefiting from self-attention , ViT can capture global information even with shallow layers , yet its performance is quickly plateaued as going deeper . Strong augmentations are also vital to avoid ViTs from overfitting . These observations indicate that ViT architectures may require uniquely customized scaling-up laws to learn a more meaningful representation hierarchy . Third , training ViTs is both data and computation-consuming . To achieve state-of-the-art performance , ViT requires up to 300 million images and thousands of TPU-days . Although recent works attempt to enhance ViT ’ s data and resource efficiency ( Touvron et al. , 2020 ; Hassani et al. , 2021 ; Pan et al. , 2021 ; Chen et al. , 2021d ) , the heavy computation cost ( e.g. , quadratic with respect to the number of tokens ) is still overwhelming , compared with training CNNs . We point out that the above gaps are inherently connected by the core architecture problem : how to design and scale-up ViTs ? Different from the convolutional layer that directly digests raw pixels , ViTs embed coarse-level local patches as input tokens . Shall we divide an image into non-overlapping tokens of smaller size , or larger but overlapped tokens ? The former could embed more visual details in each token but ignores spatial coherency , while the latter sacrifices the local details but may benefit more spatial correlations among tokens . A further question is on ViT ’ s depth/width trade-off : shall we prefer a wider and shallower ViT , or a narrower but deeper one ? A similar dilemma also persists for ViT training : reducing the number of tokens would effectively speed up the ViT training , but meanwhile might sacrifice the training performance if sticking to coarse tokens from end to end . In this work , we aim to reform the discovery of novel ViT architectures . Our framework , called As-ViT ( Auto-scaling ViT ) , allows for extremely fast , efficient , and principled ViT design and scaling . In short , As-ViT first finds a promising “ seed ” topology for ViT of small depths and widths , then progressively “ grow ” it into different sizes ( number of parameters ) to meet different needs . Specifically , our “ seed ” ViT topology is discovered from a search space relaxed from recent manual ViT designs . To compare different topologies , we automate this process by a training-free architecture search approach and the measurement of ViT ’ s complexity , which are extremely fast and efficient . This training-free search is supported by our comprehensive study of various network complexity metrics , where we find the expected length distortion has the best trade-off between time costs and Kendall-tau correlations . Our “ seed ” ViT topology is then progressively scaled up from a small network to a large one , generating a series of ViT variants in a single run . Each step , the increases of depth and width are automatically and efficiently balanced by comparing network complexities . Furthermore , to address the data-hungry and heavy computation costs of ViTs , we make our ViT tokens elastic , and propose a progressive re-tokenization method for efficient ViT training . We summarize our contributions as below : 1 . We for the first time automate both the backbone design and scaling of ViTs . A “ seed ” ViT topology is first discovered ( in only seven V100 GPU-hours ) , and then its depths and widths are grown with a principled scaling rule in a single run ( five more V100 GPU-hours ) . 2 . To estimate ViT ’ s performance at initialization without any training , we conduct the first comprehensive study of ViT ’ s network complexity measurements . We empirically find the expected length distortion has the best trade-off between the computation costs and its Kendall-tau correlations with ViT ’ s ground-truth accuracy . 3 . During training , we propose a progressive re-tokenization scheme via the change of dilation and stride , which demonstrates to be a highly efficient ViT training strategy that saves up to 56.2 % training FLOPs and 41.1 % training time , while preserving a competitive accuracy . 4 . Our As-ViT achieves strong performance on classification ( 83.5 % top-1 on ImageNet-1k ) and detection ( 52.7 % mAP on COCO ) . 2 WHY WE NEED AUTOMATED DESIGN AND SCALING PRINCIPLE FOR VIT ? . Background and recent development of ViT1 To transform a 2D image into a sequence , ViT ( Dosovitskiy et al. , 2020 ) splits each image into 14 × 14 or 16 × 16 patches and embeds them into a fixed number of tokens ; then following practice of the transformer for language modeling , ViT applies self-attention to learn reweighting masks as relationship modeling for tokens , and leverages FFN ( Feed-Forward Network ) layers to learn feature embeddings . To better facilitate the visual representation learning , recently works try to train deeper ViTs ( Touvron et al. , 2021 ; Zhou et al. , 2021 ) , incorporate convolutions ( Wu et al. , 2021 ; d ’ Ascoli et al. , 2021 ; Yuan et al. , 2021a ) , and design multi-scale feature extractions ( Chen et al. , 2021b ; Zhang et al. , 2021 ; Wang et al. , 2021 ) . Why manual design and scaling may be suboptimal ? As the ViT architecture is still in its infant stage , there is no principle in its design and scaling . Early designs incorporate large token sizes , constant sequence length , and hidden size ( Dosovitskiy et al. , 2020 ; Touvron et al. , 2020 ) , and recent trends include small patches , spatial reduction , and channel doubling ( Zhou et al. , 2021 ; Liu et al. , 2021 ) . They all achieve comparably good performance , leaving the optimal choices unclear . Moreover , different learning behaviors of transformers from CNNs make the scaling law of ViTs 1We generally use the term “ ViT ” to indicate deep networks of self-attention blocks for vision problems . We always include a clear citation when we specifically discuss the ViTs proposed by Dosovitskiy et al . ( 2020 ) . highly unclear . Recent works ( Zhou et al. , 2021 ) demonstrated that attention maps of ViTs gradually become similar in deeper layers , leading to identical feature maps and saturated performance . ViT also generates more uniform representations across layers , enabling early aggregation of global context ( Raghu et al. , 2021 ) . This is contradictory to CNNs as deeper layers help the learning of visual global information ( Chen et al. , 2018 ) . These observations all indicate that previously studied scaling laws ( depth/width allocations ) for CNNs ( Tan & Le , 2019 ) may not be appropriate to ViTs . What principle do we want ? We aim to automatically design and scale-up ViTs , being principled and avoiding manual efforts and potential biases . We also want to answer two questions : 1 ) Does ViT have any preference in its topology ( patch sizes , expansion ratios , number of attention heads , etc. ) ? 2 ) Does ViT necessarily follow the same scaling rule of CNNs ? 3 AUTO-DESIGN & SCALING OF VITS WITH NETWORK COMPLEXITY . To accelerate in ViT designing and avoid tedious manual efforts , we target efficient , automated , and principled search and scaling of ViTs . Specifically , we have two problems to solve : 1 ) with zero training cost ( Section 3.2 ) , how to efficiently find the optimal ViT architecture topology ( Section 3.3 ) ? 2 ) how to scale-up depths and widths of the ViT topology to meet different needs of model sizes ( Section 3.4 ) ? 3.1 EXPANDED TOPOLOGY SPACE FOR VITS . Before designing and scaling , we first briefly introduce our expanded topology search space for our As-ViT ( blue italics in Figure 1 ) . We first embed the input image into patches of a 14 -scale resolution , and adopt a stage-wise spatial reduction and channel doubling strategy . This is for the convenience of dense prediction tasks like detection that require multi-scale features . Table 1 summarizes details of our topology space , and will be explained below . Elastic kernels . Instead of generating non- overlapped image patches , we propose to search for the kernel size . This will enable patches to be overlapped with their neighbors , introducing more spatial correlations among tokens . Moreover , each time we downsample the spatial resolution , we also introduce overlaps when re-embedding local tokens ( implemented by either a linear or a convolutional layer ) . Elastic attention splits . Splitting the attention into local windows is an important design to reduce the computation cost of self-attention without sacrificing much performance ( Zaheer et al. , 2020 ; Liu et al. , 2021 ) . Instead of using a fixed number of splits , we propose to search for elastic attention splits for each stage2 . Note that we try to make our design general and do not use shifted windows ( Liu et al. , 2021 ) . More search dimensions . ViT ( Dosovitskiy et al. , 2020 ) by default leveraged an FFN layer with 4× expanded hidden dimension for each attention block . To enable a more flexible design of ViT architectures , for each stage we further search over the FFN expansion ratio . We also search for the final number of heads for the self-attention module . 2Due to spatial reduction , the 4th stage may already reach a resolution at 7× 7 on ImageNet , and we set its splitting as 1 . 3.2 ASSESSING VIT COMPLEXITY AT INITIALIZATION VIA MANIFOLD PROPAGATION . Training ViTs is slow : hence an architecture search guided by evaluating trained models ’ accuracies will be dauntingly expensive . We note a recent surge of training-free neural architecture search methods for ReLU-based CNNs , leveraging local linear maps ( Mellor et al. , 2020 ) , gradient sensitivity ( Abdelfattah et al. , 2021 ) , number of linear regions ( Chen et al. , 2021e ; f ) , or network topology ( Bhardwaj et al. , 2021 ) . However , ViTs are equipped with more complex non-linear functions : self-attention , softmax , and GeLU . Therefore , we need to measure their learning capacity in a more general way . In our work , we consider measuring the complexity of manifold propagation through ViT , to estimate how complex functions can be approximated by ViTs . Intuitively , a complex network can propagate a simple input into a complex manifold at its output layer , thus likely to possess a strong learning capacity . In our work , we study the manifold complexity of mapping a simple circle input through the ViT : h ( θ ) = √ N [ u0 cos ( θ ) + u1 sin ( θ ) ] . Here , N is the dimension of ViT ’ s input ( e.g . N = 3× 224× 224 for ImageNet images ) , u0 and u1 form an orthonormal basis for a 2-dimensional subspace ofRN in which the circle lives . We further define the ViT network as N , its input-output Jacobian v ( θ ) = ∂θN ( h ( θ ) ) at the input θ , and a ( θ ) = ∂θv ( θ ) . We will calculate expected complexities over a certain number of θs uniformly sampled from [ 0 , 2π ) . In our work , we study three different types of manifold complexities : 1 . Curvature can be defined as the reciprocal of the radius of the osculating circle on the ViT ’ s output manifold . Intuitively , a larger curvature indicates that N ( θ ) changes fast at a certain θ . According to Riemannian geometry ( Lee , 2006 ; Poole et al. , 2016 ) , the curvature can be explicitly calculated as κ = ∫ ( v ( θ ) · v ( θ ) ) −3/2 √ ( v ( θ ) · v ( θ ) ) ( a ( θ ) · a ( θ ) ) − ( v ( θ ) · a ( θ ) ) 2dθ . 2 . Length Distortion in Euclidean space is defined as LE = length ( N ( θ ) ) length ( θ ) = ∫ √ ‖v ( θ ) ‖2dθ . It measures when the network takes a unit-length curve as input , what is the length of the output curve . Since the ground-truth function we want to estimate ( usingN ) is usually very complex , one may also expect that networks with better performance should also generate longer outputs . 3 . The problem of LE is that , stretched outputs not necessarily translate to complex outputs . A simple example : even an appropriately initialized linear network could grow a straight line into a long output ( i.e . a large norm of input-output Jacobian ) . Therefore , one could instead use Length Distortion taking curvature into consideration to measure how quickly the normalized Jacobian v̂ ( θ ) = v ( θ ) / √ v ( θ ) · v ( θ ) changes with respect to θ , defined as LEκ = ∫ √ ‖∂θv̂ ( θ ) ‖2dθ . In our study , we aim to compare the potential of using these three complexity metrics to guide the ViT architecture selection . As the core of neural architecture search is to rank the performance of different architectures , we measure the Kendall-tau correlations ( τ ) between these metrics and models ’ ground-truth accuracies . We randomly sampled 87 ViT topologies from Table 1 ( with L1 = L2 = L3 = L4 = 1 , C = 32 ) , fully train them on ImageNet-1k for 300 epochs ( following the same training recipe of DeiT ( Touvron et al. , 2020 ) ) , and also measure their κ , LE , LEκ at initialization . As shown in Figure 2 , we can clearly see that both κ and LE exhibit high Kendall-tau correlations . κ has a negative correlation , which may indicate that changes of output manifold on the tangent direction are more important to ViT training , instead of on the perpendicular direction . Meanwhile , κ costs too much computation time due to second derivatives . We decide to choose LE as our complexity measure for highly fast ViT topology search and scaling .
Initial variants of ViTs borrow their architecture from the seminal ‘attention is all you need’ work. Some recent methods amend the default transformer architecture to incorporate convolutions in the design (e.g., CCT: Compact Convolutional Transformers), or a hierarchical architecture with feature pyramids (e.g., Swin, PyramidViT etc) to make ViTs suitable for dense prediction tasks (detection and segmentation). Instead of relying on hand-designed architectures, the paper proposes to automatically search for a ViT architecture, that is both efficient & accurate.
SP:e673389c880b72a2517d691163467ac077c4ca93
Auto-scaling Vision Transformers without Training
1 INTRODUCTION . Transformer ( Vaswani et al. , 2017 ) , a family of architectures based on the self-attention mechanism , is notable for modeling long-range dependencies in the data . The success of transformers has evolved from natural language processing to computer vision . Recently , Vision Transformer ( ViT ) ( Dosovitskiy et al. , 2020 ) , a transformer architecture consisting of self-attention encoder blocks , has been proposed to achieve competitive performance to convolution neural networks ( CNNs ) ( Simonyan & Zisserman , 2014 ; He et al. , 2016 ) on ImageNet ( Deng et al. , 2009 ) . However , it remains elusive on how to effectively design , scale-up , and train ViTs , with three important gaps awaiting . First , Dosovitskiy et al . ( 2020 ) directly hard-split the 2D image into a series of local patches , and learn the representation with a pre-defined number of attention heads and channel expansion ratios . These ad-hoc “ tokenization ” and embedding mainly inherit from language tasks ( Vaswani et al. , 2017 ) but are not customized for vision , which calls for more flexible and principled designs . Second , the learning behaviors of ViT , including ( loss of ) feature diversity ( Zhou et al. , 2021 ) , receptive fields ( Raghu et al. , 2021 ) and augmentations ( Touvron et al. , 2020 ; Jiang et al. , 2021 ) , differ vastly from CNNs . Benefiting from self-attention , ViT can capture global information even with shallow layers , yet its performance is quickly plateaued as going deeper . Strong augmentations are also vital to avoid ViTs from overfitting . These observations indicate that ViT architectures may require uniquely customized scaling-up laws to learn a more meaningful representation hierarchy . Third , training ViTs is both data and computation-consuming . To achieve state-of-the-art performance , ViT requires up to 300 million images and thousands of TPU-days . Although recent works attempt to enhance ViT ’ s data and resource efficiency ( Touvron et al. , 2020 ; Hassani et al. , 2021 ; Pan et al. , 2021 ; Chen et al. , 2021d ) , the heavy computation cost ( e.g. , quadratic with respect to the number of tokens ) is still overwhelming , compared with training CNNs . We point out that the above gaps are inherently connected by the core architecture problem : how to design and scale-up ViTs ? Different from the convolutional layer that directly digests raw pixels , ViTs embed coarse-level local patches as input tokens . Shall we divide an image into non-overlapping tokens of smaller size , or larger but overlapped tokens ? The former could embed more visual details in each token but ignores spatial coherency , while the latter sacrifices the local details but may benefit more spatial correlations among tokens . A further question is on ViT ’ s depth/width trade-off : shall we prefer a wider and shallower ViT , or a narrower but deeper one ? A similar dilemma also persists for ViT training : reducing the number of tokens would effectively speed up the ViT training , but meanwhile might sacrifice the training performance if sticking to coarse tokens from end to end . In this work , we aim to reform the discovery of novel ViT architectures . Our framework , called As-ViT ( Auto-scaling ViT ) , allows for extremely fast , efficient , and principled ViT design and scaling . In short , As-ViT first finds a promising “ seed ” topology for ViT of small depths and widths , then progressively “ grow ” it into different sizes ( number of parameters ) to meet different needs . Specifically , our “ seed ” ViT topology is discovered from a search space relaxed from recent manual ViT designs . To compare different topologies , we automate this process by a training-free architecture search approach and the measurement of ViT ’ s complexity , which are extremely fast and efficient . This training-free search is supported by our comprehensive study of various network complexity metrics , where we find the expected length distortion has the best trade-off between time costs and Kendall-tau correlations . Our “ seed ” ViT topology is then progressively scaled up from a small network to a large one , generating a series of ViT variants in a single run . Each step , the increases of depth and width are automatically and efficiently balanced by comparing network complexities . Furthermore , to address the data-hungry and heavy computation costs of ViTs , we make our ViT tokens elastic , and propose a progressive re-tokenization method for efficient ViT training . We summarize our contributions as below : 1 . We for the first time automate both the backbone design and scaling of ViTs . A “ seed ” ViT topology is first discovered ( in only seven V100 GPU-hours ) , and then its depths and widths are grown with a principled scaling rule in a single run ( five more V100 GPU-hours ) . 2 . To estimate ViT ’ s performance at initialization without any training , we conduct the first comprehensive study of ViT ’ s network complexity measurements . We empirically find the expected length distortion has the best trade-off between the computation costs and its Kendall-tau correlations with ViT ’ s ground-truth accuracy . 3 . During training , we propose a progressive re-tokenization scheme via the change of dilation and stride , which demonstrates to be a highly efficient ViT training strategy that saves up to 56.2 % training FLOPs and 41.1 % training time , while preserving a competitive accuracy . 4 . Our As-ViT achieves strong performance on classification ( 83.5 % top-1 on ImageNet-1k ) and detection ( 52.7 % mAP on COCO ) . 2 WHY WE NEED AUTOMATED DESIGN AND SCALING PRINCIPLE FOR VIT ? . Background and recent development of ViT1 To transform a 2D image into a sequence , ViT ( Dosovitskiy et al. , 2020 ) splits each image into 14 × 14 or 16 × 16 patches and embeds them into a fixed number of tokens ; then following practice of the transformer for language modeling , ViT applies self-attention to learn reweighting masks as relationship modeling for tokens , and leverages FFN ( Feed-Forward Network ) layers to learn feature embeddings . To better facilitate the visual representation learning , recently works try to train deeper ViTs ( Touvron et al. , 2021 ; Zhou et al. , 2021 ) , incorporate convolutions ( Wu et al. , 2021 ; d ’ Ascoli et al. , 2021 ; Yuan et al. , 2021a ) , and design multi-scale feature extractions ( Chen et al. , 2021b ; Zhang et al. , 2021 ; Wang et al. , 2021 ) . Why manual design and scaling may be suboptimal ? As the ViT architecture is still in its infant stage , there is no principle in its design and scaling . Early designs incorporate large token sizes , constant sequence length , and hidden size ( Dosovitskiy et al. , 2020 ; Touvron et al. , 2020 ) , and recent trends include small patches , spatial reduction , and channel doubling ( Zhou et al. , 2021 ; Liu et al. , 2021 ) . They all achieve comparably good performance , leaving the optimal choices unclear . Moreover , different learning behaviors of transformers from CNNs make the scaling law of ViTs 1We generally use the term “ ViT ” to indicate deep networks of self-attention blocks for vision problems . We always include a clear citation when we specifically discuss the ViTs proposed by Dosovitskiy et al . ( 2020 ) . highly unclear . Recent works ( Zhou et al. , 2021 ) demonstrated that attention maps of ViTs gradually become similar in deeper layers , leading to identical feature maps and saturated performance . ViT also generates more uniform representations across layers , enabling early aggregation of global context ( Raghu et al. , 2021 ) . This is contradictory to CNNs as deeper layers help the learning of visual global information ( Chen et al. , 2018 ) . These observations all indicate that previously studied scaling laws ( depth/width allocations ) for CNNs ( Tan & Le , 2019 ) may not be appropriate to ViTs . What principle do we want ? We aim to automatically design and scale-up ViTs , being principled and avoiding manual efforts and potential biases . We also want to answer two questions : 1 ) Does ViT have any preference in its topology ( patch sizes , expansion ratios , number of attention heads , etc. ) ? 2 ) Does ViT necessarily follow the same scaling rule of CNNs ? 3 AUTO-DESIGN & SCALING OF VITS WITH NETWORK COMPLEXITY . To accelerate in ViT designing and avoid tedious manual efforts , we target efficient , automated , and principled search and scaling of ViTs . Specifically , we have two problems to solve : 1 ) with zero training cost ( Section 3.2 ) , how to efficiently find the optimal ViT architecture topology ( Section 3.3 ) ? 2 ) how to scale-up depths and widths of the ViT topology to meet different needs of model sizes ( Section 3.4 ) ? 3.1 EXPANDED TOPOLOGY SPACE FOR VITS . Before designing and scaling , we first briefly introduce our expanded topology search space for our As-ViT ( blue italics in Figure 1 ) . We first embed the input image into patches of a 14 -scale resolution , and adopt a stage-wise spatial reduction and channel doubling strategy . This is for the convenience of dense prediction tasks like detection that require multi-scale features . Table 1 summarizes details of our topology space , and will be explained below . Elastic kernels . Instead of generating non- overlapped image patches , we propose to search for the kernel size . This will enable patches to be overlapped with their neighbors , introducing more spatial correlations among tokens . Moreover , each time we downsample the spatial resolution , we also introduce overlaps when re-embedding local tokens ( implemented by either a linear or a convolutional layer ) . Elastic attention splits . Splitting the attention into local windows is an important design to reduce the computation cost of self-attention without sacrificing much performance ( Zaheer et al. , 2020 ; Liu et al. , 2021 ) . Instead of using a fixed number of splits , we propose to search for elastic attention splits for each stage2 . Note that we try to make our design general and do not use shifted windows ( Liu et al. , 2021 ) . More search dimensions . ViT ( Dosovitskiy et al. , 2020 ) by default leveraged an FFN layer with 4× expanded hidden dimension for each attention block . To enable a more flexible design of ViT architectures , for each stage we further search over the FFN expansion ratio . We also search for the final number of heads for the self-attention module . 2Due to spatial reduction , the 4th stage may already reach a resolution at 7× 7 on ImageNet , and we set its splitting as 1 . 3.2 ASSESSING VIT COMPLEXITY AT INITIALIZATION VIA MANIFOLD PROPAGATION . Training ViTs is slow : hence an architecture search guided by evaluating trained models ’ accuracies will be dauntingly expensive . We note a recent surge of training-free neural architecture search methods for ReLU-based CNNs , leveraging local linear maps ( Mellor et al. , 2020 ) , gradient sensitivity ( Abdelfattah et al. , 2021 ) , number of linear regions ( Chen et al. , 2021e ; f ) , or network topology ( Bhardwaj et al. , 2021 ) . However , ViTs are equipped with more complex non-linear functions : self-attention , softmax , and GeLU . Therefore , we need to measure their learning capacity in a more general way . In our work , we consider measuring the complexity of manifold propagation through ViT , to estimate how complex functions can be approximated by ViTs . Intuitively , a complex network can propagate a simple input into a complex manifold at its output layer , thus likely to possess a strong learning capacity . In our work , we study the manifold complexity of mapping a simple circle input through the ViT : h ( θ ) = √ N [ u0 cos ( θ ) + u1 sin ( θ ) ] . Here , N is the dimension of ViT ’ s input ( e.g . N = 3× 224× 224 for ImageNet images ) , u0 and u1 form an orthonormal basis for a 2-dimensional subspace ofRN in which the circle lives . We further define the ViT network as N , its input-output Jacobian v ( θ ) = ∂θN ( h ( θ ) ) at the input θ , and a ( θ ) = ∂θv ( θ ) . We will calculate expected complexities over a certain number of θs uniformly sampled from [ 0 , 2π ) . In our work , we study three different types of manifold complexities : 1 . Curvature can be defined as the reciprocal of the radius of the osculating circle on the ViT ’ s output manifold . Intuitively , a larger curvature indicates that N ( θ ) changes fast at a certain θ . According to Riemannian geometry ( Lee , 2006 ; Poole et al. , 2016 ) , the curvature can be explicitly calculated as κ = ∫ ( v ( θ ) · v ( θ ) ) −3/2 √ ( v ( θ ) · v ( θ ) ) ( a ( θ ) · a ( θ ) ) − ( v ( θ ) · a ( θ ) ) 2dθ . 2 . Length Distortion in Euclidean space is defined as LE = length ( N ( θ ) ) length ( θ ) = ∫ √ ‖v ( θ ) ‖2dθ . It measures when the network takes a unit-length curve as input , what is the length of the output curve . Since the ground-truth function we want to estimate ( usingN ) is usually very complex , one may also expect that networks with better performance should also generate longer outputs . 3 . The problem of LE is that , stretched outputs not necessarily translate to complex outputs . A simple example : even an appropriately initialized linear network could grow a straight line into a long output ( i.e . a large norm of input-output Jacobian ) . Therefore , one could instead use Length Distortion taking curvature into consideration to measure how quickly the normalized Jacobian v̂ ( θ ) = v ( θ ) / √ v ( θ ) · v ( θ ) changes with respect to θ , defined as LEκ = ∫ √ ‖∂θv̂ ( θ ) ‖2dθ . In our study , we aim to compare the potential of using these three complexity metrics to guide the ViT architecture selection . As the core of neural architecture search is to rank the performance of different architectures , we measure the Kendall-tau correlations ( τ ) between these metrics and models ’ ground-truth accuracies . We randomly sampled 87 ViT topologies from Table 1 ( with L1 = L2 = L3 = L4 = 1 , C = 32 ) , fully train them on ImageNet-1k for 300 epochs ( following the same training recipe of DeiT ( Touvron et al. , 2020 ) ) , and also measure their κ , LE , LEκ at initialization . As shown in Figure 2 , we can clearly see that both κ and LE exhibit high Kendall-tau correlations . κ has a negative correlation , which may indicate that changes of output manifold on the tangent direction are more important to ViT training , instead of on the perpendicular direction . Meanwhile , κ costs too much computation time due to second derivatives . We decide to choose LE as our complexity measure for highly fast ViT topology search and scaling .
The paper proposed As-ViT to automate the principled design of vision transformers without tedious human efforts. To my best knowledge, it is the first framework that unifies efficient search, scaling and training in ViTs. The empirical performance is in general satisfactory.
SP:e673389c880b72a2517d691163467ac077c4ca93
GLASS: GNN with Labeling Tricks for Subgraph Representation Learning
1 INTRODUCTION . Graph is a natural tool for modeling objects with complex internal relationships , which is widely used in fields such as natural language processing ( Yao et al. , 2019 ) , biology ( Fout et al. , 2017 ) , and social network ( Chen et al. , 2018 ) . Among the various graph representation learning methods , GNN has achieved state-of-the-art performance on almost all sorts of tasks . Existing GNNs are mainly designed for node ( Dabhi & Parmar , 2020 ; Chen et al. , 2020 ) , edge ( Singh et al. , 2021 ; Galkin et al. , 2021 ) and whole graph ( Ying et al. , 2021b ; Yang et al. , 2020 ) property prediction tasks . An ordinary GNN produces embeddings of a node by aggregating the features from the ( multi-hop ) neighbors of the node , which is equivalent to encoding a breadth-first-search ( BFS ) tree rooted in the node ( Xu et al. , 2019 ) . Such embeddings can be used to predict node properties directly . As for edge and graph tasks , pooling the embeddings of nodes related to the structure is a prevailing method . Though node , edge , and graph tasks are the three most common graph representation learning tasks , properties of subgraphs are also worth predicting . Take company structure network as an example . The nodes are employees , and the edges between them represent cooperation relations . We want to predict the performance of a department , in other words , a subgraph in the network . Obviously , on the one hand , we need to consider the internal organization ( such as the collaboration within the department and the competence of individual employees ) . If the structure is disorganized or the employees are incompetent , we can expect the department to perform poorly . On the other hand , the external information of the department also deserves attention . A department is less likely to be productive if the company as a whole is facing bankruptcy . In contrast , close cooperation with ∗Corresponding author : Muhan Zhang other remarkable departments can be a sign of good performance . As illustrated by this example , a subgraph task is to predict the property of subgraphs in the whole graph . It needs to consider the topology both inside and outside the subgraph . It may also need to combine multi-level information of nodes , edges , higher-order substructures , and even the whole graph . Thus , a very general model is needed , and a natural idea is to extend ordinary GNNs to subgraph tasks . Figure 1 left shows a typical subgraph to predict . The target subgraph S is embedded in the whole graph and may have multiple connected components , and our task is to produce a subgraph representation , which can be used to predict properties of S. However , in experiments , we find that SubGNN ( Alsentzer et al. , 2020 ) , the current state-of-the-art method for subgraph tasks , only slightly outperforms plain GNNs which directly pool node embeddings within the subgraph as the subgraph representation . SubGNN replaces the message passing between nodes with a subgraph-level message passing framework and designs three channels . Each channel is further divided into an internal and a border module to aggregate subgraph features separately . Despite its performance , SubGNN is both space and time-consuming due to its lengthy precomputation . Furthermore , the units of message passing are subgraph patches sampled from the whole graph randomly , and there is no guarantee of the optimality of the samples , leading to high variance in performance and dubious robustness . Last but not least , the framework of SubGNN is overly complicated—many of its designs seem ad hoc or suboptimal , resulting in poor compatibility with recent advances in GNN research . Nevertheless , by comparing SubGNN with plain GNNs , we find that differentiating internal and external topology is crucial for subgraph tasks . Inspired by this insight , we introduce a max-zero-one labeling trick ( Zhang et al. , 2021 ) , which explicitly marks whether a node is within a subgraph or not , to augment GNNs and show that plain GNNs with this labeling trick are superior to SubGNN . Here we give a brief introduction to labeling trick . First proposed by Zhang et al . ( 2021 ) , labeling trick is a theoretical framework for using graph neural networks to produce multi-node representations , which show that producing expressive representations for high-order structures needs to capture the interaction among the different nodes within the structure . This theory shows that directly aggregating node representations to represent high-order structures is not expressive enough , and labeling trick can aid this problem . In implementation , a labeling trick assigns a label to each node and combines the node features and the labels as the new input node features to GNNs . Labeling trick have achieved great successes on graph representation learning in previous works . For example , the state-of-the-art link prediction method SEAL ( Zhang & Chen , 2018 ) gains better performance with carefully designed labeling trick . IDGNN ( You et al. , 2021 ) differentiates one center node from others , and Distance Encoding ( Li et al. , 2020 ) uses the distance to the target nodes to label other nodes , both of which gain improved performance on node , edge , and graph tasks . In this work , we for the first time introduce labeling trick to subgraph problems , and design an expressive and scalable labeling trick called max-zero-one . Max-zero-one is the first labeling trick that enables jointly predicting a batch of structures within the same graph . Present work We propose GLASS ( GNN with LAbeling trickS for Subgraph ) , a novel and simple graph neural network for subgraph tasks . To the best of our knowledge , GLASS is the first subgraph representation learning method using the ordinary message passing framework and a labeling trick . GLASS is more scalable , more expressive , and easier to implement and extend than the existing state-of-the-art method . Theoretically , we prove that GLASS is more expressive than plain GNNs , and can capture a range of important subgraph properties defined in SubGNN like density , cut ratio , border , positions , etc . Experiments on eight datasets show that GLASS achieves new state-of-theart performance . On synthetic datasets , GLASS with a single message passing layer beats SubGNN with three carefully designed channels by up to 48.6 % , illustrating the expressive power of nodelevel message passing augmented by labeling trick for subgraph tasks . On real-world datasets , GLASS also outperforms the strongest baseline SubGNN by up to 14.3 % . Moreover , training a GLASS model on average only takes 26 % time needed to train a SubGNN . With such a powerful model , we also prove the effectiveness of labeling trick on subgraph tasks . 2 RELATED WORK . Subgraph Representation Learning . Though some works have utilized subgraphs to perform other graph representation tasks ( Sun et al. , 2021 ; Wang et al. , 2021 ; Huang & Zitnik , 2020 ) or studied some specific tasks involving subgraphs ( Bordes et al. , 2014 ; Meng et al. , 2018 ; Ying et al. , 2020 ) , few works have studied the general subgraph representation learning problem . Alsentzer et al . ( 2020 ) introduced the problem formally and proposed SubGNN ( Alsentzer et al. , 2020 ) , the current state-of-the-art method , which samples patches from the whole graph and aggregates their features to produce subgraph representations . Before that , Sub2Vec ( Adhikari et al. , 2018 ) , designed for graph classification and community detection , samples random walks in subgraphs and feeds them to the language model Paragraph2vec ( Le & Mikolov , 2014 ) to generate embeddings for subgraphs . Labeling trick . SEAL ( Zhang & Chen , 2018 ) first introduces labeling trick to graph representation learning and applies them to link prediction . IDGNN ( You et al. , 2021 ) uses different message passing parameters for a target node and the other nodes , which is essentially a labeling trick assigning different labels to the target node and others . Distance Encoding ( Li et al. , 2020 ) uses distances to target nodes as node labels . Zhang et al . ( 2021 ) give a theoretical analysis of labeling trick and prove that they can produce the most expressive representations for substructures with a GNN expressive enough . These previous methods ignore subgraph tasks and have poor scalability due to the relabeling for every target substructure to predict . Besides these deterministic labeling methods , rGIN ( Sato et al. , 2021 ) assigns a random vector to each nodes as its label in each forward process . Similarly , GNN-RNI ( Abboud et al. , 2021 ) randomly initializes node embeddings and can approximate any functions mapping graphs to real numbers . Despite the theoretical power , random labels suffer from slow convergence and subpar performance . We also discuss other structural encoding methods in Appendix A.1 . Our GLASS is an application of labeling trick on subgraph tasks . Its success verifies the theory of using GNNs and labeling trick to produce multi-node representations . 3 PRELIMINARIES . Let G = ( V , E , X ) denote a graph with a finite node set V = { 1 , 2 , ... , n } , an edge set E ⊆ V × V and node feature matrix X , whose ith rowXi is the feature of node i. N ( v ) refers to the set of nodes adjacent to node v. S = ( VS , ES , XS ) is a subgraph of G if VS ⊆ V and ES ⊆ ( VS ×VS ) ∩E and XS is the stack of the rows of X corresponding to nodes in VS . In this paper , we focus on induced subgraphs , whose edge set ES = ( VS × VS ) ∩ E. Let S ⊆ G donate that S is a subgraph in G. Problem ( Subgraph Representation and Property Prediction ) . Given the whole graph G , its subgraphs S = { S1 , S2 , ... , Sn } and their target properties T = { tS1 , tS2 , ... , tSn } , the goal is to learn a representation vector hSi that can be used to predict tSi of Si . A Plain GNN for Subgraph Tasks . Message passing neural network ( MPNN ) ( Gilmer et al. , 2017 ) is a common framework of GNNs . A message passing layer aggregates embeddings from neighbors to update the representation of a node . The kth message passing layer can be formulated as follows . a ( k ) v = AGGREGATE ( k ) ( { h ( k−1 ) u |u ∈ N ( v ) } ) , ( 1 ) h ( k ) v = COMBINE ( k ) ( h ( k−1 ) v , a ( k ) v ) , ( 2 ) where h ( k ) v is the embedding of node v at the kth layer and h ( 0 ) v = Xv . The embeddings at the last layer can be used to predict node properties . As for edge or graph tasks , pooling the multiset of embeddings of nodes belonging to the edge or within the graph is a widely used method . Naturally , we can extend it to subgraphs , and the representation of a subgraph S can be learned by pooling the embeddings of nodes within the subgraph as follows , which we call a plain GNN . hS = READOUT ( { hu|u ∈ VS } ) . ( 3 )
In this paper, the authors propose GLASS, a GNN designed for subgraph tasks using labelling tricks. A simple zero-one trick can be used to differentiate nodes in and out of a target subgraphs. However, this would cause efficiency problem as different target subgraphs would require different labels. To fit the classic batch training, a batch of target subgraphs are used to label the nodes together. To resolve conflicts among subgraphs, a zero-max-one trick is proposed. GLASS is easier / intuitive to implement and more scalable. The zero-one trick version is also claimed to have more expressive power than plain GNNs and can capture the six properties in the state-of-the-art method SubGNN. Experiments have been conducted on both real-world and synthetic datasets with generally promising results.
SP:2a802a973b355896445f7af0af3d29fa95b15364
GLASS: GNN with Labeling Tricks for Subgraph Representation Learning
1 INTRODUCTION . Graph is a natural tool for modeling objects with complex internal relationships , which is widely used in fields such as natural language processing ( Yao et al. , 2019 ) , biology ( Fout et al. , 2017 ) , and social network ( Chen et al. , 2018 ) . Among the various graph representation learning methods , GNN has achieved state-of-the-art performance on almost all sorts of tasks . Existing GNNs are mainly designed for node ( Dabhi & Parmar , 2020 ; Chen et al. , 2020 ) , edge ( Singh et al. , 2021 ; Galkin et al. , 2021 ) and whole graph ( Ying et al. , 2021b ; Yang et al. , 2020 ) property prediction tasks . An ordinary GNN produces embeddings of a node by aggregating the features from the ( multi-hop ) neighbors of the node , which is equivalent to encoding a breadth-first-search ( BFS ) tree rooted in the node ( Xu et al. , 2019 ) . Such embeddings can be used to predict node properties directly . As for edge and graph tasks , pooling the embeddings of nodes related to the structure is a prevailing method . Though node , edge , and graph tasks are the three most common graph representation learning tasks , properties of subgraphs are also worth predicting . Take company structure network as an example . The nodes are employees , and the edges between them represent cooperation relations . We want to predict the performance of a department , in other words , a subgraph in the network . Obviously , on the one hand , we need to consider the internal organization ( such as the collaboration within the department and the competence of individual employees ) . If the structure is disorganized or the employees are incompetent , we can expect the department to perform poorly . On the other hand , the external information of the department also deserves attention . A department is less likely to be productive if the company as a whole is facing bankruptcy . In contrast , close cooperation with ∗Corresponding author : Muhan Zhang other remarkable departments can be a sign of good performance . As illustrated by this example , a subgraph task is to predict the property of subgraphs in the whole graph . It needs to consider the topology both inside and outside the subgraph . It may also need to combine multi-level information of nodes , edges , higher-order substructures , and even the whole graph . Thus , a very general model is needed , and a natural idea is to extend ordinary GNNs to subgraph tasks . Figure 1 left shows a typical subgraph to predict . The target subgraph S is embedded in the whole graph and may have multiple connected components , and our task is to produce a subgraph representation , which can be used to predict properties of S. However , in experiments , we find that SubGNN ( Alsentzer et al. , 2020 ) , the current state-of-the-art method for subgraph tasks , only slightly outperforms plain GNNs which directly pool node embeddings within the subgraph as the subgraph representation . SubGNN replaces the message passing between nodes with a subgraph-level message passing framework and designs three channels . Each channel is further divided into an internal and a border module to aggregate subgraph features separately . Despite its performance , SubGNN is both space and time-consuming due to its lengthy precomputation . Furthermore , the units of message passing are subgraph patches sampled from the whole graph randomly , and there is no guarantee of the optimality of the samples , leading to high variance in performance and dubious robustness . Last but not least , the framework of SubGNN is overly complicated—many of its designs seem ad hoc or suboptimal , resulting in poor compatibility with recent advances in GNN research . Nevertheless , by comparing SubGNN with plain GNNs , we find that differentiating internal and external topology is crucial for subgraph tasks . Inspired by this insight , we introduce a max-zero-one labeling trick ( Zhang et al. , 2021 ) , which explicitly marks whether a node is within a subgraph or not , to augment GNNs and show that plain GNNs with this labeling trick are superior to SubGNN . Here we give a brief introduction to labeling trick . First proposed by Zhang et al . ( 2021 ) , labeling trick is a theoretical framework for using graph neural networks to produce multi-node representations , which show that producing expressive representations for high-order structures needs to capture the interaction among the different nodes within the structure . This theory shows that directly aggregating node representations to represent high-order structures is not expressive enough , and labeling trick can aid this problem . In implementation , a labeling trick assigns a label to each node and combines the node features and the labels as the new input node features to GNNs . Labeling trick have achieved great successes on graph representation learning in previous works . For example , the state-of-the-art link prediction method SEAL ( Zhang & Chen , 2018 ) gains better performance with carefully designed labeling trick . IDGNN ( You et al. , 2021 ) differentiates one center node from others , and Distance Encoding ( Li et al. , 2020 ) uses the distance to the target nodes to label other nodes , both of which gain improved performance on node , edge , and graph tasks . In this work , we for the first time introduce labeling trick to subgraph problems , and design an expressive and scalable labeling trick called max-zero-one . Max-zero-one is the first labeling trick that enables jointly predicting a batch of structures within the same graph . Present work We propose GLASS ( GNN with LAbeling trickS for Subgraph ) , a novel and simple graph neural network for subgraph tasks . To the best of our knowledge , GLASS is the first subgraph representation learning method using the ordinary message passing framework and a labeling trick . GLASS is more scalable , more expressive , and easier to implement and extend than the existing state-of-the-art method . Theoretically , we prove that GLASS is more expressive than plain GNNs , and can capture a range of important subgraph properties defined in SubGNN like density , cut ratio , border , positions , etc . Experiments on eight datasets show that GLASS achieves new state-of-theart performance . On synthetic datasets , GLASS with a single message passing layer beats SubGNN with three carefully designed channels by up to 48.6 % , illustrating the expressive power of nodelevel message passing augmented by labeling trick for subgraph tasks . On real-world datasets , GLASS also outperforms the strongest baseline SubGNN by up to 14.3 % . Moreover , training a GLASS model on average only takes 26 % time needed to train a SubGNN . With such a powerful model , we also prove the effectiveness of labeling trick on subgraph tasks . 2 RELATED WORK . Subgraph Representation Learning . Though some works have utilized subgraphs to perform other graph representation tasks ( Sun et al. , 2021 ; Wang et al. , 2021 ; Huang & Zitnik , 2020 ) or studied some specific tasks involving subgraphs ( Bordes et al. , 2014 ; Meng et al. , 2018 ; Ying et al. , 2020 ) , few works have studied the general subgraph representation learning problem . Alsentzer et al . ( 2020 ) introduced the problem formally and proposed SubGNN ( Alsentzer et al. , 2020 ) , the current state-of-the-art method , which samples patches from the whole graph and aggregates their features to produce subgraph representations . Before that , Sub2Vec ( Adhikari et al. , 2018 ) , designed for graph classification and community detection , samples random walks in subgraphs and feeds them to the language model Paragraph2vec ( Le & Mikolov , 2014 ) to generate embeddings for subgraphs . Labeling trick . SEAL ( Zhang & Chen , 2018 ) first introduces labeling trick to graph representation learning and applies them to link prediction . IDGNN ( You et al. , 2021 ) uses different message passing parameters for a target node and the other nodes , which is essentially a labeling trick assigning different labels to the target node and others . Distance Encoding ( Li et al. , 2020 ) uses distances to target nodes as node labels . Zhang et al . ( 2021 ) give a theoretical analysis of labeling trick and prove that they can produce the most expressive representations for substructures with a GNN expressive enough . These previous methods ignore subgraph tasks and have poor scalability due to the relabeling for every target substructure to predict . Besides these deterministic labeling methods , rGIN ( Sato et al. , 2021 ) assigns a random vector to each nodes as its label in each forward process . Similarly , GNN-RNI ( Abboud et al. , 2021 ) randomly initializes node embeddings and can approximate any functions mapping graphs to real numbers . Despite the theoretical power , random labels suffer from slow convergence and subpar performance . We also discuss other structural encoding methods in Appendix A.1 . Our GLASS is an application of labeling trick on subgraph tasks . Its success verifies the theory of using GNNs and labeling trick to produce multi-node representations . 3 PRELIMINARIES . Let G = ( V , E , X ) denote a graph with a finite node set V = { 1 , 2 , ... , n } , an edge set E ⊆ V × V and node feature matrix X , whose ith rowXi is the feature of node i. N ( v ) refers to the set of nodes adjacent to node v. S = ( VS , ES , XS ) is a subgraph of G if VS ⊆ V and ES ⊆ ( VS ×VS ) ∩E and XS is the stack of the rows of X corresponding to nodes in VS . In this paper , we focus on induced subgraphs , whose edge set ES = ( VS × VS ) ∩ E. Let S ⊆ G donate that S is a subgraph in G. Problem ( Subgraph Representation and Property Prediction ) . Given the whole graph G , its subgraphs S = { S1 , S2 , ... , Sn } and their target properties T = { tS1 , tS2 , ... , tSn } , the goal is to learn a representation vector hSi that can be used to predict tSi of Si . A Plain GNN for Subgraph Tasks . Message passing neural network ( MPNN ) ( Gilmer et al. , 2017 ) is a common framework of GNNs . A message passing layer aggregates embeddings from neighbors to update the representation of a node . The kth message passing layer can be formulated as follows . a ( k ) v = AGGREGATE ( k ) ( { h ( k−1 ) u |u ∈ N ( v ) } ) , ( 1 ) h ( k ) v = COMBINE ( k ) ( h ( k−1 ) v , a ( k ) v ) , ( 2 ) where h ( k ) v is the embedding of node v at the kth layer and h ( 0 ) v = Xv . The embeddings at the last layer can be used to predict node properties . As for edge or graph tasks , pooling the multiset of embeddings of nodes belonging to the edge or within the graph is a widely used method . Naturally , we can extend it to subgraphs , and the representation of a subgraph S can be learned by pooling the embeddings of nodes within the subgraph as follows , which we call a plain GNN . hS = READOUT ( { hu|u ∈ VS } ) . ( 3 )
This paper focuses on predicting the properties of subgraphs in the whole graph. The authors propose a labeling trick to help GNN distinguish nodes inside and outside the subgraph. The authors rigorously analyze the effectiveness of the proposed method. Experiments demonstrate that the proposed method achieves state-of-the-art performance on several benchmarks.
SP:2a802a973b355896445f7af0af3d29fa95b15364
GLASS: GNN with Labeling Tricks for Subgraph Representation Learning
1 INTRODUCTION . Graph is a natural tool for modeling objects with complex internal relationships , which is widely used in fields such as natural language processing ( Yao et al. , 2019 ) , biology ( Fout et al. , 2017 ) , and social network ( Chen et al. , 2018 ) . Among the various graph representation learning methods , GNN has achieved state-of-the-art performance on almost all sorts of tasks . Existing GNNs are mainly designed for node ( Dabhi & Parmar , 2020 ; Chen et al. , 2020 ) , edge ( Singh et al. , 2021 ; Galkin et al. , 2021 ) and whole graph ( Ying et al. , 2021b ; Yang et al. , 2020 ) property prediction tasks . An ordinary GNN produces embeddings of a node by aggregating the features from the ( multi-hop ) neighbors of the node , which is equivalent to encoding a breadth-first-search ( BFS ) tree rooted in the node ( Xu et al. , 2019 ) . Such embeddings can be used to predict node properties directly . As for edge and graph tasks , pooling the embeddings of nodes related to the structure is a prevailing method . Though node , edge , and graph tasks are the three most common graph representation learning tasks , properties of subgraphs are also worth predicting . Take company structure network as an example . The nodes are employees , and the edges between them represent cooperation relations . We want to predict the performance of a department , in other words , a subgraph in the network . Obviously , on the one hand , we need to consider the internal organization ( such as the collaboration within the department and the competence of individual employees ) . If the structure is disorganized or the employees are incompetent , we can expect the department to perform poorly . On the other hand , the external information of the department also deserves attention . A department is less likely to be productive if the company as a whole is facing bankruptcy . In contrast , close cooperation with ∗Corresponding author : Muhan Zhang other remarkable departments can be a sign of good performance . As illustrated by this example , a subgraph task is to predict the property of subgraphs in the whole graph . It needs to consider the topology both inside and outside the subgraph . It may also need to combine multi-level information of nodes , edges , higher-order substructures , and even the whole graph . Thus , a very general model is needed , and a natural idea is to extend ordinary GNNs to subgraph tasks . Figure 1 left shows a typical subgraph to predict . The target subgraph S is embedded in the whole graph and may have multiple connected components , and our task is to produce a subgraph representation , which can be used to predict properties of S. However , in experiments , we find that SubGNN ( Alsentzer et al. , 2020 ) , the current state-of-the-art method for subgraph tasks , only slightly outperforms plain GNNs which directly pool node embeddings within the subgraph as the subgraph representation . SubGNN replaces the message passing between nodes with a subgraph-level message passing framework and designs three channels . Each channel is further divided into an internal and a border module to aggregate subgraph features separately . Despite its performance , SubGNN is both space and time-consuming due to its lengthy precomputation . Furthermore , the units of message passing are subgraph patches sampled from the whole graph randomly , and there is no guarantee of the optimality of the samples , leading to high variance in performance and dubious robustness . Last but not least , the framework of SubGNN is overly complicated—many of its designs seem ad hoc or suboptimal , resulting in poor compatibility with recent advances in GNN research . Nevertheless , by comparing SubGNN with plain GNNs , we find that differentiating internal and external topology is crucial for subgraph tasks . Inspired by this insight , we introduce a max-zero-one labeling trick ( Zhang et al. , 2021 ) , which explicitly marks whether a node is within a subgraph or not , to augment GNNs and show that plain GNNs with this labeling trick are superior to SubGNN . Here we give a brief introduction to labeling trick . First proposed by Zhang et al . ( 2021 ) , labeling trick is a theoretical framework for using graph neural networks to produce multi-node representations , which show that producing expressive representations for high-order structures needs to capture the interaction among the different nodes within the structure . This theory shows that directly aggregating node representations to represent high-order structures is not expressive enough , and labeling trick can aid this problem . In implementation , a labeling trick assigns a label to each node and combines the node features and the labels as the new input node features to GNNs . Labeling trick have achieved great successes on graph representation learning in previous works . For example , the state-of-the-art link prediction method SEAL ( Zhang & Chen , 2018 ) gains better performance with carefully designed labeling trick . IDGNN ( You et al. , 2021 ) differentiates one center node from others , and Distance Encoding ( Li et al. , 2020 ) uses the distance to the target nodes to label other nodes , both of which gain improved performance on node , edge , and graph tasks . In this work , we for the first time introduce labeling trick to subgraph problems , and design an expressive and scalable labeling trick called max-zero-one . Max-zero-one is the first labeling trick that enables jointly predicting a batch of structures within the same graph . Present work We propose GLASS ( GNN with LAbeling trickS for Subgraph ) , a novel and simple graph neural network for subgraph tasks . To the best of our knowledge , GLASS is the first subgraph representation learning method using the ordinary message passing framework and a labeling trick . GLASS is more scalable , more expressive , and easier to implement and extend than the existing state-of-the-art method . Theoretically , we prove that GLASS is more expressive than plain GNNs , and can capture a range of important subgraph properties defined in SubGNN like density , cut ratio , border , positions , etc . Experiments on eight datasets show that GLASS achieves new state-of-theart performance . On synthetic datasets , GLASS with a single message passing layer beats SubGNN with three carefully designed channels by up to 48.6 % , illustrating the expressive power of nodelevel message passing augmented by labeling trick for subgraph tasks . On real-world datasets , GLASS also outperforms the strongest baseline SubGNN by up to 14.3 % . Moreover , training a GLASS model on average only takes 26 % time needed to train a SubGNN . With such a powerful model , we also prove the effectiveness of labeling trick on subgraph tasks . 2 RELATED WORK . Subgraph Representation Learning . Though some works have utilized subgraphs to perform other graph representation tasks ( Sun et al. , 2021 ; Wang et al. , 2021 ; Huang & Zitnik , 2020 ) or studied some specific tasks involving subgraphs ( Bordes et al. , 2014 ; Meng et al. , 2018 ; Ying et al. , 2020 ) , few works have studied the general subgraph representation learning problem . Alsentzer et al . ( 2020 ) introduced the problem formally and proposed SubGNN ( Alsentzer et al. , 2020 ) , the current state-of-the-art method , which samples patches from the whole graph and aggregates their features to produce subgraph representations . Before that , Sub2Vec ( Adhikari et al. , 2018 ) , designed for graph classification and community detection , samples random walks in subgraphs and feeds them to the language model Paragraph2vec ( Le & Mikolov , 2014 ) to generate embeddings for subgraphs . Labeling trick . SEAL ( Zhang & Chen , 2018 ) first introduces labeling trick to graph representation learning and applies them to link prediction . IDGNN ( You et al. , 2021 ) uses different message passing parameters for a target node and the other nodes , which is essentially a labeling trick assigning different labels to the target node and others . Distance Encoding ( Li et al. , 2020 ) uses distances to target nodes as node labels . Zhang et al . ( 2021 ) give a theoretical analysis of labeling trick and prove that they can produce the most expressive representations for substructures with a GNN expressive enough . These previous methods ignore subgraph tasks and have poor scalability due to the relabeling for every target substructure to predict . Besides these deterministic labeling methods , rGIN ( Sato et al. , 2021 ) assigns a random vector to each nodes as its label in each forward process . Similarly , GNN-RNI ( Abboud et al. , 2021 ) randomly initializes node embeddings and can approximate any functions mapping graphs to real numbers . Despite the theoretical power , random labels suffer from slow convergence and subpar performance . We also discuss other structural encoding methods in Appendix A.1 . Our GLASS is an application of labeling trick on subgraph tasks . Its success verifies the theory of using GNNs and labeling trick to produce multi-node representations . 3 PRELIMINARIES . Let G = ( V , E , X ) denote a graph with a finite node set V = { 1 , 2 , ... , n } , an edge set E ⊆ V × V and node feature matrix X , whose ith rowXi is the feature of node i. N ( v ) refers to the set of nodes adjacent to node v. S = ( VS , ES , XS ) is a subgraph of G if VS ⊆ V and ES ⊆ ( VS ×VS ) ∩E and XS is the stack of the rows of X corresponding to nodes in VS . In this paper , we focus on induced subgraphs , whose edge set ES = ( VS × VS ) ∩ E. Let S ⊆ G donate that S is a subgraph in G. Problem ( Subgraph Representation and Property Prediction ) . Given the whole graph G , its subgraphs S = { S1 , S2 , ... , Sn } and their target properties T = { tS1 , tS2 , ... , tSn } , the goal is to learn a representation vector hSi that can be used to predict tSi of Si . A Plain GNN for Subgraph Tasks . Message passing neural network ( MPNN ) ( Gilmer et al. , 2017 ) is a common framework of GNNs . A message passing layer aggregates embeddings from neighbors to update the representation of a node . The kth message passing layer can be formulated as follows . a ( k ) v = AGGREGATE ( k ) ( { h ( k−1 ) u |u ∈ N ( v ) } ) , ( 1 ) h ( k ) v = COMBINE ( k ) ( h ( k−1 ) v , a ( k ) v ) , ( 2 ) where h ( k ) v is the embedding of node v at the kth layer and h ( 0 ) v = Xv . The embeddings at the last layer can be used to predict node properties . As for edge or graph tasks , pooling the multiset of embeddings of nodes belonging to the edge or within the graph is a widely used method . Naturally , we can extend it to subgraphs , and the representation of a subgraph S can be learned by pooling the embeddings of nodes within the subgraph as follows , which we call a plain GNN . hS = READOUT ( { hu|u ∈ VS } ) . ( 3 )
The paper proposes a simple GNN approach to predict labels of subgraphs. In experiments, it works better than an existing approach. Complementary they show their approach can predict characteristics of a graph such as cut ratio. Additionally, they augment the loss with self-supervised losses of predicting node, edge, and subgraph level information.
SP:2a802a973b355896445f7af0af3d29fa95b15364
R4D: Utilizing Reference Objects for Long-Range Distance Estimation
1 INTRODUCTION Estimating the distances of objects from the vehicle is crucial for several autonomous driving tasks , including lane changing , route planning , speed adjustment , collision avoidance , to name a few . Although existing methods and datasets focus on short-range objects , knowing the distance of long-range objects — objects beyond a typical LiDAR range of∼80 meters ( as shown in Figure 1 ) — is necessary for freeway driving , heavy-duty truck driving , and wet road driving . Based on the US Department of Transportation ( Blanco & Hankey , 2005 ) , on rural highways with a standard speed limit of 65 miles/h , it takes ∼145 meters for a passenger vehicle to come to a complete stop in an emergency , greatly exceeding the typical LiDAR sensing range . The required stopping distance grows significantly with a heavy load truck or in bad road conditions such as snow , ice , or rain . For example , the stopping distance increases from 145 meters to 183 meters and 278 meters for trucking and wet road driving , respec- tively ( Administration , 2016 ; Blanco & Hankey , 2005 ) . In addition , given that harsh and sudden breaking on freeways is unsafe , it remains critical to estimate the distance of objects beyond the minimum required stopping distance in order to provide enough time for a gradual slow-down or lane change . Therefore , to allow sufficient time for an appropriate reaction and to ensure safety , autonomous driving systems are required to estimate the distance to long-range objects . We name this critical but underexplored task as Long-Range Distance Estimation . Concretely , given the short-range LiDAR signal and the camera image , the distances of long-range objects ( beyond LiDAR range ) are expected as output . Following conventions , the distance is measured between the camera and the object center along the camera ’ s optical axis ( Gökçe et al. , 2015 ; Haseeb et al. , 2018 ; Zhu & Fang , 2019 ) . We discuss more about making design choices for our task in the related work . For this new task , we present pseudo long-range KITTI dataset and anonymous internal long-range dataset . Since KITTI ( Geiger et al. , 2013 ) do not provide ground-truth distance for long-range objects , the pseudo long-range KITTI dataset is a derived dataset by removing LiDAR points beyond 40 meters and considering the objects beyond 40 meters as target . More importantly , we build a large scale dataset with annotated real long-range objects ( from 80 to 300 meters ) . In summary , with different definition of “ long-range ” ( either beyond 40 or 80 meters ) , both datasets include LiDAR points , camera images , and distance labels for long-range objects . Neither LiDAR nor camera alone solves this long-range distance estimation problem to the desired accuracy . Most existing LiDAR technologies do not meet long-range sensing requirements . According to the Waymo and KITTI self-driving car datasets , the maximum LiDAR range is only around 80 meters , which falls short of the range required for the aforementioned scenarios . Even though some advanced LiDAR systems claim to achieve a longer sensing range , e.g. , Waymo ’ s 5th generation LiDAR system ( Jeyachandran , 2020 ) and Velodyne Alpha PrimeTM ( VelodyneLidar , 2021 ) which reach up to 300 meters , LiDAR points are sparse at long-range and , thus , more likely to be occluded . Therefore , LiDAR alone is not enough to cover all safety-critical self-driving car applications . Cameras , on the other hand , sense objects at a longer range and capture rich semantic information such as object appearance , geometry , and contextual hints . However , they do not , in and of themselves , provide depth information . Classical geometry-based algorithms could estimate the distance of canonical objects ( e.g. , sedans , trucks ) based on their pixel sizes in the camera image ( Criminisi et al. , 2000 ; Tuohy et al. , 2010 ; Gökçe et al. , 2015 ; Haseeb et al. , 2018 ; Qi et al. , 2019 ) . However , these approaches yield inaccurate results on long-range objects due to errors in size estimation . Appearance-based methods ( Song et al. , 2020 ; Zhu & Fang , 2019 ) give unsatisfactory results on long-range objects . Such methods rely on a single appearance cue to estimate the distance , overlooking context or other relevant signals in the scene . At long-range , objects are visually small thus produce less informative appearance features . Although neither LiDAR nor camera alone can solve this problem , these two signals provide complementary cues for long-range distance estimation . In this paper , we propose R4D , a method to utilize reference objects with known and accurate distances for long-range distance estimation ( R4D ) . The main motivation behind our approach lies in theories of human perception from cognitive science : humans often estimate the distance of an object relative to other reference points or objects ( Granrud et al. , 1984 ) . Specifically , we train a model to localize a long-range object ( target ) given references with known distances . We represent the target object and references as a graph . As shown in Figure 2 , we define objects as nodes , with edges connecting the target to the reference objects . The reference information is propagated to the long-range target object by extracting target-reference ( Tar-Ref ) embeddings . R4D then feeds all target-reference embeddings to an attention module which fuses information from different references , by weighing their relative importance and combining them into one distance prediction . Experiments on the pseudo long-range KITTI and anonymous internal long-range datasets show that R4D significantly improves the distance estimation and achieves state-of-the-art long-range localization results . For example , on the anonymous internal long-range dataset , with R4D , the distances of 8.9 % more vehicles ( from 53.4 % to 62.3 % ) are predicted with a relative distance error below 10 % . By conducting experiments on images captured at different times of the day , e.g. , train on daytime and test on nighttime images , R4D also shows stronger robustness against domain changes . To summarize , our contributions are three-fold . ( 1 ) We propose a critical but underexplored task Long-Range Distance Estimation . ( 2 ) We present two datasets , pseudo long-range KITTI dataset and anonymous internal long-range dataset . To facilitate future research , the datasets will be made publicly available . ( 3 ) We develop R4D , the first framework to accurately estimate the distance of long-range objects by using references with known distances . 2 RELATED WORK . In this section , we discuss the related tasks and the detailed design choices of our proposed task . Monocular distance estimation . Estimating the distance of objects from an RGB image ( i.e. , monocular distance estimation ) is a popular computer vision topic . More than a decade ago , researchers designed geometry-based algorithms to estimate object distances . For example , Tuohy et al . ( 2010 ) use inverted perspective mapping ( IPM ) to convert an image to the bird ’ s eye view for estimating distances . Learning-based methods were later proposed ( Qi et al. , 2019 ; Song et al. , 2020 ) . For example , SVR ( Gökçe et al. , 2015 ) and DisNet ( Haseeb et al. , 2018 ) take the pixel height and width of an object as input and estimate object distance by using support vector regression ( Drucker et al. , 1997 ) and multi-layer perceptron ( MLP ) . However , such methods are subject to errors in object size estimation ( Zhu & Fang , 2019 ) , which can be even more pronounced for longrange objects . Zhu & Fang ( 2019 ) developed an end-to-end distance estimator with a Convolutional Neural Network ( CNN ) feature extractor . Specifically , given an RGB image and object bounding boxes , the model extracts per-object embeddings with a CNN and ROI pooling operator ( Girshick , 2015 ) , and then predicts a distance for each object . As previously mentioned , this method relies heavily on object appearance , which is a less informative cue for long-range objects . Another related research topic is monocular per-pixel depth estimation . Eigen et al . ( 2014 ) ; Garg et al . ( 2016 ) ; Godard et al . ( 2019 ) ; Lee & Kim ( 2019 ) ; Liu et al . ( 2015 ) ; Shu et al . ( 2020 ) propose to predict dense depth maps given RGB images . For example , Lee & Kim ( 2019 ) generate multiresolution relative depth maps to construct the final depth map . However , these methods can be resource-intensive and , therefore , difficult to incorporate within a latency-sensitive system such as autonomous driving ( Zhu & Fang , 2019 ) . In addition , it is non-trivial to translate a depth map into per-object distance estimates due to occlusions , looseness of bounding boxes , etc . Long-range depth sensing . In addition , other approaches such as stereo cameras and Radar have been used to sense objects at long-range . Stereo camera systems simulate human binocular vision and use multiple cameras to create stereo-pairs and perceive depth ( Khamis et al. , 2018 ; Poggi et al. , 2019 ) . However , stereo vision systems have a few limitations : they are difficult to calibrate , are sensitive to vibrations ( Zhang et al. , 2020 ) , and require a special hardware setup . In contrast , R4D does not need special hardware and works with existing sensors present on most autonomous vehicles , such as standalone camera and LiDAR . Radar , on the other hand , uses radio waves to determine the range , angle , and velocity of objects . However , due to its limited angular resolution ( Scheiner et al. , 2020 ) , it is difficult for Radar to accurately localize long-range objects . Monocular 3D object detection . Monocular 3D object detection aims to detect all objects in an image by predicting a 3D bounding box for each of them , e.g. , MonoPair ( Chen et al. , 2020 ) . Besides distance ( from the target object to the autonomous vehicle ) , the monocular 3D object detector also predicts object size . For short-range vehicles , both object distance and object size are critical for selfdriving tasks , such as route planning , collision avoidance , and lane changing . However , for longrange vehicles , the distance is significantly larger than object size ( e.g. , 300 meters vs. 2 meters ) , thus the object size is less critical compared to the distance under the real-world scenario . Moreover , predicting the object size increases the latency and the complexity of the model . Therefore , our task focuses on estimating the distance of long-range objects . 3 METHODOLOGY Fused Embedding ( 1⨉C ) Motivated by the observation that humans estimate the distance of an object relative to other references ( Granrud et al. , 1984 ) , we propose R4D , a method utilizing Reference objects For long-range Distance estimation . References can be any combination of objects or points with known and accurate distances to the autonomous vehicle , such as LiDAR detections , objects detected by other sensors , map features , etc . We represent the target object and references as a graph shown in the “ Raw Inputs ” dashed box in Figure 2 . The target object and its references are nodes in this graph . Between a pair of target and reference objects , an edge is built to encode their pairwise relationship . The detailed architecture is illustrated in Figure 3 . To model the target-reference pairwise relationship , we propose to extract union embeddings and geo-distance embeddings which encode visual and geometry relationships , respectively ( Section 3.1 ) . Then , inspired by the intuition that reference objects are not equally important , we introduce an attention module in Sec- tion 3.2 to selectively aggregate pairwise relationships . Finally , R4D is trained with an auxiliary supervision : the relative distances between the target and its references , as explained in Section 3.3 . In our setup , and without loss of generality , we use a monocular camera as the main sensor for detecting long-range target objects , and adopt LiDAR detected short-range objects as references . It is worthy noting that R4D is not specifically designed for LiDAR or monocular images and is readily extended to other sensors and references .
This paper proposes to utilize camera images to further increase the perception capabilities for self-driving vehicles, especially in long-range settings. The paper builds on top of the assumption that there exist objects with accurate distance information. Then, pairwise relationships can be established between such objects and the anchoring objects. By formulating such relationships as a graph, distances can be better estimated for long-range objects.
SP:6962df9f707e1fd4fbb4f25fb46c6a42da047c76
R4D: Utilizing Reference Objects for Long-Range Distance Estimation
1 INTRODUCTION Estimating the distances of objects from the vehicle is crucial for several autonomous driving tasks , including lane changing , route planning , speed adjustment , collision avoidance , to name a few . Although existing methods and datasets focus on short-range objects , knowing the distance of long-range objects — objects beyond a typical LiDAR range of∼80 meters ( as shown in Figure 1 ) — is necessary for freeway driving , heavy-duty truck driving , and wet road driving . Based on the US Department of Transportation ( Blanco & Hankey , 2005 ) , on rural highways with a standard speed limit of 65 miles/h , it takes ∼145 meters for a passenger vehicle to come to a complete stop in an emergency , greatly exceeding the typical LiDAR sensing range . The required stopping distance grows significantly with a heavy load truck or in bad road conditions such as snow , ice , or rain . For example , the stopping distance increases from 145 meters to 183 meters and 278 meters for trucking and wet road driving , respec- tively ( Administration , 2016 ; Blanco & Hankey , 2005 ) . In addition , given that harsh and sudden breaking on freeways is unsafe , it remains critical to estimate the distance of objects beyond the minimum required stopping distance in order to provide enough time for a gradual slow-down or lane change . Therefore , to allow sufficient time for an appropriate reaction and to ensure safety , autonomous driving systems are required to estimate the distance to long-range objects . We name this critical but underexplored task as Long-Range Distance Estimation . Concretely , given the short-range LiDAR signal and the camera image , the distances of long-range objects ( beyond LiDAR range ) are expected as output . Following conventions , the distance is measured between the camera and the object center along the camera ’ s optical axis ( Gökçe et al. , 2015 ; Haseeb et al. , 2018 ; Zhu & Fang , 2019 ) . We discuss more about making design choices for our task in the related work . For this new task , we present pseudo long-range KITTI dataset and anonymous internal long-range dataset . Since KITTI ( Geiger et al. , 2013 ) do not provide ground-truth distance for long-range objects , the pseudo long-range KITTI dataset is a derived dataset by removing LiDAR points beyond 40 meters and considering the objects beyond 40 meters as target . More importantly , we build a large scale dataset with annotated real long-range objects ( from 80 to 300 meters ) . In summary , with different definition of “ long-range ” ( either beyond 40 or 80 meters ) , both datasets include LiDAR points , camera images , and distance labels for long-range objects . Neither LiDAR nor camera alone solves this long-range distance estimation problem to the desired accuracy . Most existing LiDAR technologies do not meet long-range sensing requirements . According to the Waymo and KITTI self-driving car datasets , the maximum LiDAR range is only around 80 meters , which falls short of the range required for the aforementioned scenarios . Even though some advanced LiDAR systems claim to achieve a longer sensing range , e.g. , Waymo ’ s 5th generation LiDAR system ( Jeyachandran , 2020 ) and Velodyne Alpha PrimeTM ( VelodyneLidar , 2021 ) which reach up to 300 meters , LiDAR points are sparse at long-range and , thus , more likely to be occluded . Therefore , LiDAR alone is not enough to cover all safety-critical self-driving car applications . Cameras , on the other hand , sense objects at a longer range and capture rich semantic information such as object appearance , geometry , and contextual hints . However , they do not , in and of themselves , provide depth information . Classical geometry-based algorithms could estimate the distance of canonical objects ( e.g. , sedans , trucks ) based on their pixel sizes in the camera image ( Criminisi et al. , 2000 ; Tuohy et al. , 2010 ; Gökçe et al. , 2015 ; Haseeb et al. , 2018 ; Qi et al. , 2019 ) . However , these approaches yield inaccurate results on long-range objects due to errors in size estimation . Appearance-based methods ( Song et al. , 2020 ; Zhu & Fang , 2019 ) give unsatisfactory results on long-range objects . Such methods rely on a single appearance cue to estimate the distance , overlooking context or other relevant signals in the scene . At long-range , objects are visually small thus produce less informative appearance features . Although neither LiDAR nor camera alone can solve this problem , these two signals provide complementary cues for long-range distance estimation . In this paper , we propose R4D , a method to utilize reference objects with known and accurate distances for long-range distance estimation ( R4D ) . The main motivation behind our approach lies in theories of human perception from cognitive science : humans often estimate the distance of an object relative to other reference points or objects ( Granrud et al. , 1984 ) . Specifically , we train a model to localize a long-range object ( target ) given references with known distances . We represent the target object and references as a graph . As shown in Figure 2 , we define objects as nodes , with edges connecting the target to the reference objects . The reference information is propagated to the long-range target object by extracting target-reference ( Tar-Ref ) embeddings . R4D then feeds all target-reference embeddings to an attention module which fuses information from different references , by weighing their relative importance and combining them into one distance prediction . Experiments on the pseudo long-range KITTI and anonymous internal long-range datasets show that R4D significantly improves the distance estimation and achieves state-of-the-art long-range localization results . For example , on the anonymous internal long-range dataset , with R4D , the distances of 8.9 % more vehicles ( from 53.4 % to 62.3 % ) are predicted with a relative distance error below 10 % . By conducting experiments on images captured at different times of the day , e.g. , train on daytime and test on nighttime images , R4D also shows stronger robustness against domain changes . To summarize , our contributions are three-fold . ( 1 ) We propose a critical but underexplored task Long-Range Distance Estimation . ( 2 ) We present two datasets , pseudo long-range KITTI dataset and anonymous internal long-range dataset . To facilitate future research , the datasets will be made publicly available . ( 3 ) We develop R4D , the first framework to accurately estimate the distance of long-range objects by using references with known distances . 2 RELATED WORK . In this section , we discuss the related tasks and the detailed design choices of our proposed task . Monocular distance estimation . Estimating the distance of objects from an RGB image ( i.e. , monocular distance estimation ) is a popular computer vision topic . More than a decade ago , researchers designed geometry-based algorithms to estimate object distances . For example , Tuohy et al . ( 2010 ) use inverted perspective mapping ( IPM ) to convert an image to the bird ’ s eye view for estimating distances . Learning-based methods were later proposed ( Qi et al. , 2019 ; Song et al. , 2020 ) . For example , SVR ( Gökçe et al. , 2015 ) and DisNet ( Haseeb et al. , 2018 ) take the pixel height and width of an object as input and estimate object distance by using support vector regression ( Drucker et al. , 1997 ) and multi-layer perceptron ( MLP ) . However , such methods are subject to errors in object size estimation ( Zhu & Fang , 2019 ) , which can be even more pronounced for longrange objects . Zhu & Fang ( 2019 ) developed an end-to-end distance estimator with a Convolutional Neural Network ( CNN ) feature extractor . Specifically , given an RGB image and object bounding boxes , the model extracts per-object embeddings with a CNN and ROI pooling operator ( Girshick , 2015 ) , and then predicts a distance for each object . As previously mentioned , this method relies heavily on object appearance , which is a less informative cue for long-range objects . Another related research topic is monocular per-pixel depth estimation . Eigen et al . ( 2014 ) ; Garg et al . ( 2016 ) ; Godard et al . ( 2019 ) ; Lee & Kim ( 2019 ) ; Liu et al . ( 2015 ) ; Shu et al . ( 2020 ) propose to predict dense depth maps given RGB images . For example , Lee & Kim ( 2019 ) generate multiresolution relative depth maps to construct the final depth map . However , these methods can be resource-intensive and , therefore , difficult to incorporate within a latency-sensitive system such as autonomous driving ( Zhu & Fang , 2019 ) . In addition , it is non-trivial to translate a depth map into per-object distance estimates due to occlusions , looseness of bounding boxes , etc . Long-range depth sensing . In addition , other approaches such as stereo cameras and Radar have been used to sense objects at long-range . Stereo camera systems simulate human binocular vision and use multiple cameras to create stereo-pairs and perceive depth ( Khamis et al. , 2018 ; Poggi et al. , 2019 ) . However , stereo vision systems have a few limitations : they are difficult to calibrate , are sensitive to vibrations ( Zhang et al. , 2020 ) , and require a special hardware setup . In contrast , R4D does not need special hardware and works with existing sensors present on most autonomous vehicles , such as standalone camera and LiDAR . Radar , on the other hand , uses radio waves to determine the range , angle , and velocity of objects . However , due to its limited angular resolution ( Scheiner et al. , 2020 ) , it is difficult for Radar to accurately localize long-range objects . Monocular 3D object detection . Monocular 3D object detection aims to detect all objects in an image by predicting a 3D bounding box for each of them , e.g. , MonoPair ( Chen et al. , 2020 ) . Besides distance ( from the target object to the autonomous vehicle ) , the monocular 3D object detector also predicts object size . For short-range vehicles , both object distance and object size are critical for selfdriving tasks , such as route planning , collision avoidance , and lane changing . However , for longrange vehicles , the distance is significantly larger than object size ( e.g. , 300 meters vs. 2 meters ) , thus the object size is less critical compared to the distance under the real-world scenario . Moreover , predicting the object size increases the latency and the complexity of the model . Therefore , our task focuses on estimating the distance of long-range objects . 3 METHODOLOGY Fused Embedding ( 1⨉C ) Motivated by the observation that humans estimate the distance of an object relative to other references ( Granrud et al. , 1984 ) , we propose R4D , a method utilizing Reference objects For long-range Distance estimation . References can be any combination of objects or points with known and accurate distances to the autonomous vehicle , such as LiDAR detections , objects detected by other sensors , map features , etc . We represent the target object and references as a graph shown in the “ Raw Inputs ” dashed box in Figure 2 . The target object and its references are nodes in this graph . Between a pair of target and reference objects , an edge is built to encode their pairwise relationship . The detailed architecture is illustrated in Figure 3 . To model the target-reference pairwise relationship , we propose to extract union embeddings and geo-distance embeddings which encode visual and geometry relationships , respectively ( Section 3.1 ) . Then , inspired by the intuition that reference objects are not equally important , we introduce an attention module in Sec- tion 3.2 to selectively aggregate pairwise relationships . Finally , R4D is trained with an auxiliary supervision : the relative distances between the target and its references , as explained in Section 3.3 . In our setup , and without loss of generality , we use a monocular camera as the main sensor for detecting long-range target objects , and adopt LiDAR detected short-range objects as references . It is worthy noting that R4D is not specifically designed for LiDAR or monocular images and is readily extended to other sensors and references .
The paper proposes a method for the task of long-range object distance estimation. It proposes a framework to predict long-range distance by modeling pairwise relationship between short-range objects and long-range objects. To evaluate the method, two datasets are also introduced. Experimental results are mainly compared to the baseline Zhu & Fang (2019) and several distance metrics are evaluated.
SP:6962df9f707e1fd4fbb4f25fb46c6a42da047c76
R4D: Utilizing Reference Objects for Long-Range Distance Estimation
1 INTRODUCTION Estimating the distances of objects from the vehicle is crucial for several autonomous driving tasks , including lane changing , route planning , speed adjustment , collision avoidance , to name a few . Although existing methods and datasets focus on short-range objects , knowing the distance of long-range objects — objects beyond a typical LiDAR range of∼80 meters ( as shown in Figure 1 ) — is necessary for freeway driving , heavy-duty truck driving , and wet road driving . Based on the US Department of Transportation ( Blanco & Hankey , 2005 ) , on rural highways with a standard speed limit of 65 miles/h , it takes ∼145 meters for a passenger vehicle to come to a complete stop in an emergency , greatly exceeding the typical LiDAR sensing range . The required stopping distance grows significantly with a heavy load truck or in bad road conditions such as snow , ice , or rain . For example , the stopping distance increases from 145 meters to 183 meters and 278 meters for trucking and wet road driving , respec- tively ( Administration , 2016 ; Blanco & Hankey , 2005 ) . In addition , given that harsh and sudden breaking on freeways is unsafe , it remains critical to estimate the distance of objects beyond the minimum required stopping distance in order to provide enough time for a gradual slow-down or lane change . Therefore , to allow sufficient time for an appropriate reaction and to ensure safety , autonomous driving systems are required to estimate the distance to long-range objects . We name this critical but underexplored task as Long-Range Distance Estimation . Concretely , given the short-range LiDAR signal and the camera image , the distances of long-range objects ( beyond LiDAR range ) are expected as output . Following conventions , the distance is measured between the camera and the object center along the camera ’ s optical axis ( Gökçe et al. , 2015 ; Haseeb et al. , 2018 ; Zhu & Fang , 2019 ) . We discuss more about making design choices for our task in the related work . For this new task , we present pseudo long-range KITTI dataset and anonymous internal long-range dataset . Since KITTI ( Geiger et al. , 2013 ) do not provide ground-truth distance for long-range objects , the pseudo long-range KITTI dataset is a derived dataset by removing LiDAR points beyond 40 meters and considering the objects beyond 40 meters as target . More importantly , we build a large scale dataset with annotated real long-range objects ( from 80 to 300 meters ) . In summary , with different definition of “ long-range ” ( either beyond 40 or 80 meters ) , both datasets include LiDAR points , camera images , and distance labels for long-range objects . Neither LiDAR nor camera alone solves this long-range distance estimation problem to the desired accuracy . Most existing LiDAR technologies do not meet long-range sensing requirements . According to the Waymo and KITTI self-driving car datasets , the maximum LiDAR range is only around 80 meters , which falls short of the range required for the aforementioned scenarios . Even though some advanced LiDAR systems claim to achieve a longer sensing range , e.g. , Waymo ’ s 5th generation LiDAR system ( Jeyachandran , 2020 ) and Velodyne Alpha PrimeTM ( VelodyneLidar , 2021 ) which reach up to 300 meters , LiDAR points are sparse at long-range and , thus , more likely to be occluded . Therefore , LiDAR alone is not enough to cover all safety-critical self-driving car applications . Cameras , on the other hand , sense objects at a longer range and capture rich semantic information such as object appearance , geometry , and contextual hints . However , they do not , in and of themselves , provide depth information . Classical geometry-based algorithms could estimate the distance of canonical objects ( e.g. , sedans , trucks ) based on their pixel sizes in the camera image ( Criminisi et al. , 2000 ; Tuohy et al. , 2010 ; Gökçe et al. , 2015 ; Haseeb et al. , 2018 ; Qi et al. , 2019 ) . However , these approaches yield inaccurate results on long-range objects due to errors in size estimation . Appearance-based methods ( Song et al. , 2020 ; Zhu & Fang , 2019 ) give unsatisfactory results on long-range objects . Such methods rely on a single appearance cue to estimate the distance , overlooking context or other relevant signals in the scene . At long-range , objects are visually small thus produce less informative appearance features . Although neither LiDAR nor camera alone can solve this problem , these two signals provide complementary cues for long-range distance estimation . In this paper , we propose R4D , a method to utilize reference objects with known and accurate distances for long-range distance estimation ( R4D ) . The main motivation behind our approach lies in theories of human perception from cognitive science : humans often estimate the distance of an object relative to other reference points or objects ( Granrud et al. , 1984 ) . Specifically , we train a model to localize a long-range object ( target ) given references with known distances . We represent the target object and references as a graph . As shown in Figure 2 , we define objects as nodes , with edges connecting the target to the reference objects . The reference information is propagated to the long-range target object by extracting target-reference ( Tar-Ref ) embeddings . R4D then feeds all target-reference embeddings to an attention module which fuses information from different references , by weighing their relative importance and combining them into one distance prediction . Experiments on the pseudo long-range KITTI and anonymous internal long-range datasets show that R4D significantly improves the distance estimation and achieves state-of-the-art long-range localization results . For example , on the anonymous internal long-range dataset , with R4D , the distances of 8.9 % more vehicles ( from 53.4 % to 62.3 % ) are predicted with a relative distance error below 10 % . By conducting experiments on images captured at different times of the day , e.g. , train on daytime and test on nighttime images , R4D also shows stronger robustness against domain changes . To summarize , our contributions are three-fold . ( 1 ) We propose a critical but underexplored task Long-Range Distance Estimation . ( 2 ) We present two datasets , pseudo long-range KITTI dataset and anonymous internal long-range dataset . To facilitate future research , the datasets will be made publicly available . ( 3 ) We develop R4D , the first framework to accurately estimate the distance of long-range objects by using references with known distances . 2 RELATED WORK . In this section , we discuss the related tasks and the detailed design choices of our proposed task . Monocular distance estimation . Estimating the distance of objects from an RGB image ( i.e. , monocular distance estimation ) is a popular computer vision topic . More than a decade ago , researchers designed geometry-based algorithms to estimate object distances . For example , Tuohy et al . ( 2010 ) use inverted perspective mapping ( IPM ) to convert an image to the bird ’ s eye view for estimating distances . Learning-based methods were later proposed ( Qi et al. , 2019 ; Song et al. , 2020 ) . For example , SVR ( Gökçe et al. , 2015 ) and DisNet ( Haseeb et al. , 2018 ) take the pixel height and width of an object as input and estimate object distance by using support vector regression ( Drucker et al. , 1997 ) and multi-layer perceptron ( MLP ) . However , such methods are subject to errors in object size estimation ( Zhu & Fang , 2019 ) , which can be even more pronounced for longrange objects . Zhu & Fang ( 2019 ) developed an end-to-end distance estimator with a Convolutional Neural Network ( CNN ) feature extractor . Specifically , given an RGB image and object bounding boxes , the model extracts per-object embeddings with a CNN and ROI pooling operator ( Girshick , 2015 ) , and then predicts a distance for each object . As previously mentioned , this method relies heavily on object appearance , which is a less informative cue for long-range objects . Another related research topic is monocular per-pixel depth estimation . Eigen et al . ( 2014 ) ; Garg et al . ( 2016 ) ; Godard et al . ( 2019 ) ; Lee & Kim ( 2019 ) ; Liu et al . ( 2015 ) ; Shu et al . ( 2020 ) propose to predict dense depth maps given RGB images . For example , Lee & Kim ( 2019 ) generate multiresolution relative depth maps to construct the final depth map . However , these methods can be resource-intensive and , therefore , difficult to incorporate within a latency-sensitive system such as autonomous driving ( Zhu & Fang , 2019 ) . In addition , it is non-trivial to translate a depth map into per-object distance estimates due to occlusions , looseness of bounding boxes , etc . Long-range depth sensing . In addition , other approaches such as stereo cameras and Radar have been used to sense objects at long-range . Stereo camera systems simulate human binocular vision and use multiple cameras to create stereo-pairs and perceive depth ( Khamis et al. , 2018 ; Poggi et al. , 2019 ) . However , stereo vision systems have a few limitations : they are difficult to calibrate , are sensitive to vibrations ( Zhang et al. , 2020 ) , and require a special hardware setup . In contrast , R4D does not need special hardware and works with existing sensors present on most autonomous vehicles , such as standalone camera and LiDAR . Radar , on the other hand , uses radio waves to determine the range , angle , and velocity of objects . However , due to its limited angular resolution ( Scheiner et al. , 2020 ) , it is difficult for Radar to accurately localize long-range objects . Monocular 3D object detection . Monocular 3D object detection aims to detect all objects in an image by predicting a 3D bounding box for each of them , e.g. , MonoPair ( Chen et al. , 2020 ) . Besides distance ( from the target object to the autonomous vehicle ) , the monocular 3D object detector also predicts object size . For short-range vehicles , both object distance and object size are critical for selfdriving tasks , such as route planning , collision avoidance , and lane changing . However , for longrange vehicles , the distance is significantly larger than object size ( e.g. , 300 meters vs. 2 meters ) , thus the object size is less critical compared to the distance under the real-world scenario . Moreover , predicting the object size increases the latency and the complexity of the model . Therefore , our task focuses on estimating the distance of long-range objects . 3 METHODOLOGY Fused Embedding ( 1⨉C ) Motivated by the observation that humans estimate the distance of an object relative to other references ( Granrud et al. , 1984 ) , we propose R4D , a method utilizing Reference objects For long-range Distance estimation . References can be any combination of objects or points with known and accurate distances to the autonomous vehicle , such as LiDAR detections , objects detected by other sensors , map features , etc . We represent the target object and references as a graph shown in the “ Raw Inputs ” dashed box in Figure 2 . The target object and its references are nodes in this graph . Between a pair of target and reference objects , an edge is built to encode their pairwise relationship . The detailed architecture is illustrated in Figure 3 . To model the target-reference pairwise relationship , we propose to extract union embeddings and geo-distance embeddings which encode visual and geometry relationships , respectively ( Section 3.1 ) . Then , inspired by the intuition that reference objects are not equally important , we introduce an attention module in Sec- tion 3.2 to selectively aggregate pairwise relationships . Finally , R4D is trained with an auxiliary supervision : the relative distances between the target and its references , as explained in Section 3.3 . In our setup , and without loss of generality , we use a monocular camera as the main sensor for detecting long-range target objects , and adopt LiDAR detected short-range objects as references . It is worthy noting that R4D is not specifically designed for LiDAR or monocular images and is readily extended to other sensors and references .
This paper addresses the task of Long-Range Distance Estimation. In particular, it proposes R4D, a framework to estimate the distance of long-range objects by utilizing the pair-wise relations between the reference objects (objects with known distance) and the target objects (objects of which the distance is to be estimated). In addition, the authors also present two new datasets, pseudo long-range KITTI dataset and anonymous internal long-range dataset, for this task. The evaluation results show that R4D achieves better results than the previous methods.
SP:6962df9f707e1fd4fbb4f25fb46c6a42da047c76
Metrics Matter: A Closer Look on Self-Paced Reinforcement Learning
1 INTRODUCTION . Reinforcement learning ( RL ) ( Sutton & Barto , 1998 ) has celebrated great successes as a framework for autonomous acquisition of desired behavior . With ever-increasing computational power , this framework and the algorithms developed under it have allowed to create learning agents capable of solving non-trivial long-horizon planning ( Mnih et al. , 2015 ; Silver et al. , 2017 ) and control tasks ( Akkaya et al. , 2019 ) . However , these successes have also highlighted the need for certain forms of regularization , such as leagues in the context of boardgames ( Silver et al. , 2017 ) , a gradual diversification of simulated training environments for robotic manipulation ( Akkaya et al. , 2019 ) or a tailored training pipeline in the context of humanoid control for soccer ( Liu et al. , 2021 ) . These regularizations help to overcome shortcomings of modern RL agents , such as poor exploratory behavior – a problem that is an active topic of research ( Bellemare et al. , 2016 ; Ghavamzadeh et al. , 2015 ; Machado et al. , 2020 ) . One can view aforementioned regularizations under the umbrella term of curriculum reinforcement learning ( Narvekar et al. , 2020 ) , where the idea is to avoid shortcomings of modern ( deep ) RL agents such as aforementioned poor exploration by learning on a tailored sequence of tasks . Such curricula can materialize in a variety of ways and are motivated from many perspectives in the literature ( Andrychowicz et al. , 2017 ; Florensa et al. , 2017 ; Wöhlke et al. , 2020 ) . Although the resulting curricula can often be interpreted as a sequence of task distributions , these sequences typically lack a formal connection to the reinforcement learning objective of maximizing the expected reward under a given target task distribution . In a recent line of work , Klink et al . ( 2021 ) proposed the idea of self-paced reinforcement learning ( SPRL ) , borrowing from the concept of self-paced learning that has been established in the supervised learning literature ( Kumar et al. , 2010 ; Jiang et al. , 2015 ; Meng et al. , 2017 ) . Klink et al . showed a connection between a regularized RL objective and a sequence of task distributions that trade-off between yielding high expected reward and tasks likely under the target distribution . This interpolant has , however , so far been restricted to Gaussian distributions ( Klink et al. , 2020a ; b ; 2021 ) . While successful in experimental evaluations , this Gaussian assumption clearly imposes a limitation on the flexibility of the curriculum and disconnects the algorithmic implementation from the established theory . This disconnect raises the question whether the observed performance of SPRL is due to the Gaussian approximation . Contribution : The key insight presented in this paper is that the Gaussian approximation of existing SPRL implementations is indeed important for their empirical performance . We show that ■ Parametric assumptions in SPRL hinder the learning performance in task spaces with nonGaussian target distributions . ■ SPRL can , however , fail to facilitate learning on the target task distributions when leaving these parametric assumptions behind . ■ Equipping SPRL with Wasserstein metrics allows for a flexible , particle-based representation of the task distribution that ensures a meaningful interpolation in aforementioned failure cases , providing higher performance . 2 RELATED WORK . The main focus of this work is on self-paced reinforcement learning ( SPRL , Klink et al . ( 2020a ; b ; 2021 ) ) that takes the concept of self-paced curriculum learning ( Kumar et al. , 2010 ) from supervisedto reinforcement learning ( RL ) . Opposed to supervised learning , where there is ongoing discussion about the mechanics of curricula and their effect in different situations ( Weinshall & Amir , 2020 ; Wu et al. , 2021 ) , the mechanics seem to be more agreed upon in RL . In RL , curricula improve learning performance of an agent by adapting the training environments to its proficiency , and with that e.g . bypass poor exploratory behaviour of non-proficient agents . Applications are by now widely spread and different terms have been established . Adaptive Domain Randomization ( Akkaya et al. , 2019 ) uses curricula to gradually diversify training parameters of a simulator to facilitate sim-to-real transfer . Unsupervised environment discovery ( Dennis et al. , 2020 ; Jiang et al. , 2021b ; a ) similarly aims to efficiently train an agent which is robust to variations in the environment . Automatic curriculum learning methods ( Florensa et al. , 2017 ; Sukhbaatar et al. , 2018 ; Florensa et al. , 2018 ; Portelas et al. , 2019 ; Zhang et al. , 2020 ; Racaniere et al. , 2020 ; Eimer et al. , 2021 ) , to which SPRL belongs to , particularly focus on improving the learning speed and/or performance of an agent on a set of desired tasks . Curricula are often generated as distributions that maximize a certain surrogate objective , such as learning progress ( Baranes & Oudeyer , 2010 ; Portelas et al. , 2019 ) , intermediate task difficulty ( Florensa et al. , 2018 ) , regret ( Jiang et al. , 2021b ) or disagreement between Q-functions ( Zhang et al. , 2020 ) . Curriculum generation can also be interpreted as a two-player game ( Sukhbaatar et al. , 2018 ) . The work by Jiang et al . ( 2021a ) even hints to a link between surrogate objectives and twoplayer games . Opposed to these interpretations , SPRL has been shown to perform an interpolation between task distributions by Klink et al . ( 2021 ) , allowing to formally relate the effect of SPRL to the concept of annealing in statistics ( Neal , 2001 ) and homotopic continuation methods in optimization ( Allgower & Georg , 2003 ) . We wish to add to this formal understanding of SPRL by investigating the interpolation that it produces more closely . As this investigation will lead us to the problem of optimal transport , we wish to point out important literature in this field . Dating back to the work by Monge in the 18th century , optimal transport has been understood as an important fundamental concept touching upon many fields in both theory and application ( Liu et al. , 2019 ; Peyré et al. , 2019 ; Chen et al. , 2021 ) . In probability theory , optimal transport translates to the so-called Wasserstein metric ( Kantorovich , 1942 ) that compares two distributions under a given metric on the sample space . From a computational perspective , entropy-regularized Wasserstein metrics ( Cuturi , 2013 ) have led to tangible speed-ups in computations revolving around optimal transport and are hence widely applied ( Feydy et al. , 2019 ) . 3 PRELIMINARIES . This section serves to introduce the necessary background on ( contextual ) RL , self-paced RL and optimal transport . 3.1 CONTEXTUAL REINFORCEMENT LEARNING . Contextual reinforcement learning ( Hallak et al. , 2015 ) can be seen as a conceptual extension to the ( single task ) reinforcement learning ( RL ) problem max π J ( π ) = max π Ep0 ( s0 ) , p ( st+1|st , at ) , π ( at|st ) [ ∞∑ t=0 γtr ( st , at ) ] , ( 1 ) which aims to maximize the above expected reward objective by finding an optimal a policy π : S×A 7→ R for a given MDP M = ⟨S , A , p , r , p0⟩ with initial state distribution p0 and transition dynamics p. Contextual RL extends this objective to a space of MDPs M ( c ) = ⟨S , A , pc , rc , p0 , c⟩ equipped with a distribution µ : C 7→ R over contextual variables c ∈ C max π J ( π , µ ) = max π Eµ ( c ) [ J ( π , c ) ] . ( 2 ) The policy π : S×C×A 7→ R is conditioned on the contextual parameter c. The distribution µ ( c ) encodes the tasks M ( c ) that the agent is expected to encounter . Objective J ( π , c ) in Eq . ( 2 ) corresponds to the objective J ( π ) in Eq . ( 1 ) where , however , the initial state distribution p0 , the transition dynamics p as well as the reward function r of M are replaced by their counterparts in M ( c ) . This contextual model of optimal decision making is well-suited for learning in multiple related tasks as is the case in multi-task ( Wilson et al. , 2007 ) , goal-conditioned ( Schaul et al. , 2015 ) or curriculum RL ( Narvekar et al. , 2020 ) . 3.2 SELF-PACED REINFORCEMENT LEARNING . Self-paced reinforcement learning ( SPRL ) has been introduced by Klink et al . ( 2020a ; b ; 2021 ) as a curriculum RL algorithm that alters the context distribution µ ( c ) in the contextual RL objective ( 2 ) to increase the learning performance of an agent and/or make it less susceptible to local optima of the objective function . SPRL computes a surrogate distribution p : C 7→ R under which to train the RL agent , i.e . optimize J ( π , p ) . This surrogate distribution is found by optimizing the KL divergence to the target distribution µ ( c ) subject to two constraints ( see Klink et al . ( 2021 , Section 8 ) ) min p DKL ( p ( c ) ∥ µ ( c ) ) s.t . J ( π , p ) ≥ δ DKL ( p ( c ) ∥ q ( c ) ) ≤ ϵ . ( 3 ) The distribution p ( c ) balances between tasks likely under the ( target ) distribution µ ( c ) and tasks in which the agent currently obtains large rewards . The KL divergence constraint w.r.t . the previous context distribution q ( c ) prevents large changes in p ( c ) during subsequent iterations , making the curriculum robust against errors in the estimates of the expected agent performance J ( π , c ) . A particularly interesting aspect of this work is that objective ( 3 ) can be interpreted to perform a specific interpolation between the distributions µ ( c ) , q ( c ) and a maximum entropy distribution pJ ( c ) ∝ exp ( ηJ ( π , c ) ) encoding high reward tasks . This interpolation is given by pα , η ( c ) ∝ µ ( c ) 1 1+α q ( c ) α 1+α exp ( ηJ ( π , c ) ) 1 1+α . ( 4 ) The two parameters α and η controlling the interpolation are the Lagrangian multipliers of the two constraints in objective ( 3 ) . So far , Klink et al . ( 2020a ; b ; 2021 ) restricted the distribution pα , η ( c ) to a Gaussian distributions pν ( c ) = N ( c|µ , Σ ) . In this case , optimizing ( 3 ) w.r.t . µ and Σ of pν corresponds to performing an I-projection of the analytic optimal distribution ( 4 ) to the Gaussian restriction , i.e . minimizing DKL ( pν ( c ) ∥ pα , η ( c ) ) w.r.t . ν . In this work , we are interested in investigating the distribution pα , η outside of this parametric restriction pν , i.e . truly employing the distribution ( 4 ) instead of its I-projection to a Gaussian .
The authors extend the Self-Paced Reinforcement Learning, which samples environment instances from a distribution that shifts from an (easy) starting to a (hard) target distribution. The algorithm has previously been shown to enable agents to solve hard environments. Previously, the target distribution was limited to a Gaussian, which the authors now extend using Wasserstein barycenters. This extension allows more elaborate target distributions, e.g. expert demonstrations.
SP:22c05e47528c628c8607626e945a4c5408c939c4
Metrics Matter: A Closer Look on Self-Paced Reinforcement Learning
1 INTRODUCTION . Reinforcement learning ( RL ) ( Sutton & Barto , 1998 ) has celebrated great successes as a framework for autonomous acquisition of desired behavior . With ever-increasing computational power , this framework and the algorithms developed under it have allowed to create learning agents capable of solving non-trivial long-horizon planning ( Mnih et al. , 2015 ; Silver et al. , 2017 ) and control tasks ( Akkaya et al. , 2019 ) . However , these successes have also highlighted the need for certain forms of regularization , such as leagues in the context of boardgames ( Silver et al. , 2017 ) , a gradual diversification of simulated training environments for robotic manipulation ( Akkaya et al. , 2019 ) or a tailored training pipeline in the context of humanoid control for soccer ( Liu et al. , 2021 ) . These regularizations help to overcome shortcomings of modern RL agents , such as poor exploratory behavior – a problem that is an active topic of research ( Bellemare et al. , 2016 ; Ghavamzadeh et al. , 2015 ; Machado et al. , 2020 ) . One can view aforementioned regularizations under the umbrella term of curriculum reinforcement learning ( Narvekar et al. , 2020 ) , where the idea is to avoid shortcomings of modern ( deep ) RL agents such as aforementioned poor exploration by learning on a tailored sequence of tasks . Such curricula can materialize in a variety of ways and are motivated from many perspectives in the literature ( Andrychowicz et al. , 2017 ; Florensa et al. , 2017 ; Wöhlke et al. , 2020 ) . Although the resulting curricula can often be interpreted as a sequence of task distributions , these sequences typically lack a formal connection to the reinforcement learning objective of maximizing the expected reward under a given target task distribution . In a recent line of work , Klink et al . ( 2021 ) proposed the idea of self-paced reinforcement learning ( SPRL ) , borrowing from the concept of self-paced learning that has been established in the supervised learning literature ( Kumar et al. , 2010 ; Jiang et al. , 2015 ; Meng et al. , 2017 ) . Klink et al . showed a connection between a regularized RL objective and a sequence of task distributions that trade-off between yielding high expected reward and tasks likely under the target distribution . This interpolant has , however , so far been restricted to Gaussian distributions ( Klink et al. , 2020a ; b ; 2021 ) . While successful in experimental evaluations , this Gaussian assumption clearly imposes a limitation on the flexibility of the curriculum and disconnects the algorithmic implementation from the established theory . This disconnect raises the question whether the observed performance of SPRL is due to the Gaussian approximation . Contribution : The key insight presented in this paper is that the Gaussian approximation of existing SPRL implementations is indeed important for their empirical performance . We show that ■ Parametric assumptions in SPRL hinder the learning performance in task spaces with nonGaussian target distributions . ■ SPRL can , however , fail to facilitate learning on the target task distributions when leaving these parametric assumptions behind . ■ Equipping SPRL with Wasserstein metrics allows for a flexible , particle-based representation of the task distribution that ensures a meaningful interpolation in aforementioned failure cases , providing higher performance . 2 RELATED WORK . The main focus of this work is on self-paced reinforcement learning ( SPRL , Klink et al . ( 2020a ; b ; 2021 ) ) that takes the concept of self-paced curriculum learning ( Kumar et al. , 2010 ) from supervisedto reinforcement learning ( RL ) . Opposed to supervised learning , where there is ongoing discussion about the mechanics of curricula and their effect in different situations ( Weinshall & Amir , 2020 ; Wu et al. , 2021 ) , the mechanics seem to be more agreed upon in RL . In RL , curricula improve learning performance of an agent by adapting the training environments to its proficiency , and with that e.g . bypass poor exploratory behaviour of non-proficient agents . Applications are by now widely spread and different terms have been established . Adaptive Domain Randomization ( Akkaya et al. , 2019 ) uses curricula to gradually diversify training parameters of a simulator to facilitate sim-to-real transfer . Unsupervised environment discovery ( Dennis et al. , 2020 ; Jiang et al. , 2021b ; a ) similarly aims to efficiently train an agent which is robust to variations in the environment . Automatic curriculum learning methods ( Florensa et al. , 2017 ; Sukhbaatar et al. , 2018 ; Florensa et al. , 2018 ; Portelas et al. , 2019 ; Zhang et al. , 2020 ; Racaniere et al. , 2020 ; Eimer et al. , 2021 ) , to which SPRL belongs to , particularly focus on improving the learning speed and/or performance of an agent on a set of desired tasks . Curricula are often generated as distributions that maximize a certain surrogate objective , such as learning progress ( Baranes & Oudeyer , 2010 ; Portelas et al. , 2019 ) , intermediate task difficulty ( Florensa et al. , 2018 ) , regret ( Jiang et al. , 2021b ) or disagreement between Q-functions ( Zhang et al. , 2020 ) . Curriculum generation can also be interpreted as a two-player game ( Sukhbaatar et al. , 2018 ) . The work by Jiang et al . ( 2021a ) even hints to a link between surrogate objectives and twoplayer games . Opposed to these interpretations , SPRL has been shown to perform an interpolation between task distributions by Klink et al . ( 2021 ) , allowing to formally relate the effect of SPRL to the concept of annealing in statistics ( Neal , 2001 ) and homotopic continuation methods in optimization ( Allgower & Georg , 2003 ) . We wish to add to this formal understanding of SPRL by investigating the interpolation that it produces more closely . As this investigation will lead us to the problem of optimal transport , we wish to point out important literature in this field . Dating back to the work by Monge in the 18th century , optimal transport has been understood as an important fundamental concept touching upon many fields in both theory and application ( Liu et al. , 2019 ; Peyré et al. , 2019 ; Chen et al. , 2021 ) . In probability theory , optimal transport translates to the so-called Wasserstein metric ( Kantorovich , 1942 ) that compares two distributions under a given metric on the sample space . From a computational perspective , entropy-regularized Wasserstein metrics ( Cuturi , 2013 ) have led to tangible speed-ups in computations revolving around optimal transport and are hence widely applied ( Feydy et al. , 2019 ) . 3 PRELIMINARIES . This section serves to introduce the necessary background on ( contextual ) RL , self-paced RL and optimal transport . 3.1 CONTEXTUAL REINFORCEMENT LEARNING . Contextual reinforcement learning ( Hallak et al. , 2015 ) can be seen as a conceptual extension to the ( single task ) reinforcement learning ( RL ) problem max π J ( π ) = max π Ep0 ( s0 ) , p ( st+1|st , at ) , π ( at|st ) [ ∞∑ t=0 γtr ( st , at ) ] , ( 1 ) which aims to maximize the above expected reward objective by finding an optimal a policy π : S×A 7→ R for a given MDP M = ⟨S , A , p , r , p0⟩ with initial state distribution p0 and transition dynamics p. Contextual RL extends this objective to a space of MDPs M ( c ) = ⟨S , A , pc , rc , p0 , c⟩ equipped with a distribution µ : C 7→ R over contextual variables c ∈ C max π J ( π , µ ) = max π Eµ ( c ) [ J ( π , c ) ] . ( 2 ) The policy π : S×C×A 7→ R is conditioned on the contextual parameter c. The distribution µ ( c ) encodes the tasks M ( c ) that the agent is expected to encounter . Objective J ( π , c ) in Eq . ( 2 ) corresponds to the objective J ( π ) in Eq . ( 1 ) where , however , the initial state distribution p0 , the transition dynamics p as well as the reward function r of M are replaced by their counterparts in M ( c ) . This contextual model of optimal decision making is well-suited for learning in multiple related tasks as is the case in multi-task ( Wilson et al. , 2007 ) , goal-conditioned ( Schaul et al. , 2015 ) or curriculum RL ( Narvekar et al. , 2020 ) . 3.2 SELF-PACED REINFORCEMENT LEARNING . Self-paced reinforcement learning ( SPRL ) has been introduced by Klink et al . ( 2020a ; b ; 2021 ) as a curriculum RL algorithm that alters the context distribution µ ( c ) in the contextual RL objective ( 2 ) to increase the learning performance of an agent and/or make it less susceptible to local optima of the objective function . SPRL computes a surrogate distribution p : C 7→ R under which to train the RL agent , i.e . optimize J ( π , p ) . This surrogate distribution is found by optimizing the KL divergence to the target distribution µ ( c ) subject to two constraints ( see Klink et al . ( 2021 , Section 8 ) ) min p DKL ( p ( c ) ∥ µ ( c ) ) s.t . J ( π , p ) ≥ δ DKL ( p ( c ) ∥ q ( c ) ) ≤ ϵ . ( 3 ) The distribution p ( c ) balances between tasks likely under the ( target ) distribution µ ( c ) and tasks in which the agent currently obtains large rewards . The KL divergence constraint w.r.t . the previous context distribution q ( c ) prevents large changes in p ( c ) during subsequent iterations , making the curriculum robust against errors in the estimates of the expected agent performance J ( π , c ) . A particularly interesting aspect of this work is that objective ( 3 ) can be interpreted to perform a specific interpolation between the distributions µ ( c ) , q ( c ) and a maximum entropy distribution pJ ( c ) ∝ exp ( ηJ ( π , c ) ) encoding high reward tasks . This interpolation is given by pα , η ( c ) ∝ µ ( c ) 1 1+α q ( c ) α 1+α exp ( ηJ ( π , c ) ) 1 1+α . ( 4 ) The two parameters α and η controlling the interpolation are the Lagrangian multipliers of the two constraints in objective ( 3 ) . So far , Klink et al . ( 2020a ; b ; 2021 ) restricted the distribution pα , η ( c ) to a Gaussian distributions pν ( c ) = N ( c|µ , Σ ) . In this case , optimizing ( 3 ) w.r.t . µ and Σ of pν corresponds to performing an I-projection of the analytic optimal distribution ( 4 ) to the Gaussian restriction , i.e . minimizing DKL ( pν ( c ) ∥ pα , η ( c ) ) w.r.t . ν . In this work , we are interested in investigating the distribution pα , η outside of this parametric restriction pν , i.e . truly employing the distribution ( 4 ) instead of its I-projection to a Gaussian .
The authors try to alleviate the need for parametric distributions (namely a Gaussian) from the self paced RL framework (SPRL). They seek to shift current distribution over tasks to the target distribution of tasks under 2 constraints: keeping the current distribution close to the target and also that the expected return of the current distribution remain above some threshold. They compare SPRL using a KL divergence metric between a discretized proposal distribution and the target as well as a Wasserstein distance metric between particle based approximations. They show that in a set of toy tasks with low dimensional goal spaces can outperform existing baselines, e.g. GoalGan, as well as the previous instantiation of SPRL with parametric distributions.
SP:22c05e47528c628c8607626e945a4c5408c939c4
Metrics Matter: A Closer Look on Self-Paced Reinforcement Learning
1 INTRODUCTION . Reinforcement learning ( RL ) ( Sutton & Barto , 1998 ) has celebrated great successes as a framework for autonomous acquisition of desired behavior . With ever-increasing computational power , this framework and the algorithms developed under it have allowed to create learning agents capable of solving non-trivial long-horizon planning ( Mnih et al. , 2015 ; Silver et al. , 2017 ) and control tasks ( Akkaya et al. , 2019 ) . However , these successes have also highlighted the need for certain forms of regularization , such as leagues in the context of boardgames ( Silver et al. , 2017 ) , a gradual diversification of simulated training environments for robotic manipulation ( Akkaya et al. , 2019 ) or a tailored training pipeline in the context of humanoid control for soccer ( Liu et al. , 2021 ) . These regularizations help to overcome shortcomings of modern RL agents , such as poor exploratory behavior – a problem that is an active topic of research ( Bellemare et al. , 2016 ; Ghavamzadeh et al. , 2015 ; Machado et al. , 2020 ) . One can view aforementioned regularizations under the umbrella term of curriculum reinforcement learning ( Narvekar et al. , 2020 ) , where the idea is to avoid shortcomings of modern ( deep ) RL agents such as aforementioned poor exploration by learning on a tailored sequence of tasks . Such curricula can materialize in a variety of ways and are motivated from many perspectives in the literature ( Andrychowicz et al. , 2017 ; Florensa et al. , 2017 ; Wöhlke et al. , 2020 ) . Although the resulting curricula can often be interpreted as a sequence of task distributions , these sequences typically lack a formal connection to the reinforcement learning objective of maximizing the expected reward under a given target task distribution . In a recent line of work , Klink et al . ( 2021 ) proposed the idea of self-paced reinforcement learning ( SPRL ) , borrowing from the concept of self-paced learning that has been established in the supervised learning literature ( Kumar et al. , 2010 ; Jiang et al. , 2015 ; Meng et al. , 2017 ) . Klink et al . showed a connection between a regularized RL objective and a sequence of task distributions that trade-off between yielding high expected reward and tasks likely under the target distribution . This interpolant has , however , so far been restricted to Gaussian distributions ( Klink et al. , 2020a ; b ; 2021 ) . While successful in experimental evaluations , this Gaussian assumption clearly imposes a limitation on the flexibility of the curriculum and disconnects the algorithmic implementation from the established theory . This disconnect raises the question whether the observed performance of SPRL is due to the Gaussian approximation . Contribution : The key insight presented in this paper is that the Gaussian approximation of existing SPRL implementations is indeed important for their empirical performance . We show that ■ Parametric assumptions in SPRL hinder the learning performance in task spaces with nonGaussian target distributions . ■ SPRL can , however , fail to facilitate learning on the target task distributions when leaving these parametric assumptions behind . ■ Equipping SPRL with Wasserstein metrics allows for a flexible , particle-based representation of the task distribution that ensures a meaningful interpolation in aforementioned failure cases , providing higher performance . 2 RELATED WORK . The main focus of this work is on self-paced reinforcement learning ( SPRL , Klink et al . ( 2020a ; b ; 2021 ) ) that takes the concept of self-paced curriculum learning ( Kumar et al. , 2010 ) from supervisedto reinforcement learning ( RL ) . Opposed to supervised learning , where there is ongoing discussion about the mechanics of curricula and their effect in different situations ( Weinshall & Amir , 2020 ; Wu et al. , 2021 ) , the mechanics seem to be more agreed upon in RL . In RL , curricula improve learning performance of an agent by adapting the training environments to its proficiency , and with that e.g . bypass poor exploratory behaviour of non-proficient agents . Applications are by now widely spread and different terms have been established . Adaptive Domain Randomization ( Akkaya et al. , 2019 ) uses curricula to gradually diversify training parameters of a simulator to facilitate sim-to-real transfer . Unsupervised environment discovery ( Dennis et al. , 2020 ; Jiang et al. , 2021b ; a ) similarly aims to efficiently train an agent which is robust to variations in the environment . Automatic curriculum learning methods ( Florensa et al. , 2017 ; Sukhbaatar et al. , 2018 ; Florensa et al. , 2018 ; Portelas et al. , 2019 ; Zhang et al. , 2020 ; Racaniere et al. , 2020 ; Eimer et al. , 2021 ) , to which SPRL belongs to , particularly focus on improving the learning speed and/or performance of an agent on a set of desired tasks . Curricula are often generated as distributions that maximize a certain surrogate objective , such as learning progress ( Baranes & Oudeyer , 2010 ; Portelas et al. , 2019 ) , intermediate task difficulty ( Florensa et al. , 2018 ) , regret ( Jiang et al. , 2021b ) or disagreement between Q-functions ( Zhang et al. , 2020 ) . Curriculum generation can also be interpreted as a two-player game ( Sukhbaatar et al. , 2018 ) . The work by Jiang et al . ( 2021a ) even hints to a link between surrogate objectives and twoplayer games . Opposed to these interpretations , SPRL has been shown to perform an interpolation between task distributions by Klink et al . ( 2021 ) , allowing to formally relate the effect of SPRL to the concept of annealing in statistics ( Neal , 2001 ) and homotopic continuation methods in optimization ( Allgower & Georg , 2003 ) . We wish to add to this formal understanding of SPRL by investigating the interpolation that it produces more closely . As this investigation will lead us to the problem of optimal transport , we wish to point out important literature in this field . Dating back to the work by Monge in the 18th century , optimal transport has been understood as an important fundamental concept touching upon many fields in both theory and application ( Liu et al. , 2019 ; Peyré et al. , 2019 ; Chen et al. , 2021 ) . In probability theory , optimal transport translates to the so-called Wasserstein metric ( Kantorovich , 1942 ) that compares two distributions under a given metric on the sample space . From a computational perspective , entropy-regularized Wasserstein metrics ( Cuturi , 2013 ) have led to tangible speed-ups in computations revolving around optimal transport and are hence widely applied ( Feydy et al. , 2019 ) . 3 PRELIMINARIES . This section serves to introduce the necessary background on ( contextual ) RL , self-paced RL and optimal transport . 3.1 CONTEXTUAL REINFORCEMENT LEARNING . Contextual reinforcement learning ( Hallak et al. , 2015 ) can be seen as a conceptual extension to the ( single task ) reinforcement learning ( RL ) problem max π J ( π ) = max π Ep0 ( s0 ) , p ( st+1|st , at ) , π ( at|st ) [ ∞∑ t=0 γtr ( st , at ) ] , ( 1 ) which aims to maximize the above expected reward objective by finding an optimal a policy π : S×A 7→ R for a given MDP M = ⟨S , A , p , r , p0⟩ with initial state distribution p0 and transition dynamics p. Contextual RL extends this objective to a space of MDPs M ( c ) = ⟨S , A , pc , rc , p0 , c⟩ equipped with a distribution µ : C 7→ R over contextual variables c ∈ C max π J ( π , µ ) = max π Eµ ( c ) [ J ( π , c ) ] . ( 2 ) The policy π : S×C×A 7→ R is conditioned on the contextual parameter c. The distribution µ ( c ) encodes the tasks M ( c ) that the agent is expected to encounter . Objective J ( π , c ) in Eq . ( 2 ) corresponds to the objective J ( π ) in Eq . ( 1 ) where , however , the initial state distribution p0 , the transition dynamics p as well as the reward function r of M are replaced by their counterparts in M ( c ) . This contextual model of optimal decision making is well-suited for learning in multiple related tasks as is the case in multi-task ( Wilson et al. , 2007 ) , goal-conditioned ( Schaul et al. , 2015 ) or curriculum RL ( Narvekar et al. , 2020 ) . 3.2 SELF-PACED REINFORCEMENT LEARNING . Self-paced reinforcement learning ( SPRL ) has been introduced by Klink et al . ( 2020a ; b ; 2021 ) as a curriculum RL algorithm that alters the context distribution µ ( c ) in the contextual RL objective ( 2 ) to increase the learning performance of an agent and/or make it less susceptible to local optima of the objective function . SPRL computes a surrogate distribution p : C 7→ R under which to train the RL agent , i.e . optimize J ( π , p ) . This surrogate distribution is found by optimizing the KL divergence to the target distribution µ ( c ) subject to two constraints ( see Klink et al . ( 2021 , Section 8 ) ) min p DKL ( p ( c ) ∥ µ ( c ) ) s.t . J ( π , p ) ≥ δ DKL ( p ( c ) ∥ q ( c ) ) ≤ ϵ . ( 3 ) The distribution p ( c ) balances between tasks likely under the ( target ) distribution µ ( c ) and tasks in which the agent currently obtains large rewards . The KL divergence constraint w.r.t . the previous context distribution q ( c ) prevents large changes in p ( c ) during subsequent iterations , making the curriculum robust against errors in the estimates of the expected agent performance J ( π , c ) . A particularly interesting aspect of this work is that objective ( 3 ) can be interpreted to perform a specific interpolation between the distributions µ ( c ) , q ( c ) and a maximum entropy distribution pJ ( c ) ∝ exp ( ηJ ( π , c ) ) encoding high reward tasks . This interpolation is given by pα , η ( c ) ∝ µ ( c ) 1 1+α q ( c ) α 1+α exp ( ηJ ( π , c ) ) 1 1+α . ( 4 ) The two parameters α and η controlling the interpolation are the Lagrangian multipliers of the two constraints in objective ( 3 ) . So far , Klink et al . ( 2020a ; b ; 2021 ) restricted the distribution pα , η ( c ) to a Gaussian distributions pν ( c ) = N ( c|µ , Σ ) . In this case , optimizing ( 3 ) w.r.t . µ and Σ of pν corresponds to performing an I-projection of the analytic optimal distribution ( 4 ) to the Gaussian restriction , i.e . minimizing DKL ( pν ( c ) ∥ pα , η ( c ) ) w.r.t . ν . In this work , we are interested in investigating the distribution pα , η outside of this parametric restriction pν , i.e . truly employing the distribution ( 4 ) instead of its I-projection to a Gaussian .
This paper investigates self-paced reinforcement learning (SPRL) which is a type of curriculum-based RL. The authors empirically demonstrate the (different) limitations of a few SPRL variants (one which uses a Gaussian approximation, G-SPRL, and a non-parametric one, NP-SPRL). They propose the use of a Wasserstein metric instead of the KL divergence (WB-SPRL) and show that this leads to higher performance, more desirable behaviors, and more meaningful interpolation between different MDPs / contexts, on three continuous control tasks. The authors also compare their approach with other automatic curriculum algorithms.
SP:22c05e47528c628c8607626e945a4c5408c939c4
Weight Expansion: A New Perspective on Dropout and Generalization
1 INTRODUCTION . Research on why dropout is so effective in improving the generalization ability of neural networks has been intensive . Many intriguing phenomena induced by dropout have also been studied in this research ( Gao et al. , 2019 ; Lengerich et al. , 2020 ; Wei et al. , 2020 ) . In particular , it has been suggested that dropout optimizes the training process ( Baldi & Sadowski , 2013 ; Wager et al. , 2013 ; Helmbold & Long , 2015 ; Kingma et al. , 2015 ; Gal & Ghahramani , 2016 ; Helmbold & Long , 2017 ; Nalisnick et al. , 2019 ) and that dropout regularizes the inductive bias ( Cavazza et al. , 2018 ; Mianjy et al. , 2018 ; Mianjy & Arora , 2019 ; 2020 ) . A fundamental understanding of just how dropout achieves its success as a regularization technique will not only allow us to understand when ( and why ) to apply dropout , but also enable the design of new training methods . In this paper , we suggest a new measure , weight expansion , which both furthers our understanding and allows the development of new regularizers . Broadly speaking , the application of dropout leads to non-trivial changes in the weight covariance matrix . As the weight covariance matrix is massively parameterized and hard to comprehend , we abstract it to the signed volume of a parallelotope spanned by the vectors of the matrix—weight volume ( normalized generalized variance ( Kocherlakota & Kocherlakota , 2004 ) ) for short . Dropout increases this weight volume . Figure 1 illustrates the weight expansion obtained by dropout and visualizes how it improves the generalization ability . This leads to our hypotheses that ( 1 ) weight expansion reduces the generalization error of neural networks ( Section 3.1 ) , and that ( 2 ) dropout leads to weight expansion ( Section 3.2 ) . We hypothesize that weight expansion can be an indicator of the increased generalization ability and dropout is ‘ merely ’ an efficient way to achieve it . The weight volume is defined as the normalized determinant of the weight covariance matrix ( determinant of weight correlation matrix ) , which is the second-order statistics of weight vectors when treated as a multivariate random variable . For example , when the weight vector is an isotropic Gaussian , the weight volume is large and the network generalizes well . Likewise , if the weights are highly correlated , then the weight volume is small and the network does not generalize well . Technically , as a determinant , the weight volume serves as a measure of the orthogonality of the rows/columns of the weight covariance matrix . The more orthogonal the rows/columns are , the larger is the weight volume—which makes the different classes more distinguishable . Figure 1 visualizes that , with increasing weight volume , the decision boundaries of different classes become clearer . Note that , this is different from the “ weight orthogonality ” proposed in Saxe et al . ( 2013 ) ; Mishkin & Matas ( 2015 ) ; Bansal et al . ( 2018 ) : Weight volume is a statistical property of weight matrices treated as random variables , while orthogonality treats weight matrices as deterministic variables ( more discussions are provided in Appendix B ) . In addition to our theoretical arguments that weight expansion promotes generalization and dropout leads to weight expansion ( Section 3 ) , our empirical results also support our hypotheses . To mitigate estimation errors , we consider two independent weight volume estimation methods in Section 4 , i.e. , sampling method and Laplace approximation . Section 5.1 demonstrates that the two methods lead to consistent results , which show that using dropout brings about weight expansion ( coherence to hypothesis ( 2 ) ) and generalization-improvement ( coherence to hypothesis ( 1 ) ) across data sets and networks . Then , we embed the weight volume ( a measurable quantity ) to a new complexity measure that is based on our adaptation of the PAC-Bayesian bound ( Section 3.1 ) . Our experiments in Section 5.2 , conducted on 3 × 288 network configurations , show that , comparing to existing complexity measures which do not consider weight volume , the new complexity measure is most closely correlated with generalization ( coherence to hypothesis ( 1 ) ) and dropout ( coherence to hypothesis ( 2 ) ) for these dropout networks with different dropout rates . Finally , we use disentanglement noises ( Section 4.1 ) to achieve weight expansion and further to improve generalization ( or other noises to achieve contraction and further to destroy generalization , Section 5.3 ) . This in particular supports hypothesis ( 1 ) and indicates that weight expansion is a key indicator for a reduced generalization error , while dropout is a computationally inexpensive means to achieve it . ( Disentanglement noises , e.g. , are more expensive . ) 2 PRELIMINARIES . Notation . Let S be a training set with m samples drawn from the input distribution D , and s ∈ S a single sample . Loss , expected loss , and empirical loss are defined as ` ( fW ( s ) ) , LD ( fW ) = Es∼D [ ` ( fW ( s ) ) ] , and LS ( fW ) = 1m ∑ s∈S [ ` ( fW ( s ) ) ] , respectively , where fW ( · ) is a learning model . Note that , in the above notation , we omit the label y of the sample s , as it is clear from the context . Let W , Wl , and wij be the model weight matrix , the weight matrix of l-th layer , and the element of the i-th row and the j-th column in W , respectively . Note that we omit bias for convenience . To make a clear distinction , let W be the multivariate random variable of vec ( W ) ( vectorization ofW ) , and wij be the random variable of wij . W 0 andWF denote the weight matrix before and after training , respectively . Further , we use W ∗ to represent the maximum-a-posteriori ( MAP ) estimate of W . Note that WF can be seen as an approximation of W ∗ after training . We consider a feedforward neural network fW ( · ) that takes a sample s0 ∈ S as input and produces an output hL , after L fully connected layers . At the l-th layer ( l = 1 , . . . , L ) , the latent representation before and after the activation function is denoted as hl = Wlal−1 and al = actl ( hl ) , respectively , where act ( · ) is the activation function . Node Dropout . We focus on node dropout ( Hinton et al. , 2012 ; Srivastava et al. , 2014 ) , a popular version of dropout that randomly sets the output of a given activation layer to 0 . We adopt a formal definition of node dropout from Wei et al . ( 2020 ) , which is more general than the usual Bernoulli formalism . For the layer l with the output of the activation function al ∈ RNl and a given probability ql ∈ [ 0 , 1 ) , we sample a scaling vector ηdol ∈ RNl ( do is short for dropout ) with independently and identically distributed elements ( ηdol ) i = { −1 with probability ql , ql 1−ql with probability 1− ql . ( 1 ) for i = 1 , . . . , Nl , where Nl is the number of neurons at the layer l. With a slight abuse of notation , we denote by ηdol a vector of independently distributed random variables , each of which has a zero mean , and also a vector with each element being either −1 or ql1−ql when referring to a specific realization . As such , applying node dropout , we compute the updated output after the activation as adol = ( 1 + η do l ) al . That is , with probability ql , an element of the output with node dropout adol is reset to 0 , and with probability 1 − ql it is rescaled with a factor 11−ql . The index of the layer l will be omitted when it is clear from the context . With different realizations of ηdo , a number of subnetworks with different connectivity will be produced during training . 3 DROPOUT AND WEIGHT EXPANSION . In this section , we first formally define the weight volume , which has been informally introduced in Figure 1 . We aim to answer the following two questions : 1 . Why does large weight volume promote generalization ? 2 . Why does dropout expand the weight volume ? Definition 3.1 ( Weight Volume ) Let Σl = E [ ( Wl − E ( Wl ) ) ( Wl − E ( Wl ) ) ᵀ ] be the weight covariance matrix in a neural network . The weight volume ( also called as normalized generalized variance or determinant of weight correlation matrix ) is defined as vol ( Wl ) , det ( Σl ) ∏ i [ Σl ] ii ∈ [ 0 , 1 ] , ( 2 ) where the denominator is the product of the diagonal elements in Σl . Intuitively , the weight volume comes from the geometric interpretation of the determinant of the matrix det ( Σl ) , with normalization over the diagonal elements of the matrix . Because Σl is a covariance matrix and thus positive semi-definite , we have vol ( Wl ) ∈ [ 0 , 1 ] since 0 ≤ det ( Σl ) ≤∏ i [ Σl ] ii . We note that vol ( Wl ) = 0 implies that the the weight covariance matrix does not have full rank , suggesting that some weights are completely determined by the others , while vol ( Wl ) = 1 suggests that the weights Wl are uncorrelated . The larger vol ( Wl ) is , the more dispersed are the weights . Before presenting empirical results , we first provide theoretical support for our first hypothesis by adapting the PAC-Bayesian theorem ( McAllester , 1999 ; Dziugaite & Roy , 2017 ) ( Section 3.1 ) : We show that a larger weight volume leads to a tighter bound for the generalization error . In Section 3.2 , we argue that dropout can expand weight volume through the theoretical derivation . 3.1 WHY DOES LARGE WEIGHT VOLUME PROMOTE GENERALIZATION ? . First , we support hypothesis ( 1 ) on the relevance of weight expansion through an extension of the PAC-Bayesian theorem , and then verify it empirically in Section 5 . The PAC-Bayesian framework , developed in McAllester ( 1999 ) ; Neyshabur et al . ( 2017 ) ; Dziugaite & Roy ( 2017 ) , connects weights with generalization by establishing an upper bound on the generalization error with respect to the Kullback-Leibler divergence ( DKL ) between the posterior distribution Q and the prior distribution P of the weights . In the following , we extend this framework to work with vol ( Wl ) . Let P be a prior and Q be a posterior over the weight space . For any δ > 0 , with probability 1 − δ over the draw of the input space , we have ( McAllester , 1999 ; Dziugaite & Roy , 2017 ) EW∼Q [ LD ( fW ) ] ≤ EW∼Q [ LS ( fW ) ] + √ DKL ( Q||P ) + ln mδ 2 ( m− 1 ) . ( 3 ) Given a learning setting , Dziugaite & Roy ( 2017 ) ; Neyshabur et al . ( 2017 ) ; Jiang et al . ( 2020b ) assume P = N ( µP , ΣP ) and Q = N ( µQ , ΣQ ) . Thus , DKL ( Q||P ) can be simplified to DKL ( Q||P ) = 1 2 ( tr ( Σ−1P ΣQ ) − k + ( µP − µQ ) ᵀ ( ΣP ) −1 ( µP − µQ ) + ln det ( ΣP ) det ( ΣQ ) ) , ( 4 ) where k is the dimension of W , tr denotes the trace , and det denotes the determinant . The derivation is given in Appendix D. To simplify the analysis , Neyshabur et al . ( 2017 ; 2018a ) instantiate the prior P to be a vec ( W 0 ) ( or 0 ) mean and σ2 variance Gaussian distribution , and assume that the posterior Q to also be a vec ( WF ) mean spherical Gaussian with variance σ2 in each direction . We relax their assumption by letting Q be a non-spherical Gaussian ( the off-diagonal correlations for same layer are not 0 , whereas those for different layers are 0 ) , while retaining the assumption on the σ2 variation in every direction ( but allowing arbitrary covariance between them ) . This retains both tr ( Σ−1P ΣQ ) = k and ∏ i [ Σl , P ] ii = ∏ i [ Σl , Q ] ii for all l , which provides the following . DKL ( Q||P ) = 1 2 ∑ l ( ||WFl −W 0l ||2F σ2l + ln ∏ i [ Σl , P ] ii det ( Σl , Q ) ) = 1 2 ∑ l ( ||WFl −W 0l ||2F σ2l + ln 1 vol ( Wl ) ) . ( 5 ) Details of the derivation are provided in Appendix D. From Equations ( 3 ) and ( 5 ) , we notice that the PAC-Bayesian upper bound of the generalization error becomes smaller when vol ( Wl ) increases , which is also demonstrated by wide experiments in Section 5 .
The paper proposes the "weight volume" as a new metric for neural network model selection. To compute the weight volume, one should first consider a vector of random variables that take values "around" the weights of the neural network without changing its outputs. Then the weight volume is measured from the normalized determinant of the covariance matrix. The paper shows mathematically that increasing the weight volume decreases a PAC-Bayesian generalization bound, and (2) the dropout method naturally endeavors weight volume expansion. Then, the paper presents two methods for estimating the weight volume of a neural network (which is mandatory as neural networks commonly have a large number of parameters). Finally, extensive experiments show empirically a clear correlation between the introduced metric and the generalization gap of neural networks,
SP:fe0789263d08621ab15d9e42666bd268eb6d931f
Weight Expansion: A New Perspective on Dropout and Generalization
1 INTRODUCTION . Research on why dropout is so effective in improving the generalization ability of neural networks has been intensive . Many intriguing phenomena induced by dropout have also been studied in this research ( Gao et al. , 2019 ; Lengerich et al. , 2020 ; Wei et al. , 2020 ) . In particular , it has been suggested that dropout optimizes the training process ( Baldi & Sadowski , 2013 ; Wager et al. , 2013 ; Helmbold & Long , 2015 ; Kingma et al. , 2015 ; Gal & Ghahramani , 2016 ; Helmbold & Long , 2017 ; Nalisnick et al. , 2019 ) and that dropout regularizes the inductive bias ( Cavazza et al. , 2018 ; Mianjy et al. , 2018 ; Mianjy & Arora , 2019 ; 2020 ) . A fundamental understanding of just how dropout achieves its success as a regularization technique will not only allow us to understand when ( and why ) to apply dropout , but also enable the design of new training methods . In this paper , we suggest a new measure , weight expansion , which both furthers our understanding and allows the development of new regularizers . Broadly speaking , the application of dropout leads to non-trivial changes in the weight covariance matrix . As the weight covariance matrix is massively parameterized and hard to comprehend , we abstract it to the signed volume of a parallelotope spanned by the vectors of the matrix—weight volume ( normalized generalized variance ( Kocherlakota & Kocherlakota , 2004 ) ) for short . Dropout increases this weight volume . Figure 1 illustrates the weight expansion obtained by dropout and visualizes how it improves the generalization ability . This leads to our hypotheses that ( 1 ) weight expansion reduces the generalization error of neural networks ( Section 3.1 ) , and that ( 2 ) dropout leads to weight expansion ( Section 3.2 ) . We hypothesize that weight expansion can be an indicator of the increased generalization ability and dropout is ‘ merely ’ an efficient way to achieve it . The weight volume is defined as the normalized determinant of the weight covariance matrix ( determinant of weight correlation matrix ) , which is the second-order statistics of weight vectors when treated as a multivariate random variable . For example , when the weight vector is an isotropic Gaussian , the weight volume is large and the network generalizes well . Likewise , if the weights are highly correlated , then the weight volume is small and the network does not generalize well . Technically , as a determinant , the weight volume serves as a measure of the orthogonality of the rows/columns of the weight covariance matrix . The more orthogonal the rows/columns are , the larger is the weight volume—which makes the different classes more distinguishable . Figure 1 visualizes that , with increasing weight volume , the decision boundaries of different classes become clearer . Note that , this is different from the “ weight orthogonality ” proposed in Saxe et al . ( 2013 ) ; Mishkin & Matas ( 2015 ) ; Bansal et al . ( 2018 ) : Weight volume is a statistical property of weight matrices treated as random variables , while orthogonality treats weight matrices as deterministic variables ( more discussions are provided in Appendix B ) . In addition to our theoretical arguments that weight expansion promotes generalization and dropout leads to weight expansion ( Section 3 ) , our empirical results also support our hypotheses . To mitigate estimation errors , we consider two independent weight volume estimation methods in Section 4 , i.e. , sampling method and Laplace approximation . Section 5.1 demonstrates that the two methods lead to consistent results , which show that using dropout brings about weight expansion ( coherence to hypothesis ( 2 ) ) and generalization-improvement ( coherence to hypothesis ( 1 ) ) across data sets and networks . Then , we embed the weight volume ( a measurable quantity ) to a new complexity measure that is based on our adaptation of the PAC-Bayesian bound ( Section 3.1 ) . Our experiments in Section 5.2 , conducted on 3 × 288 network configurations , show that , comparing to existing complexity measures which do not consider weight volume , the new complexity measure is most closely correlated with generalization ( coherence to hypothesis ( 1 ) ) and dropout ( coherence to hypothesis ( 2 ) ) for these dropout networks with different dropout rates . Finally , we use disentanglement noises ( Section 4.1 ) to achieve weight expansion and further to improve generalization ( or other noises to achieve contraction and further to destroy generalization , Section 5.3 ) . This in particular supports hypothesis ( 1 ) and indicates that weight expansion is a key indicator for a reduced generalization error , while dropout is a computationally inexpensive means to achieve it . ( Disentanglement noises , e.g. , are more expensive . ) 2 PRELIMINARIES . Notation . Let S be a training set with m samples drawn from the input distribution D , and s ∈ S a single sample . Loss , expected loss , and empirical loss are defined as ` ( fW ( s ) ) , LD ( fW ) = Es∼D [ ` ( fW ( s ) ) ] , and LS ( fW ) = 1m ∑ s∈S [ ` ( fW ( s ) ) ] , respectively , where fW ( · ) is a learning model . Note that , in the above notation , we omit the label y of the sample s , as it is clear from the context . Let W , Wl , and wij be the model weight matrix , the weight matrix of l-th layer , and the element of the i-th row and the j-th column in W , respectively . Note that we omit bias for convenience . To make a clear distinction , let W be the multivariate random variable of vec ( W ) ( vectorization ofW ) , and wij be the random variable of wij . W 0 andWF denote the weight matrix before and after training , respectively . Further , we use W ∗ to represent the maximum-a-posteriori ( MAP ) estimate of W . Note that WF can be seen as an approximation of W ∗ after training . We consider a feedforward neural network fW ( · ) that takes a sample s0 ∈ S as input and produces an output hL , after L fully connected layers . At the l-th layer ( l = 1 , . . . , L ) , the latent representation before and after the activation function is denoted as hl = Wlal−1 and al = actl ( hl ) , respectively , where act ( · ) is the activation function . Node Dropout . We focus on node dropout ( Hinton et al. , 2012 ; Srivastava et al. , 2014 ) , a popular version of dropout that randomly sets the output of a given activation layer to 0 . We adopt a formal definition of node dropout from Wei et al . ( 2020 ) , which is more general than the usual Bernoulli formalism . For the layer l with the output of the activation function al ∈ RNl and a given probability ql ∈ [ 0 , 1 ) , we sample a scaling vector ηdol ∈ RNl ( do is short for dropout ) with independently and identically distributed elements ( ηdol ) i = { −1 with probability ql , ql 1−ql with probability 1− ql . ( 1 ) for i = 1 , . . . , Nl , where Nl is the number of neurons at the layer l. With a slight abuse of notation , we denote by ηdol a vector of independently distributed random variables , each of which has a zero mean , and also a vector with each element being either −1 or ql1−ql when referring to a specific realization . As such , applying node dropout , we compute the updated output after the activation as adol = ( 1 + η do l ) al . That is , with probability ql , an element of the output with node dropout adol is reset to 0 , and with probability 1 − ql it is rescaled with a factor 11−ql . The index of the layer l will be omitted when it is clear from the context . With different realizations of ηdo , a number of subnetworks with different connectivity will be produced during training . 3 DROPOUT AND WEIGHT EXPANSION . In this section , we first formally define the weight volume , which has been informally introduced in Figure 1 . We aim to answer the following two questions : 1 . Why does large weight volume promote generalization ? 2 . Why does dropout expand the weight volume ? Definition 3.1 ( Weight Volume ) Let Σl = E [ ( Wl − E ( Wl ) ) ( Wl − E ( Wl ) ) ᵀ ] be the weight covariance matrix in a neural network . The weight volume ( also called as normalized generalized variance or determinant of weight correlation matrix ) is defined as vol ( Wl ) , det ( Σl ) ∏ i [ Σl ] ii ∈ [ 0 , 1 ] , ( 2 ) where the denominator is the product of the diagonal elements in Σl . Intuitively , the weight volume comes from the geometric interpretation of the determinant of the matrix det ( Σl ) , with normalization over the diagonal elements of the matrix . Because Σl is a covariance matrix and thus positive semi-definite , we have vol ( Wl ) ∈ [ 0 , 1 ] since 0 ≤ det ( Σl ) ≤∏ i [ Σl ] ii . We note that vol ( Wl ) = 0 implies that the the weight covariance matrix does not have full rank , suggesting that some weights are completely determined by the others , while vol ( Wl ) = 1 suggests that the weights Wl are uncorrelated . The larger vol ( Wl ) is , the more dispersed are the weights . Before presenting empirical results , we first provide theoretical support for our first hypothesis by adapting the PAC-Bayesian theorem ( McAllester , 1999 ; Dziugaite & Roy , 2017 ) ( Section 3.1 ) : We show that a larger weight volume leads to a tighter bound for the generalization error . In Section 3.2 , we argue that dropout can expand weight volume through the theoretical derivation . 3.1 WHY DOES LARGE WEIGHT VOLUME PROMOTE GENERALIZATION ? . First , we support hypothesis ( 1 ) on the relevance of weight expansion through an extension of the PAC-Bayesian theorem , and then verify it empirically in Section 5 . The PAC-Bayesian framework , developed in McAllester ( 1999 ) ; Neyshabur et al . ( 2017 ) ; Dziugaite & Roy ( 2017 ) , connects weights with generalization by establishing an upper bound on the generalization error with respect to the Kullback-Leibler divergence ( DKL ) between the posterior distribution Q and the prior distribution P of the weights . In the following , we extend this framework to work with vol ( Wl ) . Let P be a prior and Q be a posterior over the weight space . For any δ > 0 , with probability 1 − δ over the draw of the input space , we have ( McAllester , 1999 ; Dziugaite & Roy , 2017 ) EW∼Q [ LD ( fW ) ] ≤ EW∼Q [ LS ( fW ) ] + √ DKL ( Q||P ) + ln mδ 2 ( m− 1 ) . ( 3 ) Given a learning setting , Dziugaite & Roy ( 2017 ) ; Neyshabur et al . ( 2017 ) ; Jiang et al . ( 2020b ) assume P = N ( µP , ΣP ) and Q = N ( µQ , ΣQ ) . Thus , DKL ( Q||P ) can be simplified to DKL ( Q||P ) = 1 2 ( tr ( Σ−1P ΣQ ) − k + ( µP − µQ ) ᵀ ( ΣP ) −1 ( µP − µQ ) + ln det ( ΣP ) det ( ΣQ ) ) , ( 4 ) where k is the dimension of W , tr denotes the trace , and det denotes the determinant . The derivation is given in Appendix D. To simplify the analysis , Neyshabur et al . ( 2017 ; 2018a ) instantiate the prior P to be a vec ( W 0 ) ( or 0 ) mean and σ2 variance Gaussian distribution , and assume that the posterior Q to also be a vec ( WF ) mean spherical Gaussian with variance σ2 in each direction . We relax their assumption by letting Q be a non-spherical Gaussian ( the off-diagonal correlations for same layer are not 0 , whereas those for different layers are 0 ) , while retaining the assumption on the σ2 variation in every direction ( but allowing arbitrary covariance between them ) . This retains both tr ( Σ−1P ΣQ ) = k and ∏ i [ Σl , P ] ii = ∏ i [ Σl , Q ] ii for all l , which provides the following . DKL ( Q||P ) = 1 2 ∑ l ( ||WFl −W 0l ||2F σ2l + ln ∏ i [ Σl , P ] ii det ( Σl , Q ) ) = 1 2 ∑ l ( ||WFl −W 0l ||2F σ2l + ln 1 vol ( Wl ) ) . ( 5 ) Details of the derivation are provided in Appendix D. From Equations ( 3 ) and ( 5 ) , we notice that the PAC-Bayesian upper bound of the generalization error becomes smaller when vol ( Wl ) increases , which is also demonstrated by wide experiments in Section 5 .
Authors study the generalization error through the notion of weight expansion. It is shown that a weight expansion reduces the generalization error and that dropout is an efficient method that increases the weight volume. Authors also argue that weight expansion should be regarded as the cause of better generalization.
SP:fe0789263d08621ab15d9e42666bd268eb6d931f
Weight Expansion: A New Perspective on Dropout and Generalization
1 INTRODUCTION . Research on why dropout is so effective in improving the generalization ability of neural networks has been intensive . Many intriguing phenomena induced by dropout have also been studied in this research ( Gao et al. , 2019 ; Lengerich et al. , 2020 ; Wei et al. , 2020 ) . In particular , it has been suggested that dropout optimizes the training process ( Baldi & Sadowski , 2013 ; Wager et al. , 2013 ; Helmbold & Long , 2015 ; Kingma et al. , 2015 ; Gal & Ghahramani , 2016 ; Helmbold & Long , 2017 ; Nalisnick et al. , 2019 ) and that dropout regularizes the inductive bias ( Cavazza et al. , 2018 ; Mianjy et al. , 2018 ; Mianjy & Arora , 2019 ; 2020 ) . A fundamental understanding of just how dropout achieves its success as a regularization technique will not only allow us to understand when ( and why ) to apply dropout , but also enable the design of new training methods . In this paper , we suggest a new measure , weight expansion , which both furthers our understanding and allows the development of new regularizers . Broadly speaking , the application of dropout leads to non-trivial changes in the weight covariance matrix . As the weight covariance matrix is massively parameterized and hard to comprehend , we abstract it to the signed volume of a parallelotope spanned by the vectors of the matrix—weight volume ( normalized generalized variance ( Kocherlakota & Kocherlakota , 2004 ) ) for short . Dropout increases this weight volume . Figure 1 illustrates the weight expansion obtained by dropout and visualizes how it improves the generalization ability . This leads to our hypotheses that ( 1 ) weight expansion reduces the generalization error of neural networks ( Section 3.1 ) , and that ( 2 ) dropout leads to weight expansion ( Section 3.2 ) . We hypothesize that weight expansion can be an indicator of the increased generalization ability and dropout is ‘ merely ’ an efficient way to achieve it . The weight volume is defined as the normalized determinant of the weight covariance matrix ( determinant of weight correlation matrix ) , which is the second-order statistics of weight vectors when treated as a multivariate random variable . For example , when the weight vector is an isotropic Gaussian , the weight volume is large and the network generalizes well . Likewise , if the weights are highly correlated , then the weight volume is small and the network does not generalize well . Technically , as a determinant , the weight volume serves as a measure of the orthogonality of the rows/columns of the weight covariance matrix . The more orthogonal the rows/columns are , the larger is the weight volume—which makes the different classes more distinguishable . Figure 1 visualizes that , with increasing weight volume , the decision boundaries of different classes become clearer . Note that , this is different from the “ weight orthogonality ” proposed in Saxe et al . ( 2013 ) ; Mishkin & Matas ( 2015 ) ; Bansal et al . ( 2018 ) : Weight volume is a statistical property of weight matrices treated as random variables , while orthogonality treats weight matrices as deterministic variables ( more discussions are provided in Appendix B ) . In addition to our theoretical arguments that weight expansion promotes generalization and dropout leads to weight expansion ( Section 3 ) , our empirical results also support our hypotheses . To mitigate estimation errors , we consider two independent weight volume estimation methods in Section 4 , i.e. , sampling method and Laplace approximation . Section 5.1 demonstrates that the two methods lead to consistent results , which show that using dropout brings about weight expansion ( coherence to hypothesis ( 2 ) ) and generalization-improvement ( coherence to hypothesis ( 1 ) ) across data sets and networks . Then , we embed the weight volume ( a measurable quantity ) to a new complexity measure that is based on our adaptation of the PAC-Bayesian bound ( Section 3.1 ) . Our experiments in Section 5.2 , conducted on 3 × 288 network configurations , show that , comparing to existing complexity measures which do not consider weight volume , the new complexity measure is most closely correlated with generalization ( coherence to hypothesis ( 1 ) ) and dropout ( coherence to hypothesis ( 2 ) ) for these dropout networks with different dropout rates . Finally , we use disentanglement noises ( Section 4.1 ) to achieve weight expansion and further to improve generalization ( or other noises to achieve contraction and further to destroy generalization , Section 5.3 ) . This in particular supports hypothesis ( 1 ) and indicates that weight expansion is a key indicator for a reduced generalization error , while dropout is a computationally inexpensive means to achieve it . ( Disentanglement noises , e.g. , are more expensive . ) 2 PRELIMINARIES . Notation . Let S be a training set with m samples drawn from the input distribution D , and s ∈ S a single sample . Loss , expected loss , and empirical loss are defined as ` ( fW ( s ) ) , LD ( fW ) = Es∼D [ ` ( fW ( s ) ) ] , and LS ( fW ) = 1m ∑ s∈S [ ` ( fW ( s ) ) ] , respectively , where fW ( · ) is a learning model . Note that , in the above notation , we omit the label y of the sample s , as it is clear from the context . Let W , Wl , and wij be the model weight matrix , the weight matrix of l-th layer , and the element of the i-th row and the j-th column in W , respectively . Note that we omit bias for convenience . To make a clear distinction , let W be the multivariate random variable of vec ( W ) ( vectorization ofW ) , and wij be the random variable of wij . W 0 andWF denote the weight matrix before and after training , respectively . Further , we use W ∗ to represent the maximum-a-posteriori ( MAP ) estimate of W . Note that WF can be seen as an approximation of W ∗ after training . We consider a feedforward neural network fW ( · ) that takes a sample s0 ∈ S as input and produces an output hL , after L fully connected layers . At the l-th layer ( l = 1 , . . . , L ) , the latent representation before and after the activation function is denoted as hl = Wlal−1 and al = actl ( hl ) , respectively , where act ( · ) is the activation function . Node Dropout . We focus on node dropout ( Hinton et al. , 2012 ; Srivastava et al. , 2014 ) , a popular version of dropout that randomly sets the output of a given activation layer to 0 . We adopt a formal definition of node dropout from Wei et al . ( 2020 ) , which is more general than the usual Bernoulli formalism . For the layer l with the output of the activation function al ∈ RNl and a given probability ql ∈ [ 0 , 1 ) , we sample a scaling vector ηdol ∈ RNl ( do is short for dropout ) with independently and identically distributed elements ( ηdol ) i = { −1 with probability ql , ql 1−ql with probability 1− ql . ( 1 ) for i = 1 , . . . , Nl , where Nl is the number of neurons at the layer l. With a slight abuse of notation , we denote by ηdol a vector of independently distributed random variables , each of which has a zero mean , and also a vector with each element being either −1 or ql1−ql when referring to a specific realization . As such , applying node dropout , we compute the updated output after the activation as adol = ( 1 + η do l ) al . That is , with probability ql , an element of the output with node dropout adol is reset to 0 , and with probability 1 − ql it is rescaled with a factor 11−ql . The index of the layer l will be omitted when it is clear from the context . With different realizations of ηdo , a number of subnetworks with different connectivity will be produced during training . 3 DROPOUT AND WEIGHT EXPANSION . In this section , we first formally define the weight volume , which has been informally introduced in Figure 1 . We aim to answer the following two questions : 1 . Why does large weight volume promote generalization ? 2 . Why does dropout expand the weight volume ? Definition 3.1 ( Weight Volume ) Let Σl = E [ ( Wl − E ( Wl ) ) ( Wl − E ( Wl ) ) ᵀ ] be the weight covariance matrix in a neural network . The weight volume ( also called as normalized generalized variance or determinant of weight correlation matrix ) is defined as vol ( Wl ) , det ( Σl ) ∏ i [ Σl ] ii ∈ [ 0 , 1 ] , ( 2 ) where the denominator is the product of the diagonal elements in Σl . Intuitively , the weight volume comes from the geometric interpretation of the determinant of the matrix det ( Σl ) , with normalization over the diagonal elements of the matrix . Because Σl is a covariance matrix and thus positive semi-definite , we have vol ( Wl ) ∈ [ 0 , 1 ] since 0 ≤ det ( Σl ) ≤∏ i [ Σl ] ii . We note that vol ( Wl ) = 0 implies that the the weight covariance matrix does not have full rank , suggesting that some weights are completely determined by the others , while vol ( Wl ) = 1 suggests that the weights Wl are uncorrelated . The larger vol ( Wl ) is , the more dispersed are the weights . Before presenting empirical results , we first provide theoretical support for our first hypothesis by adapting the PAC-Bayesian theorem ( McAllester , 1999 ; Dziugaite & Roy , 2017 ) ( Section 3.1 ) : We show that a larger weight volume leads to a tighter bound for the generalization error . In Section 3.2 , we argue that dropout can expand weight volume through the theoretical derivation . 3.1 WHY DOES LARGE WEIGHT VOLUME PROMOTE GENERALIZATION ? . First , we support hypothesis ( 1 ) on the relevance of weight expansion through an extension of the PAC-Bayesian theorem , and then verify it empirically in Section 5 . The PAC-Bayesian framework , developed in McAllester ( 1999 ) ; Neyshabur et al . ( 2017 ) ; Dziugaite & Roy ( 2017 ) , connects weights with generalization by establishing an upper bound on the generalization error with respect to the Kullback-Leibler divergence ( DKL ) between the posterior distribution Q and the prior distribution P of the weights . In the following , we extend this framework to work with vol ( Wl ) . Let P be a prior and Q be a posterior over the weight space . For any δ > 0 , with probability 1 − δ over the draw of the input space , we have ( McAllester , 1999 ; Dziugaite & Roy , 2017 ) EW∼Q [ LD ( fW ) ] ≤ EW∼Q [ LS ( fW ) ] + √ DKL ( Q||P ) + ln mδ 2 ( m− 1 ) . ( 3 ) Given a learning setting , Dziugaite & Roy ( 2017 ) ; Neyshabur et al . ( 2017 ) ; Jiang et al . ( 2020b ) assume P = N ( µP , ΣP ) and Q = N ( µQ , ΣQ ) . Thus , DKL ( Q||P ) can be simplified to DKL ( Q||P ) = 1 2 ( tr ( Σ−1P ΣQ ) − k + ( µP − µQ ) ᵀ ( ΣP ) −1 ( µP − µQ ) + ln det ( ΣP ) det ( ΣQ ) ) , ( 4 ) where k is the dimension of W , tr denotes the trace , and det denotes the determinant . The derivation is given in Appendix D. To simplify the analysis , Neyshabur et al . ( 2017 ; 2018a ) instantiate the prior P to be a vec ( W 0 ) ( or 0 ) mean and σ2 variance Gaussian distribution , and assume that the posterior Q to also be a vec ( WF ) mean spherical Gaussian with variance σ2 in each direction . We relax their assumption by letting Q be a non-spherical Gaussian ( the off-diagonal correlations for same layer are not 0 , whereas those for different layers are 0 ) , while retaining the assumption on the σ2 variation in every direction ( but allowing arbitrary covariance between them ) . This retains both tr ( Σ−1P ΣQ ) = k and ∏ i [ Σl , P ] ii = ∏ i [ Σl , Q ] ii for all l , which provides the following . DKL ( Q||P ) = 1 2 ∑ l ( ||WFl −W 0l ||2F σ2l + ln ∏ i [ Σl , P ] ii det ( Σl , Q ) ) = 1 2 ∑ l ( ||WFl −W 0l ||2F σ2l + ln 1 vol ( Wl ) ) . ( 5 ) Details of the derivation are provided in Appendix D. From Equations ( 3 ) and ( 5 ) , we notice that the PAC-Bayesian upper bound of the generalization error becomes smaller when vol ( Wl ) increases , which is also demonstrated by wide experiments in Section 5 .
This paper studies the important problem of answering the question "Why does drop-out help with generalization"? The answer presented in this paper comes in two stages by relating drop-out to weight expansion and weight-expansion to generalization. They show both their claims are theoretically supported and then experimentally validate the findings on various applications that are of interest. Their findings are not entirely theoretical however, as they lead to a new method via weight expansion.
SP:fe0789263d08621ab15d9e42666bd268eb6d931f
Iterative Sketching and its Application to Federated Learning
1 INTRODUCTION . Federated learning enables multiple parties to collaboratively train a machine learning model without directly exchanging training data . This has become particularly important in areas of artificial intelligence where users care data privacy , security , and access rights , including healthcare ( Li et al. , 2020b ; 2019 ) , internet of things ( Chen et al. , 2020 ) , and fraud detection ( Zheng et al. , 2020 ) . Given the importance and popularity of federated learning , it has become an important research topic for academia and industry , mostly focusing on two central themes . One is on data privacy . Federated learning seemingly protects clients ’ privacy , since it only communicates gradient information . Unfortunately , recent studies ( Geiping et al. , 2020 ; Zhu & Han , 2020 ; Wang et al. , 2019 ) have demonstrated that attackers can recover the input data from the shared gradients . The reason why the attacks work is the gradients carry important information about the training data ( Ateniese et al. , 2015 ; Fredrikson et al. , 2015 ) . The second one is on communication efficiency . Machine learning models are becoming increasingly larger but client devices that carry private data only have limited network bandwidth . The size of the gradient is the same as the size of the model , and the amount of data to communication between the clients and the servers thus is large . This becomes even more problematic when conducting federated learning on mobile and edge devices , where the bandwidth of the network is low . The communication cost is one of the most important the key performance bottlenecks in federated learning systems Goga & Teixeira ( 2012 ) ; Konečnỳ et al . ( 2016 ) . Many works try to address this challenge through local optimization method , such as local gradient descent ( GD ) , local stochastic gradient descent ( SGD ) and their variants ( Konečnỳ et al. , 2016 ; McMahan et al. , 2017 ; Stich , 2018 ) . Despite existing efforts , no work addresses both challenges simultaneously as far as we concern . Therefore , we ask the following question : Is there a FL framework that protects the local privacy and tackles the communication challenge ? In this paper , we achieve these goals by using an old but powerful idea — the Johnson-Lindenstrauss transform and its fast variations ( Fast-JL , see Ailon & Chazelle ( 2006 ) ) . If we view the transform as a sketch matrix , and its transpose as de-sketch , then our main idea is to iteratively apply the sketch and de-sketch matrices to gradients . Instead of running the vanilla gradient descent w ( t+1 ) ← w ( t ) − η · g ( t ) using true gradient g ( t ) ∈ Rd , we apply sketch and de-sketch to the gradient : w ( t+1 ) ← w ( t ) − η ·R > ·R · g ( t ) . Here R ∈ Rbsketch×d denotes a sketching matrix that sketches the true gradient to a lower dimension andR > ∈ Rd×bsketch denotes the de-sketching process that maps the sketched gradient back to the true gradient dimension . The coordinate-wise embedding property ( Song & Yu , 2021 ) ensures R > Rg ( t ) being an unbiased estimator of g ( t ) with bounded second moments , implying the new sketched gradient descent scheme preserving the original convergence properties . Hence , all clients will only communicate sketched gradients to the server , the server averages the sketched gradients and broacasts it back to all clients . Finally , each client de-sketches the received gradients and perform local updates . Since the sketching dimension is always small compared to original dimension , we save communication cost per iteration via Johnson-Lindenstrauss . Though the communication problem has been addressed , such framework still faces privacy challenge : applying Johnson-Lindenstrauss “ masks ” the communicated gradients , but in order to give a provable privacy guarantee on this framework , we introduce additive low-dimensional Gaussian noises to make sure that the communicated vectors themselves are differential private . We summarize the contributions in this work as follows : Framework contribution : We propose a new federated learning framework that iteratively applies sketch and de-sketch matrices to gradients , which enjoys the following advantages : • Privacy : it preserves the privacy via additive low-dimensional Gaussian noise . • Communication : it reduces communication per round , since at each synchronization step , only a sketched gradient of lower-dimensional is communicated . • Convergence : it preserves the convergence rate of vanilla local gradient descent method . Technical contribution : Our analysis technique is also of independent interest in the relating areas : • Unlike classical sketch-and-solve paradigm , our iterative sketch and de-sketch method can be combined with gradient-based methods and extended to broader optimization problems . • We provide rigorous analysis on the impact of introducing sketching through coordinate-wise embedding , which can be generalized to other areas ( Song & Yu , 2021 ) . • As a by-product , we give a novel linear convergence result of local GD under the strongly-convex and smooth scheme . 2 RELATED WORK . Federated Learning Federated learning ( FL ) is an emerging framework in distributed deep learning . FL allows multiple parties or clients collaboratively train a model without data sharing . Fl let the local client perform most of the computation and a central sever update the model parameters through aggregation then transfers the parameters to local models ( Dean et al. , 2012 ; Shokri & Shmatikov , 2015 ; McMahan et al. , 2016 ; 2017 ) . In this way , the details of the data are not disclosed in between each party . Unlike the standard parallel setting , FL has three unique challenge ( Li et al. , 2020a ) , including communication cost , data heterogeneity and client robustness . In our work , we focus on the first two challenges . The training data are massively distributed over an incredibly large number of devices , and the connection between the central server and a device is slow . A direct consequence is the slow communication , which motivated communication-efficient FL algorithm . Federated average ( FedAvg ) ( McMahan et al. , 2017 ) firstly addressed the communication efficiency problem by introducing a global model to aggregate local stochastic gradient descent updates . Later , different variations and adaptations have arisen . This encompasses a myriad of possible approaches , including developing better optimization algorithms ( Wang et al. , 2020a ) and generalizing model to heterogeneous clients under special assumptions ( Zhao et al. , 2018 ; Kairouz et al. , 2019 ; Li et al. , 2021 ) . Local GD and Local SGD To seek the communication efficiency of Federated learning , local SGD has been proposed ( Konečnỳ et al. , 2016 ; McMahan et al. , 2017 ) , where each client does a few SGD iterations locally before the server averages the local estimators . Different variants of local SGD algorithms has been explored , including with momentum ( Yu et al. , 2019b ; Wang et al. , 2018 ) , with quantization ( Basu et al. , 2019 ; Reisizadeh et al. , 2020 ) , and with various variance-reduction methods ( Liang et al. , 2019 ; Karimireddy et al. , 2020 ) . Convergence analysis for local SGD mainly focuses on two regimes : identical data regime ( Stich , 2018 ; Basu et al. , 2019 ; Stich & Karimireddy , 2019 ; Haddadpour & Mahdavi , 2019 ; Khaled et al. , 2020 ) and heterogeneous data regime ( Jiang & Agrawal , 2018 ; Yu et al. , 2019a ; Basu et al. , 2019 ; Haddadpour & Mahdavi , 2019 ; Khaled et al. , 2019 ; 2020 ) . In this work , we propose our framework based upon vanilla local GD and our analysis focus on the heterogeneous data regime . Sketching Sketching has many applications in numerical linear , such as linear regression , lowrank approximation ( Clarkson & Woodruff , 2013 ; Nelson & Nguyên , 2013 ; Meng & Mahoney , 2013 ; Boutsidis & Woodruff , 2014 ; Song et al. , 2017 ; Andoni et al. , 2018 ) , distributed problems ( Woodruff & Zhong , 2016 ; Boutsidis et al. , 2016 ) , reinforcement learning Wang et al . ( 2020b ) , tensor decomposition ( Song et al. , 2019 ) , clustering ( Esfandiari et al. , 2021 ) , cutting plane method ( Jiang et al. , 2020 ) , generative adversarial networks ( Xiao et al. , 2018 ) and linear programming ( Lee et al. , 2019 ; Jiang et al. , 2021 ; Song & Yu , 2021 ) . Notations For a positive integer n , we use [ n ] to denote the set { 1 , 2 , · · · , n } . We use E [ · ] to denote expectation ( if it exists ) , and use Pr [ · ] to denote probability . For a vector x , we use ‖x‖2 : = ( ∑n i=1 x 2 i ) 1/2 to denote its ` 2 norm . We denote 1 { x=l } for l ∈ R to be the indicator function which equals to 1 if x = l and 0 otherwise . Let f : A → B and g : C → A be two functions , we use f ◦ g to denote the composition of functions f and g , i.e. , for any x ∈ C , ( f ◦ g ) ( x ) = f ( g ( x ) ) . We denote Id to be the identity mapping . 3 PROBLEM SETUP . Consider a federated learning scenario with N clients and corresponding local losses fc : Rd → R , our goal is to find min x∈Rd f ( x ) : = 1 N N∑ c=1 fc ( x ) ( 1 ) In this work , we consider the following classical convex and smooth setting for our objectives . Assumption 3.1 . Assume that the set of minimizers of ( 1 ) is nonempty . Each fc is µ-strongly convex for µ ≥ 0 and L-smooth . That is , for all x , y ∈ Rd , µ 2 ‖y − x‖22 ≤ fc ( y ) − fc ( x ) + 〈y − x , ∇fc ( x ) 〉 ≤ L 2 ‖y − x‖22 . Note in the case µ = 0 , this assumption reduces back to convexity and smoothness . Apart from the above assumption , we allow local losses to have arbitrary heterogeneity . In other words , we allow fc ’ s to be arbitrary functions . 4 OUR ALGORITHM . In this section , we propose a federated learning framework that addresses the communication efficiency issue . When the learning gradients are of high dimension , classical federated learning framework which sends the exact gradient could incur a heavy communication cost per round . Sketching technique , which emerges as an effective way to reduce the dimension of vector while preserving significant amount of information ( Sarlós , 2006 ; Woodruff , 2014 ) , is highly preferred in this setting . It enables us to compress the gradient vector into a lower dimension while preserving convergence rates , and greatly saves the communication cost per round . Motivated by above discussion , we propose the iterative sketching-based federated learning algorithm , which builds upon vanilla local gradient descent : we start with a predetermined sequence of independent sketching matrices shared across all clients . In each round , local clients accumulate and sketch its change over K local steps , then transmit the low-dimensional sketch to the server . Server then averages the sketches and transmits them back to all clients . Upon receiving , each client de-sketches to update the local model . Algorithm 1 Iterative Sketching-based Federated Learning Algorithm with K local steps 1 : procedure ITERATIVESKETCHINGFL 2 : Each client initializes w0 using the same set of random seed 3 : for t = 1→ T do . T denotes the total number of global steps 4 : / * Client * / 5 : parfor c = 1→ N do . N denotes the total number of clients 6 : if t = 1 then 7 : ut,0c ← w0 . ut,0c ∈ Rd 8 : else 9 : ut,0c ← wt−1 + deskt ( ∆w̃t−1 ) . deskt : Rbsketch → Rd de-sketch the change 10 : end if 11 : wt ← ut,0c 12 : for k = 1→ K do 13 : ut , kc ← ut , k−1c − ηlocal · ∇fc ( w ) |w=ut , k−1c 14 : end for 15 : ∆wc ( t ) ← ut , Kc − wt 16 : Client c sends skt ( ∆wc ( t ) ) to server . skt : Rd → Rbsketch sketch the change 17 : end parfor 18 : / * Server * / 19 : ∆w̃t ← ηglobal · 1N ∑N c=1 skt ( ∆wc ( t ) ) . ∆w̃ t ∈ Rd 20 : Server sends ∆w̃t to each client 21 : end for 22 : end procedure We highlight several distinct features of our algorithm : •Communication : In each sync step , we only communicates a low-dimensional sketched gradients , indicating a smaller communication cost per round . This property is particularly valuable in a smallbandwidth setting . • De-sketch : i : We emphasize that unlike the classical sketch-and-solve paradigm that decreases the problem dimension , our algorithm applies sketching in each round , combined with a de-sketching process which recovers back to the true gradient dimension . • Simple server task : : Server only needs to do simple averaging , indicating no need of a trustworthy party as the server . • Decentralization : : Our algorithm can be generalized to decentralized learning settings , where local clients can only communicate with neighboring nodes . In this case , it requiresO ( diam ) rounds to propagate the sketched local changes , where diam is the diameter of the network graph . 4.1 sk/desk VIA COORDINATE WISE EMBEDDING In this section , we discuss the concrete realization of the skt/deskt operators in Algorithm 1 through random sketching matrices . Note we should require any processed gradient deskt ◦ skt ( g ) to `` be close '' to the true gradient g to avoid breaking the convergence property of the algorithm . To achieve this , we first introduce the following property for a broad family of sketching matrices , namely coordinate-wise embedding ( Jiang et al. , 2021 ; Song & Yu , 2021 ) , that naturally connects with skt/deskt operators . Definition 4.1 ( a-coordinate-wise embedding ) . We say a randomized matrix R ∈ Rbsketch×d satisfying a-coordinate wise embedding if for any vector g , h ∈ Rd , we have ER∼Π [ h > R > Rg ] = h > g and ER∼Π [ ( h > R > Rg ) 2 ] ≤ ( h > g ) 2 + absketch ‖h‖ 2 2 · ‖g‖22 . iWe elaborate the difference of our iterative sketch and de-sketch approach compared to classical sketchand-solve approaches in Section 4.2 . In general , well-known sketching matrices have their coordinate-wise embedding parameter a being a small constant ( See Section D ) . Note that if we choose h to be one-hot vector ei , then the above conditions translate to ER∼Π [ R > Rg ] = g and ER∼Π [ ‖R > Rg‖22 ] ≤ ( 1 + a · dbsketch ) · ‖g‖ 2 2 . This implies that by choosing skt = Rt ∈ Rbsketch×d ( sketching ) , deskt = R > t ∈ Rd×bsketch ( de-sketching ) ( 2 ) for any iteration t ≥ 1 , where Rt ’ s are independent random matrices with sketching dimension bsketch , we obtain an unbiased sketching/de-sketching scheme with bounded variance as state in the following Theorem 4.2 . Theorem 4.2 . Let skt and deskt be defined by Eq . ( 2 ) using a sequence of independent sketching matrices Rt ∈ Rbsketch×d satisfying a-coordinate wise embedding property ( Def . 4.1 ) . Then the following properties hold : 1 . Independence : For different iterations , ( skt , deskt ) ’ s are independent of each other . 2 . Linearity : Both skt and deskt are linear operators . 3 . Unbiased estimator : For any fixed vector h ∈ Rd , it holds E [ deskt ( skt ( h ) ) ] = h. 4 . Bounded second moment : For any fixed vector h ∈ Rd , it holds E [ ‖deskt ( skt ( h ) ) ‖22 ] ≤ ( 1 + a · d/bsketch ) · ‖h‖22 . We will use the above property to instantiate the convergent proof and communication complexity in section 5 . We remark that unlike traditional sketching matrix R , one can intuitively think of matrix R > as a “ de-sketch ” matrix , it undoes sketching and recovers the sketched vector to original dimension .
This paper proposes a sketching-based federated learning algorithm to address the communication and privacy concerns in the federated learning setting. In the proposed algorithm, each client projects its local update (gradient) to a lower dimension via a sketching matrix before communicating the update to the server. The server aggregates the sketched local updates from different clients and communicates the aggregated update to the clients. The clients then de-sketch the message received from the server to update their local model. The paper shows that if the sketching matrix satisfies the "coordinate-wise embedding" property, then the proposed algorithm leads to provable convergence for smooth and convex objective functions. The paper also discusses the issue of privacy and proposes to add Gaussian noise to the sketched gradients to claim differential privacy of the resulting learning algorithm.
SP:986563ff3245ba9f2e701bc5f288e2df3bdc2ad2
Iterative Sketching and its Application to Federated Learning
1 INTRODUCTION . Federated learning enables multiple parties to collaboratively train a machine learning model without directly exchanging training data . This has become particularly important in areas of artificial intelligence where users care data privacy , security , and access rights , including healthcare ( Li et al. , 2020b ; 2019 ) , internet of things ( Chen et al. , 2020 ) , and fraud detection ( Zheng et al. , 2020 ) . Given the importance and popularity of federated learning , it has become an important research topic for academia and industry , mostly focusing on two central themes . One is on data privacy . Federated learning seemingly protects clients ’ privacy , since it only communicates gradient information . Unfortunately , recent studies ( Geiping et al. , 2020 ; Zhu & Han , 2020 ; Wang et al. , 2019 ) have demonstrated that attackers can recover the input data from the shared gradients . The reason why the attacks work is the gradients carry important information about the training data ( Ateniese et al. , 2015 ; Fredrikson et al. , 2015 ) . The second one is on communication efficiency . Machine learning models are becoming increasingly larger but client devices that carry private data only have limited network bandwidth . The size of the gradient is the same as the size of the model , and the amount of data to communication between the clients and the servers thus is large . This becomes even more problematic when conducting federated learning on mobile and edge devices , where the bandwidth of the network is low . The communication cost is one of the most important the key performance bottlenecks in federated learning systems Goga & Teixeira ( 2012 ) ; Konečnỳ et al . ( 2016 ) . Many works try to address this challenge through local optimization method , such as local gradient descent ( GD ) , local stochastic gradient descent ( SGD ) and their variants ( Konečnỳ et al. , 2016 ; McMahan et al. , 2017 ; Stich , 2018 ) . Despite existing efforts , no work addresses both challenges simultaneously as far as we concern . Therefore , we ask the following question : Is there a FL framework that protects the local privacy and tackles the communication challenge ? In this paper , we achieve these goals by using an old but powerful idea — the Johnson-Lindenstrauss transform and its fast variations ( Fast-JL , see Ailon & Chazelle ( 2006 ) ) . If we view the transform as a sketch matrix , and its transpose as de-sketch , then our main idea is to iteratively apply the sketch and de-sketch matrices to gradients . Instead of running the vanilla gradient descent w ( t+1 ) ← w ( t ) − η · g ( t ) using true gradient g ( t ) ∈ Rd , we apply sketch and de-sketch to the gradient : w ( t+1 ) ← w ( t ) − η ·R > ·R · g ( t ) . Here R ∈ Rbsketch×d denotes a sketching matrix that sketches the true gradient to a lower dimension andR > ∈ Rd×bsketch denotes the de-sketching process that maps the sketched gradient back to the true gradient dimension . The coordinate-wise embedding property ( Song & Yu , 2021 ) ensures R > Rg ( t ) being an unbiased estimator of g ( t ) with bounded second moments , implying the new sketched gradient descent scheme preserving the original convergence properties . Hence , all clients will only communicate sketched gradients to the server , the server averages the sketched gradients and broacasts it back to all clients . Finally , each client de-sketches the received gradients and perform local updates . Since the sketching dimension is always small compared to original dimension , we save communication cost per iteration via Johnson-Lindenstrauss . Though the communication problem has been addressed , such framework still faces privacy challenge : applying Johnson-Lindenstrauss “ masks ” the communicated gradients , but in order to give a provable privacy guarantee on this framework , we introduce additive low-dimensional Gaussian noises to make sure that the communicated vectors themselves are differential private . We summarize the contributions in this work as follows : Framework contribution : We propose a new federated learning framework that iteratively applies sketch and de-sketch matrices to gradients , which enjoys the following advantages : • Privacy : it preserves the privacy via additive low-dimensional Gaussian noise . • Communication : it reduces communication per round , since at each synchronization step , only a sketched gradient of lower-dimensional is communicated . • Convergence : it preserves the convergence rate of vanilla local gradient descent method . Technical contribution : Our analysis technique is also of independent interest in the relating areas : • Unlike classical sketch-and-solve paradigm , our iterative sketch and de-sketch method can be combined with gradient-based methods and extended to broader optimization problems . • We provide rigorous analysis on the impact of introducing sketching through coordinate-wise embedding , which can be generalized to other areas ( Song & Yu , 2021 ) . • As a by-product , we give a novel linear convergence result of local GD under the strongly-convex and smooth scheme . 2 RELATED WORK . Federated Learning Federated learning ( FL ) is an emerging framework in distributed deep learning . FL allows multiple parties or clients collaboratively train a model without data sharing . Fl let the local client perform most of the computation and a central sever update the model parameters through aggregation then transfers the parameters to local models ( Dean et al. , 2012 ; Shokri & Shmatikov , 2015 ; McMahan et al. , 2016 ; 2017 ) . In this way , the details of the data are not disclosed in between each party . Unlike the standard parallel setting , FL has three unique challenge ( Li et al. , 2020a ) , including communication cost , data heterogeneity and client robustness . In our work , we focus on the first two challenges . The training data are massively distributed over an incredibly large number of devices , and the connection between the central server and a device is slow . A direct consequence is the slow communication , which motivated communication-efficient FL algorithm . Federated average ( FedAvg ) ( McMahan et al. , 2017 ) firstly addressed the communication efficiency problem by introducing a global model to aggregate local stochastic gradient descent updates . Later , different variations and adaptations have arisen . This encompasses a myriad of possible approaches , including developing better optimization algorithms ( Wang et al. , 2020a ) and generalizing model to heterogeneous clients under special assumptions ( Zhao et al. , 2018 ; Kairouz et al. , 2019 ; Li et al. , 2021 ) . Local GD and Local SGD To seek the communication efficiency of Federated learning , local SGD has been proposed ( Konečnỳ et al. , 2016 ; McMahan et al. , 2017 ) , where each client does a few SGD iterations locally before the server averages the local estimators . Different variants of local SGD algorithms has been explored , including with momentum ( Yu et al. , 2019b ; Wang et al. , 2018 ) , with quantization ( Basu et al. , 2019 ; Reisizadeh et al. , 2020 ) , and with various variance-reduction methods ( Liang et al. , 2019 ; Karimireddy et al. , 2020 ) . Convergence analysis for local SGD mainly focuses on two regimes : identical data regime ( Stich , 2018 ; Basu et al. , 2019 ; Stich & Karimireddy , 2019 ; Haddadpour & Mahdavi , 2019 ; Khaled et al. , 2020 ) and heterogeneous data regime ( Jiang & Agrawal , 2018 ; Yu et al. , 2019a ; Basu et al. , 2019 ; Haddadpour & Mahdavi , 2019 ; Khaled et al. , 2019 ; 2020 ) . In this work , we propose our framework based upon vanilla local GD and our analysis focus on the heterogeneous data regime . Sketching Sketching has many applications in numerical linear , such as linear regression , lowrank approximation ( Clarkson & Woodruff , 2013 ; Nelson & Nguyên , 2013 ; Meng & Mahoney , 2013 ; Boutsidis & Woodruff , 2014 ; Song et al. , 2017 ; Andoni et al. , 2018 ) , distributed problems ( Woodruff & Zhong , 2016 ; Boutsidis et al. , 2016 ) , reinforcement learning Wang et al . ( 2020b ) , tensor decomposition ( Song et al. , 2019 ) , clustering ( Esfandiari et al. , 2021 ) , cutting plane method ( Jiang et al. , 2020 ) , generative adversarial networks ( Xiao et al. , 2018 ) and linear programming ( Lee et al. , 2019 ; Jiang et al. , 2021 ; Song & Yu , 2021 ) . Notations For a positive integer n , we use [ n ] to denote the set { 1 , 2 , · · · , n } . We use E [ · ] to denote expectation ( if it exists ) , and use Pr [ · ] to denote probability . For a vector x , we use ‖x‖2 : = ( ∑n i=1 x 2 i ) 1/2 to denote its ` 2 norm . We denote 1 { x=l } for l ∈ R to be the indicator function which equals to 1 if x = l and 0 otherwise . Let f : A → B and g : C → A be two functions , we use f ◦ g to denote the composition of functions f and g , i.e. , for any x ∈ C , ( f ◦ g ) ( x ) = f ( g ( x ) ) . We denote Id to be the identity mapping . 3 PROBLEM SETUP . Consider a federated learning scenario with N clients and corresponding local losses fc : Rd → R , our goal is to find min x∈Rd f ( x ) : = 1 N N∑ c=1 fc ( x ) ( 1 ) In this work , we consider the following classical convex and smooth setting for our objectives . Assumption 3.1 . Assume that the set of minimizers of ( 1 ) is nonempty . Each fc is µ-strongly convex for µ ≥ 0 and L-smooth . That is , for all x , y ∈ Rd , µ 2 ‖y − x‖22 ≤ fc ( y ) − fc ( x ) + 〈y − x , ∇fc ( x ) 〉 ≤ L 2 ‖y − x‖22 . Note in the case µ = 0 , this assumption reduces back to convexity and smoothness . Apart from the above assumption , we allow local losses to have arbitrary heterogeneity . In other words , we allow fc ’ s to be arbitrary functions . 4 OUR ALGORITHM . In this section , we propose a federated learning framework that addresses the communication efficiency issue . When the learning gradients are of high dimension , classical federated learning framework which sends the exact gradient could incur a heavy communication cost per round . Sketching technique , which emerges as an effective way to reduce the dimension of vector while preserving significant amount of information ( Sarlós , 2006 ; Woodruff , 2014 ) , is highly preferred in this setting . It enables us to compress the gradient vector into a lower dimension while preserving convergence rates , and greatly saves the communication cost per round . Motivated by above discussion , we propose the iterative sketching-based federated learning algorithm , which builds upon vanilla local gradient descent : we start with a predetermined sequence of independent sketching matrices shared across all clients . In each round , local clients accumulate and sketch its change over K local steps , then transmit the low-dimensional sketch to the server . Server then averages the sketches and transmits them back to all clients . Upon receiving , each client de-sketches to update the local model . Algorithm 1 Iterative Sketching-based Federated Learning Algorithm with K local steps 1 : procedure ITERATIVESKETCHINGFL 2 : Each client initializes w0 using the same set of random seed 3 : for t = 1→ T do . T denotes the total number of global steps 4 : / * Client * / 5 : parfor c = 1→ N do . N denotes the total number of clients 6 : if t = 1 then 7 : ut,0c ← w0 . ut,0c ∈ Rd 8 : else 9 : ut,0c ← wt−1 + deskt ( ∆w̃t−1 ) . deskt : Rbsketch → Rd de-sketch the change 10 : end if 11 : wt ← ut,0c 12 : for k = 1→ K do 13 : ut , kc ← ut , k−1c − ηlocal · ∇fc ( w ) |w=ut , k−1c 14 : end for 15 : ∆wc ( t ) ← ut , Kc − wt 16 : Client c sends skt ( ∆wc ( t ) ) to server . skt : Rd → Rbsketch sketch the change 17 : end parfor 18 : / * Server * / 19 : ∆w̃t ← ηglobal · 1N ∑N c=1 skt ( ∆wc ( t ) ) . ∆w̃ t ∈ Rd 20 : Server sends ∆w̃t to each client 21 : end for 22 : end procedure We highlight several distinct features of our algorithm : •Communication : In each sync step , we only communicates a low-dimensional sketched gradients , indicating a smaller communication cost per round . This property is particularly valuable in a smallbandwidth setting . • De-sketch : i : We emphasize that unlike the classical sketch-and-solve paradigm that decreases the problem dimension , our algorithm applies sketching in each round , combined with a de-sketching process which recovers back to the true gradient dimension . • Simple server task : : Server only needs to do simple averaging , indicating no need of a trustworthy party as the server . • Decentralization : : Our algorithm can be generalized to decentralized learning settings , where local clients can only communicate with neighboring nodes . In this case , it requiresO ( diam ) rounds to propagate the sketched local changes , where diam is the diameter of the network graph . 4.1 sk/desk VIA COORDINATE WISE EMBEDDING In this section , we discuss the concrete realization of the skt/deskt operators in Algorithm 1 through random sketching matrices . Note we should require any processed gradient deskt ◦ skt ( g ) to `` be close '' to the true gradient g to avoid breaking the convergence property of the algorithm . To achieve this , we first introduce the following property for a broad family of sketching matrices , namely coordinate-wise embedding ( Jiang et al. , 2021 ; Song & Yu , 2021 ) , that naturally connects with skt/deskt operators . Definition 4.1 ( a-coordinate-wise embedding ) . We say a randomized matrix R ∈ Rbsketch×d satisfying a-coordinate wise embedding if for any vector g , h ∈ Rd , we have ER∼Π [ h > R > Rg ] = h > g and ER∼Π [ ( h > R > Rg ) 2 ] ≤ ( h > g ) 2 + absketch ‖h‖ 2 2 · ‖g‖22 . iWe elaborate the difference of our iterative sketch and de-sketch approach compared to classical sketchand-solve approaches in Section 4.2 . In general , well-known sketching matrices have their coordinate-wise embedding parameter a being a small constant ( See Section D ) . Note that if we choose h to be one-hot vector ei , then the above conditions translate to ER∼Π [ R > Rg ] = g and ER∼Π [ ‖R > Rg‖22 ] ≤ ( 1 + a · dbsketch ) · ‖g‖ 2 2 . This implies that by choosing skt = Rt ∈ Rbsketch×d ( sketching ) , deskt = R > t ∈ Rd×bsketch ( de-sketching ) ( 2 ) for any iteration t ≥ 1 , where Rt ’ s are independent random matrices with sketching dimension bsketch , we obtain an unbiased sketching/de-sketching scheme with bounded variance as state in the following Theorem 4.2 . Theorem 4.2 . Let skt and deskt be defined by Eq . ( 2 ) using a sequence of independent sketching matrices Rt ∈ Rbsketch×d satisfying a-coordinate wise embedding property ( Def . 4.1 ) . Then the following properties hold : 1 . Independence : For different iterations , ( skt , deskt ) ’ s are independent of each other . 2 . Linearity : Both skt and deskt are linear operators . 3 . Unbiased estimator : For any fixed vector h ∈ Rd , it holds E [ deskt ( skt ( h ) ) ] = h. 4 . Bounded second moment : For any fixed vector h ∈ Rd , it holds E [ ‖deskt ( skt ( h ) ) ‖22 ] ≤ ( 1 + a · d/bsketch ) · ‖h‖22 . We will use the above property to instantiate the convergent proof and communication complexity in section 5 . We remark that unlike traditional sketching matrix R , one can intuitively think of matrix R > as a “ de-sketch ” matrix , it undoes sketching and recovers the sketched vector to original dimension .
This paper proposes a novel federated learning framework where the client only submits a sketched gradient to the server and de-sketches the average gradient received from the server. The proposed framework can preserve the privacy of the data as well as reduce the communication cost. The paper theoretically analyzes the convergence rate and shows that the proposed method requires less communication cost than existing methods.
SP:986563ff3245ba9f2e701bc5f288e2df3bdc2ad2
Iterative Sketching and its Application to Federated Learning
1 INTRODUCTION . Federated learning enables multiple parties to collaboratively train a machine learning model without directly exchanging training data . This has become particularly important in areas of artificial intelligence where users care data privacy , security , and access rights , including healthcare ( Li et al. , 2020b ; 2019 ) , internet of things ( Chen et al. , 2020 ) , and fraud detection ( Zheng et al. , 2020 ) . Given the importance and popularity of federated learning , it has become an important research topic for academia and industry , mostly focusing on two central themes . One is on data privacy . Federated learning seemingly protects clients ’ privacy , since it only communicates gradient information . Unfortunately , recent studies ( Geiping et al. , 2020 ; Zhu & Han , 2020 ; Wang et al. , 2019 ) have demonstrated that attackers can recover the input data from the shared gradients . The reason why the attacks work is the gradients carry important information about the training data ( Ateniese et al. , 2015 ; Fredrikson et al. , 2015 ) . The second one is on communication efficiency . Machine learning models are becoming increasingly larger but client devices that carry private data only have limited network bandwidth . The size of the gradient is the same as the size of the model , and the amount of data to communication between the clients and the servers thus is large . This becomes even more problematic when conducting federated learning on mobile and edge devices , where the bandwidth of the network is low . The communication cost is one of the most important the key performance bottlenecks in federated learning systems Goga & Teixeira ( 2012 ) ; Konečnỳ et al . ( 2016 ) . Many works try to address this challenge through local optimization method , such as local gradient descent ( GD ) , local stochastic gradient descent ( SGD ) and their variants ( Konečnỳ et al. , 2016 ; McMahan et al. , 2017 ; Stich , 2018 ) . Despite existing efforts , no work addresses both challenges simultaneously as far as we concern . Therefore , we ask the following question : Is there a FL framework that protects the local privacy and tackles the communication challenge ? In this paper , we achieve these goals by using an old but powerful idea — the Johnson-Lindenstrauss transform and its fast variations ( Fast-JL , see Ailon & Chazelle ( 2006 ) ) . If we view the transform as a sketch matrix , and its transpose as de-sketch , then our main idea is to iteratively apply the sketch and de-sketch matrices to gradients . Instead of running the vanilla gradient descent w ( t+1 ) ← w ( t ) − η · g ( t ) using true gradient g ( t ) ∈ Rd , we apply sketch and de-sketch to the gradient : w ( t+1 ) ← w ( t ) − η ·R > ·R · g ( t ) . Here R ∈ Rbsketch×d denotes a sketching matrix that sketches the true gradient to a lower dimension andR > ∈ Rd×bsketch denotes the de-sketching process that maps the sketched gradient back to the true gradient dimension . The coordinate-wise embedding property ( Song & Yu , 2021 ) ensures R > Rg ( t ) being an unbiased estimator of g ( t ) with bounded second moments , implying the new sketched gradient descent scheme preserving the original convergence properties . Hence , all clients will only communicate sketched gradients to the server , the server averages the sketched gradients and broacasts it back to all clients . Finally , each client de-sketches the received gradients and perform local updates . Since the sketching dimension is always small compared to original dimension , we save communication cost per iteration via Johnson-Lindenstrauss . Though the communication problem has been addressed , such framework still faces privacy challenge : applying Johnson-Lindenstrauss “ masks ” the communicated gradients , but in order to give a provable privacy guarantee on this framework , we introduce additive low-dimensional Gaussian noises to make sure that the communicated vectors themselves are differential private . We summarize the contributions in this work as follows : Framework contribution : We propose a new federated learning framework that iteratively applies sketch and de-sketch matrices to gradients , which enjoys the following advantages : • Privacy : it preserves the privacy via additive low-dimensional Gaussian noise . • Communication : it reduces communication per round , since at each synchronization step , only a sketched gradient of lower-dimensional is communicated . • Convergence : it preserves the convergence rate of vanilla local gradient descent method . Technical contribution : Our analysis technique is also of independent interest in the relating areas : • Unlike classical sketch-and-solve paradigm , our iterative sketch and de-sketch method can be combined with gradient-based methods and extended to broader optimization problems . • We provide rigorous analysis on the impact of introducing sketching through coordinate-wise embedding , which can be generalized to other areas ( Song & Yu , 2021 ) . • As a by-product , we give a novel linear convergence result of local GD under the strongly-convex and smooth scheme . 2 RELATED WORK . Federated Learning Federated learning ( FL ) is an emerging framework in distributed deep learning . FL allows multiple parties or clients collaboratively train a model without data sharing . Fl let the local client perform most of the computation and a central sever update the model parameters through aggregation then transfers the parameters to local models ( Dean et al. , 2012 ; Shokri & Shmatikov , 2015 ; McMahan et al. , 2016 ; 2017 ) . In this way , the details of the data are not disclosed in between each party . Unlike the standard parallel setting , FL has three unique challenge ( Li et al. , 2020a ) , including communication cost , data heterogeneity and client robustness . In our work , we focus on the first two challenges . The training data are massively distributed over an incredibly large number of devices , and the connection between the central server and a device is slow . A direct consequence is the slow communication , which motivated communication-efficient FL algorithm . Federated average ( FedAvg ) ( McMahan et al. , 2017 ) firstly addressed the communication efficiency problem by introducing a global model to aggregate local stochastic gradient descent updates . Later , different variations and adaptations have arisen . This encompasses a myriad of possible approaches , including developing better optimization algorithms ( Wang et al. , 2020a ) and generalizing model to heterogeneous clients under special assumptions ( Zhao et al. , 2018 ; Kairouz et al. , 2019 ; Li et al. , 2021 ) . Local GD and Local SGD To seek the communication efficiency of Federated learning , local SGD has been proposed ( Konečnỳ et al. , 2016 ; McMahan et al. , 2017 ) , where each client does a few SGD iterations locally before the server averages the local estimators . Different variants of local SGD algorithms has been explored , including with momentum ( Yu et al. , 2019b ; Wang et al. , 2018 ) , with quantization ( Basu et al. , 2019 ; Reisizadeh et al. , 2020 ) , and with various variance-reduction methods ( Liang et al. , 2019 ; Karimireddy et al. , 2020 ) . Convergence analysis for local SGD mainly focuses on two regimes : identical data regime ( Stich , 2018 ; Basu et al. , 2019 ; Stich & Karimireddy , 2019 ; Haddadpour & Mahdavi , 2019 ; Khaled et al. , 2020 ) and heterogeneous data regime ( Jiang & Agrawal , 2018 ; Yu et al. , 2019a ; Basu et al. , 2019 ; Haddadpour & Mahdavi , 2019 ; Khaled et al. , 2019 ; 2020 ) . In this work , we propose our framework based upon vanilla local GD and our analysis focus on the heterogeneous data regime . Sketching Sketching has many applications in numerical linear , such as linear regression , lowrank approximation ( Clarkson & Woodruff , 2013 ; Nelson & Nguyên , 2013 ; Meng & Mahoney , 2013 ; Boutsidis & Woodruff , 2014 ; Song et al. , 2017 ; Andoni et al. , 2018 ) , distributed problems ( Woodruff & Zhong , 2016 ; Boutsidis et al. , 2016 ) , reinforcement learning Wang et al . ( 2020b ) , tensor decomposition ( Song et al. , 2019 ) , clustering ( Esfandiari et al. , 2021 ) , cutting plane method ( Jiang et al. , 2020 ) , generative adversarial networks ( Xiao et al. , 2018 ) and linear programming ( Lee et al. , 2019 ; Jiang et al. , 2021 ; Song & Yu , 2021 ) . Notations For a positive integer n , we use [ n ] to denote the set { 1 , 2 , · · · , n } . We use E [ · ] to denote expectation ( if it exists ) , and use Pr [ · ] to denote probability . For a vector x , we use ‖x‖2 : = ( ∑n i=1 x 2 i ) 1/2 to denote its ` 2 norm . We denote 1 { x=l } for l ∈ R to be the indicator function which equals to 1 if x = l and 0 otherwise . Let f : A → B and g : C → A be two functions , we use f ◦ g to denote the composition of functions f and g , i.e. , for any x ∈ C , ( f ◦ g ) ( x ) = f ( g ( x ) ) . We denote Id to be the identity mapping . 3 PROBLEM SETUP . Consider a federated learning scenario with N clients and corresponding local losses fc : Rd → R , our goal is to find min x∈Rd f ( x ) : = 1 N N∑ c=1 fc ( x ) ( 1 ) In this work , we consider the following classical convex and smooth setting for our objectives . Assumption 3.1 . Assume that the set of minimizers of ( 1 ) is nonempty . Each fc is µ-strongly convex for µ ≥ 0 and L-smooth . That is , for all x , y ∈ Rd , µ 2 ‖y − x‖22 ≤ fc ( y ) − fc ( x ) + 〈y − x , ∇fc ( x ) 〉 ≤ L 2 ‖y − x‖22 . Note in the case µ = 0 , this assumption reduces back to convexity and smoothness . Apart from the above assumption , we allow local losses to have arbitrary heterogeneity . In other words , we allow fc ’ s to be arbitrary functions . 4 OUR ALGORITHM . In this section , we propose a federated learning framework that addresses the communication efficiency issue . When the learning gradients are of high dimension , classical federated learning framework which sends the exact gradient could incur a heavy communication cost per round . Sketching technique , which emerges as an effective way to reduce the dimension of vector while preserving significant amount of information ( Sarlós , 2006 ; Woodruff , 2014 ) , is highly preferred in this setting . It enables us to compress the gradient vector into a lower dimension while preserving convergence rates , and greatly saves the communication cost per round . Motivated by above discussion , we propose the iterative sketching-based federated learning algorithm , which builds upon vanilla local gradient descent : we start with a predetermined sequence of independent sketching matrices shared across all clients . In each round , local clients accumulate and sketch its change over K local steps , then transmit the low-dimensional sketch to the server . Server then averages the sketches and transmits them back to all clients . Upon receiving , each client de-sketches to update the local model . Algorithm 1 Iterative Sketching-based Federated Learning Algorithm with K local steps 1 : procedure ITERATIVESKETCHINGFL 2 : Each client initializes w0 using the same set of random seed 3 : for t = 1→ T do . T denotes the total number of global steps 4 : / * Client * / 5 : parfor c = 1→ N do . N denotes the total number of clients 6 : if t = 1 then 7 : ut,0c ← w0 . ut,0c ∈ Rd 8 : else 9 : ut,0c ← wt−1 + deskt ( ∆w̃t−1 ) . deskt : Rbsketch → Rd de-sketch the change 10 : end if 11 : wt ← ut,0c 12 : for k = 1→ K do 13 : ut , kc ← ut , k−1c − ηlocal · ∇fc ( w ) |w=ut , k−1c 14 : end for 15 : ∆wc ( t ) ← ut , Kc − wt 16 : Client c sends skt ( ∆wc ( t ) ) to server . skt : Rd → Rbsketch sketch the change 17 : end parfor 18 : / * Server * / 19 : ∆w̃t ← ηglobal · 1N ∑N c=1 skt ( ∆wc ( t ) ) . ∆w̃ t ∈ Rd 20 : Server sends ∆w̃t to each client 21 : end for 22 : end procedure We highlight several distinct features of our algorithm : •Communication : In each sync step , we only communicates a low-dimensional sketched gradients , indicating a smaller communication cost per round . This property is particularly valuable in a smallbandwidth setting . • De-sketch : i : We emphasize that unlike the classical sketch-and-solve paradigm that decreases the problem dimension , our algorithm applies sketching in each round , combined with a de-sketching process which recovers back to the true gradient dimension . • Simple server task : : Server only needs to do simple averaging , indicating no need of a trustworthy party as the server . • Decentralization : : Our algorithm can be generalized to decentralized learning settings , where local clients can only communicate with neighboring nodes . In this case , it requiresO ( diam ) rounds to propagate the sketched local changes , where diam is the diameter of the network graph . 4.1 sk/desk VIA COORDINATE WISE EMBEDDING In this section , we discuss the concrete realization of the skt/deskt operators in Algorithm 1 through random sketching matrices . Note we should require any processed gradient deskt ◦ skt ( g ) to `` be close '' to the true gradient g to avoid breaking the convergence property of the algorithm . To achieve this , we first introduce the following property for a broad family of sketching matrices , namely coordinate-wise embedding ( Jiang et al. , 2021 ; Song & Yu , 2021 ) , that naturally connects with skt/deskt operators . Definition 4.1 ( a-coordinate-wise embedding ) . We say a randomized matrix R ∈ Rbsketch×d satisfying a-coordinate wise embedding if for any vector g , h ∈ Rd , we have ER∼Π [ h > R > Rg ] = h > g and ER∼Π [ ( h > R > Rg ) 2 ] ≤ ( h > g ) 2 + absketch ‖h‖ 2 2 · ‖g‖22 . iWe elaborate the difference of our iterative sketch and de-sketch approach compared to classical sketchand-solve approaches in Section 4.2 . In general , well-known sketching matrices have their coordinate-wise embedding parameter a being a small constant ( See Section D ) . Note that if we choose h to be one-hot vector ei , then the above conditions translate to ER∼Π [ R > Rg ] = g and ER∼Π [ ‖R > Rg‖22 ] ≤ ( 1 + a · dbsketch ) · ‖g‖ 2 2 . This implies that by choosing skt = Rt ∈ Rbsketch×d ( sketching ) , deskt = R > t ∈ Rd×bsketch ( de-sketching ) ( 2 ) for any iteration t ≥ 1 , where Rt ’ s are independent random matrices with sketching dimension bsketch , we obtain an unbiased sketching/de-sketching scheme with bounded variance as state in the following Theorem 4.2 . Theorem 4.2 . Let skt and deskt be defined by Eq . ( 2 ) using a sequence of independent sketching matrices Rt ∈ Rbsketch×d satisfying a-coordinate wise embedding property ( Def . 4.1 ) . Then the following properties hold : 1 . Independence : For different iterations , ( skt , deskt ) ’ s are independent of each other . 2 . Linearity : Both skt and deskt are linear operators . 3 . Unbiased estimator : For any fixed vector h ∈ Rd , it holds E [ deskt ( skt ( h ) ) ] = h. 4 . Bounded second moment : For any fixed vector h ∈ Rd , it holds E [ ‖deskt ( skt ( h ) ) ‖22 ] ≤ ( 1 + a · d/bsketch ) · ‖h‖22 . We will use the above property to instantiate the convergent proof and communication complexity in section 5 . We remark that unlike traditional sketching matrix R , one can intuitively think of matrix R > as a “ de-sketch ” matrix , it undoes sketching and recovers the sketched vector to original dimension .
The paper studies the application of linear sketching algorithms to reduce the communication complexity in federated Learning problems. In particular, the paper proposes that the clients send a low-dimensional linear sketch of their updates to the server. Convergence rate of local SGD when deployed with such a method for aggregating the updates are discussed for various function classes. Finally, the paper also discusses a method for integrating differentially privacy guarantees in their method.
SP:986563ff3245ba9f2e701bc5f288e2df3bdc2ad2
Fast AdvProp
1 INTRODUCTION . Deep neural networks are highly successful for visual recognition . As fueled by powerful computational resources and massive amounts of data , deep networks achieve compelling , sometimes even superhuman , performance on a wide range of visual benchmarks . However , when testing out of the box , these exemplary models are usually get criticized for lacking generalization/robustness—an increasing amount of works point out that deep neural networks are brittle at handling out-of-domain situations like natural image corruptions ( Hendrycks & Dietterich , 2018 ) , images with shifted styles ( Geirhos et al. , 2018 ; Hendrycks et al. , 2020 ) , etc . Adversarial propagation ( AdvProp ) ( Xie et al. , 2020 ) , which additionally feeds networks with adversarial examples during training , emerged as one of the most effective ways to train not only accurate but also robust deep neural networks . The key in AdvProp is to apply separate batch normalization ( BN ) layers ( Ioffe & Szegedy , 2015 ) to clean training samples and adversarial training samples , as they come from different underlying distributions . Later works further explore the potential of AdvProp on other learning tasks , including object detection ( Chen et al. , 2021b ; Xu et al. , 2021 ) , contrastive learning ( Jiang et al. , 2020 ; Ho & Vasconcelos , 2020 ; Xu & Yang , 2020 ) and large-batch training ( Liu et al. , 2022 ) . However , the benefits brought by AdvProp do not come for “ free ” —AdvProp introduces a significant amount of additional training cost , which is mainly incurred by generating and augmenting adversarial training samples . For instance , compared to the vanilla training baseline ( where only clean images are involved ) , the default setting in AdvProp ( Xie et al. , 2020 ) increase the total computational cost by factor of 7 , i.e. , 5/7 from generating adversarial examples , 1/7 from training adversarial examples , 1/7 from training clean images . This extremely high training cost not only limits the further explorations of AdvProp on larger networks ( Xie et al. , 2019 ; Brock et al. , 2021 ; Dosovitskiy et al. , 2020 ) , with larger datasets ( Sun et al. , 2017 ; Kuznetsova et al. , 2020 ) , and for different learning tasks , but also makes the direct comparisons against other low-cost learning algorithms ( Zhang et al. , 2018 ; DeVries & Taylor , 2017 ; Yun et al. , 2019 ; Cubuk et al. , 2019b ; a ) seemingly unfair . Sampled Batch + R an d o m N o is e Model Input “ Free ” operation Heavy operation Forward & Backward Clean Image Adversarial Image Image w/ Noise Sampled Batch Model Input ( a ) AdvProp ( b ) Fast AdvProp … Figure 1 : Comparison between AdvProp and Fast AdvProp . ( a ) AdvProp generates a paired adversarial image ( with color orange ) for each clean image ( with color blue ) in the sampled batch , therefore incurring heavy training cost . Moreover , in addition to clean images , adversarial images are also fed into networks for training , therefore further increasing the total training cost , i.e. , 2x data is used here compared to the vanilla training . ( b ) Different from AdvProp , Fast AdvProp only uses a small portion of the sampled batch to generate adversarial examples . Moreover , during the generation of adversarial images , the gradient calculation of input images and the gradient calculation of network parameters are merged into the same forward and backward pass as in ( Shafahi et al. , 2019 ; Zhang et al. , 2019 ) , therefore making generating adversarial examples for “ free ” . In this paper , we present Fast AdvProp , which can run as cheaply as the vanilla training baseline in practice . In particular , noting the most costly training components in AdvProp are ( 1 ) generating adversarial examples where multiple forward passes and backward passes are additionally required , and ( 2 ) training with both clean samples and their adversarial counterparts therefore the size of training data gets doubled , Fast AdvProp revamps the original training pipeline as the following : • Firstly , though both clean training samples and their adversarial counterparts are default components in traditional adversarial training ( Goodfellow et al. , 2015 ; Kurakin et al. , 2017 ) , we argue such pairing behavior is not a fundamental request by AdvProp . Specifically , in Fast AdvProp , we reposition adversarial examples solely as a bonus part for network training , i.e. , networks now are expected to train with a mixture of a large portion of clean images and a small portion of adversarial examples . This adjustment on training data helps lower down training cost . Though the total number of adversarial training examples is reduced , our empirical results verify this strategy is sufficient to let networks gain robust feature representations . • Secondly , we integrate the recent techniques on accelerating adversarial training ( Wong et al. , 2020 ; Zhang et al. , 2019 ; Shafahi et al. , 2019 ) into AdvProp , mainly for reducing the complexity of generating adversarial examples . However , this is non-trivial—naively adopting these fast adversarial training techniques will collapse the training , resulting in suboptimal model performance . We identify such failure is caused by the “ label leaking ” effect ( Kurakin et al. , 2017 ) , which largely weakens the regularization power imposed by adversarial training samples . We further note this leakage comes from the intra-batch communication among training samples in the same mini-batch , and resolve it via shuffling BN ( He et al. , 2020 ) . Additionally , we find a ) re-balancing the importance between clean training samples and adversarial training samples and b ) synchronizing parameter updating speed are the other two key ingredients for ensuring Fast AdvProp ’ s improvements . Our empirical results demonstrate that Fast AdvProp can successfully improve recognition models for “ free ” . For instance , without incurring any extra training cost , Fast AdvProp helps ResNet-50 ( He et al. , 2016 ) outperforms its vanilla counterpart by 0.3 % on ImageNet , 2.1 % on ImageNet-C , 1.9 % on ImageNet-R and 0.5 % on Stylized-ImageNet . Furthermore , such “ free lunch ” can consistently be observed when Fast AdvProp is applied to networks at different scales , combined with various data augmentation strategies , and adapted to other recognition tasks . By easing the computational barriers , we hope this work can encourage the community to further explore the potential of AdvProp ( or adversarial learning in general ) on developing better deep learning models . 2 RELATED WORK . Adversarial training . Adversarial training ( Szegedy et al. , 2014 ; Goodfellow et al. , 2015 ) , which trains networks with adversarial examples that are generated on the fly , is one of the most effective ways for defending against adversarial attacks . Nonetheless , compared to vanilla training , adversarial training significantly increases the computational overhead , mainly due to the high complexity of generating adversarial examples . To this end , many efforts have been devoted to accelerating adversarial training . Both ( Shafahi et al. , 2019 ) and ( Zhang et al. , 2019 ) propose to merge the gradient for adversarial attacks and the gradient for network parameter updates into a single forward and backward pass to reduce computations . Wong et al . ( Wong et al. , 2020 ) alternatively argue that the cheapest adversarial attacker , Fast Gradient Sign Method ( FGSM ) ( Goodfellow et al. , 2015 ) , actually can train robust classifiers , if combined with random initialization . This work is further enhanced by ( Andriushchenko & Flammarion , 2020 ) to explicitly maximizing the gradient alignment inside the perturbation set for enhancing the quality of the FGSM solution . In this work , we aim to integrate these fast adversarial training techniques into AdvProp , for reducing the overhead of generating adversarial training samples . Adversarial propagation . It is generally believed that adversarial training hurts generalization ( Raghunathan et al. , 2019 ) . Adversarial propagation ( AdvProp ) ( Xie et al. , 2020 ) , a special form of adversarial training , challenges this belief by showing training with adversarial examples actually can improve recognition models . The key is to utilize an additional set of batch normalization layers exclusively for the adversarial images , as they have different underlying distributions to clean examples . Later works further explore the potential of AdvProp on other recognition tasks ( Chen et al. , 2021b ; Xu et al. , 2021 ; Shu et al. , 2020 ; Chen et al. , 2021a ; Xie & Yuille , 2020 ; Wang et al. , 2020 ; Gong et al. , 2021 ) , under different learning paradigms ( Jiang et al. , 2020 ; Ho & Vasconcelos , 2020 ; Xu & Yang , 2020 ) , with different adversarial data ( Merchant et al. , 2020 ; Li et al. , 2020 ; Herrmann et al. , 2021 ) , enabling extremely large-batch training ( Liu et al. , 2022 ) , etc . In this work , rather than furthering AdvProp on performance , we aim to develop a “ free ” version of it . Data augmentation . Data augmentation , which effectively increases the size and the diversity of the training dataset , is crucial for the success of deep neural networks ( Krizhevsky et al. , 2012 ; Simonyan & Zisserman , 2015 ; Szegedy et al. , 2015 ; He et al. , 2016 ) . Popular ways for augmenting data include geometric transformations ( e.g. , translation , rotation ) , color jittering ( e.g. , brightness , contrast ) , mixing images ( Zhang et al. , 2018 ; Yun et al. , 2019 ; DeVries & Taylor , 2017 ) , etc . Training with adversarial examples ( Goodfellow et al. , 2015 ; Xie et al. , 2020 ; Chen et al. , 2021b ) can be regarded as a special way to augment data—different from traditional data augmentation strategies which are usually fixed and model agnostic , the policy of generating adversarial examples is jointly evolved with the model updating throughout the whole training process . This behavior ensures the augmentation policy of adversarial examples stays current and relevant . Nonetheless , a significant drawback of augmenting adversarial examples is that the introduced computational overhead is much more expensive than that of traditional augmentation strategies . We hereby aim to make training with adversarial examples as cheap as other data augmentation strategies . 3 FAST ADVPROP . We hereby present Fast AdvProp , which aggressively revamps the costly components in AdvProp . Particularly , our modifications mainly focus on reducing the computational overheads stemmed from adversarial examples , meanwhile ( empirically ) still attempt to retain the benefits brought by AdvProp . 3.1 REVISITING ADVPROP . AdvProp ( Xie et al. , 2020 ) demonstrates adversarial examples can improve recognition models . By noticing adversarial images and clean images have different underlying distributions , AdvProp bridges such distribution mismatch by using two BN scheme—the original BN layers are applied exclusively for clean images , and the auxiliary BN layers are applied exclusively for adversarial images . This scheme ensures each BN layer is executed on a single data source ( i.e. , either clean images or adversarial images ) . More concretely , in each iteration , As shown in ( Xie et al. , 2020 ) , AdvProp substantially improves both the clean images accuracy , as well as the model robustness . We confirm it in our re-implementation—as shown in the second row of Table 1 , AdvProp , using PGD-5 attacker , helps ResNet-50 beats its vanilla counterpart by 0.8 % on ImageNet ( Russakovsky et al. , 2015 ) , 6.5 % on ImageNet-C ( Hendrycks & Dietterich , 2018 ) , 6.0 % on ImageNet-R ( Hendrycks et al. , 2020 ) and 4.2 % on Stylized-ImageNet ( Geirhos et al. , 2018 ) . But meanwhile , we note AdvProp significantly increases the training cost . For example , our AdvProp re-implementation requires 7× more forward and backward passes than the vanilla baseline . Such heavy training cost not only limits the broader exploration with AdvProp , but also makes the comparisons to other learning strategies ( which are usually “ free ” , e.g. , ( Yun et al. , 2019 ; Zhang et al. , 2018 ; Cubuk et al. , 2019a ) ) seemly unfair . To reduce the computational cost , we first give a naive attempt to simplify AdvProp ’ s training pipeline . Specifically , given PGD-5 AdvProp here is 7× more expensive than the vanilla baseline , we directly cut its total training epochs by a factor of 7 ( i.e. , from 105 epochs to 15 epochs ) . As shown in the third row of Table 1 , this 15-epoch PGD-5 AdvProp severely degrades the original AdvProp ’ s performance ( i.e. , 66.8 % vs. 77.0 % on ImageNet ) , even making the resulted model attains much lower performance than the vanilla training baseline . Moreover , we verify that applying the cheapest PGD-1 training ( i.e. , FGSM + random initialization as in ( Wong et al. , 2020 ) ) to AdvProp still leads to inferior performance . These results demonstrate that the task of accelerating AdvProp is non-trivial , therefore motivate us to explore more sophisticated solutions next .
This paper aims to improve the training speed and decrease the computation cost of AdvProp, which is a method that leverages the adversarial example to improve the image recognition accuracy. AdvProp uses separate batchnorm for clean and adversarial examples respectively. In this work, the proposed method Fast AdvProp reduces the computation cost by reusing some gradient computation during training. In the experiment section, Fast AdvProp demonstrates better image recognition and object detection performance under the same training budget and can be combined with existing training strategies, such as mix up. Overall, this paper proposed an efficient training strategy that can be combined with various existing data augmentation for various tasks.
SP:84f6ceac94561a71cd734bd59fc2abee080f47f1
Fast AdvProp
1 INTRODUCTION . Deep neural networks are highly successful for visual recognition . As fueled by powerful computational resources and massive amounts of data , deep networks achieve compelling , sometimes even superhuman , performance on a wide range of visual benchmarks . However , when testing out of the box , these exemplary models are usually get criticized for lacking generalization/robustness—an increasing amount of works point out that deep neural networks are brittle at handling out-of-domain situations like natural image corruptions ( Hendrycks & Dietterich , 2018 ) , images with shifted styles ( Geirhos et al. , 2018 ; Hendrycks et al. , 2020 ) , etc . Adversarial propagation ( AdvProp ) ( Xie et al. , 2020 ) , which additionally feeds networks with adversarial examples during training , emerged as one of the most effective ways to train not only accurate but also robust deep neural networks . The key in AdvProp is to apply separate batch normalization ( BN ) layers ( Ioffe & Szegedy , 2015 ) to clean training samples and adversarial training samples , as they come from different underlying distributions . Later works further explore the potential of AdvProp on other learning tasks , including object detection ( Chen et al. , 2021b ; Xu et al. , 2021 ) , contrastive learning ( Jiang et al. , 2020 ; Ho & Vasconcelos , 2020 ; Xu & Yang , 2020 ) and large-batch training ( Liu et al. , 2022 ) . However , the benefits brought by AdvProp do not come for “ free ” —AdvProp introduces a significant amount of additional training cost , which is mainly incurred by generating and augmenting adversarial training samples . For instance , compared to the vanilla training baseline ( where only clean images are involved ) , the default setting in AdvProp ( Xie et al. , 2020 ) increase the total computational cost by factor of 7 , i.e. , 5/7 from generating adversarial examples , 1/7 from training adversarial examples , 1/7 from training clean images . This extremely high training cost not only limits the further explorations of AdvProp on larger networks ( Xie et al. , 2019 ; Brock et al. , 2021 ; Dosovitskiy et al. , 2020 ) , with larger datasets ( Sun et al. , 2017 ; Kuznetsova et al. , 2020 ) , and for different learning tasks , but also makes the direct comparisons against other low-cost learning algorithms ( Zhang et al. , 2018 ; DeVries & Taylor , 2017 ; Yun et al. , 2019 ; Cubuk et al. , 2019b ; a ) seemingly unfair . Sampled Batch + R an d o m N o is e Model Input “ Free ” operation Heavy operation Forward & Backward Clean Image Adversarial Image Image w/ Noise Sampled Batch Model Input ( a ) AdvProp ( b ) Fast AdvProp … Figure 1 : Comparison between AdvProp and Fast AdvProp . ( a ) AdvProp generates a paired adversarial image ( with color orange ) for each clean image ( with color blue ) in the sampled batch , therefore incurring heavy training cost . Moreover , in addition to clean images , adversarial images are also fed into networks for training , therefore further increasing the total training cost , i.e. , 2x data is used here compared to the vanilla training . ( b ) Different from AdvProp , Fast AdvProp only uses a small portion of the sampled batch to generate adversarial examples . Moreover , during the generation of adversarial images , the gradient calculation of input images and the gradient calculation of network parameters are merged into the same forward and backward pass as in ( Shafahi et al. , 2019 ; Zhang et al. , 2019 ) , therefore making generating adversarial examples for “ free ” . In this paper , we present Fast AdvProp , which can run as cheaply as the vanilla training baseline in practice . In particular , noting the most costly training components in AdvProp are ( 1 ) generating adversarial examples where multiple forward passes and backward passes are additionally required , and ( 2 ) training with both clean samples and their adversarial counterparts therefore the size of training data gets doubled , Fast AdvProp revamps the original training pipeline as the following : • Firstly , though both clean training samples and their adversarial counterparts are default components in traditional adversarial training ( Goodfellow et al. , 2015 ; Kurakin et al. , 2017 ) , we argue such pairing behavior is not a fundamental request by AdvProp . Specifically , in Fast AdvProp , we reposition adversarial examples solely as a bonus part for network training , i.e. , networks now are expected to train with a mixture of a large portion of clean images and a small portion of adversarial examples . This adjustment on training data helps lower down training cost . Though the total number of adversarial training examples is reduced , our empirical results verify this strategy is sufficient to let networks gain robust feature representations . • Secondly , we integrate the recent techniques on accelerating adversarial training ( Wong et al. , 2020 ; Zhang et al. , 2019 ; Shafahi et al. , 2019 ) into AdvProp , mainly for reducing the complexity of generating adversarial examples . However , this is non-trivial—naively adopting these fast adversarial training techniques will collapse the training , resulting in suboptimal model performance . We identify such failure is caused by the “ label leaking ” effect ( Kurakin et al. , 2017 ) , which largely weakens the regularization power imposed by adversarial training samples . We further note this leakage comes from the intra-batch communication among training samples in the same mini-batch , and resolve it via shuffling BN ( He et al. , 2020 ) . Additionally , we find a ) re-balancing the importance between clean training samples and adversarial training samples and b ) synchronizing parameter updating speed are the other two key ingredients for ensuring Fast AdvProp ’ s improvements . Our empirical results demonstrate that Fast AdvProp can successfully improve recognition models for “ free ” . For instance , without incurring any extra training cost , Fast AdvProp helps ResNet-50 ( He et al. , 2016 ) outperforms its vanilla counterpart by 0.3 % on ImageNet , 2.1 % on ImageNet-C , 1.9 % on ImageNet-R and 0.5 % on Stylized-ImageNet . Furthermore , such “ free lunch ” can consistently be observed when Fast AdvProp is applied to networks at different scales , combined with various data augmentation strategies , and adapted to other recognition tasks . By easing the computational barriers , we hope this work can encourage the community to further explore the potential of AdvProp ( or adversarial learning in general ) on developing better deep learning models . 2 RELATED WORK . Adversarial training . Adversarial training ( Szegedy et al. , 2014 ; Goodfellow et al. , 2015 ) , which trains networks with adversarial examples that are generated on the fly , is one of the most effective ways for defending against adversarial attacks . Nonetheless , compared to vanilla training , adversarial training significantly increases the computational overhead , mainly due to the high complexity of generating adversarial examples . To this end , many efforts have been devoted to accelerating adversarial training . Both ( Shafahi et al. , 2019 ) and ( Zhang et al. , 2019 ) propose to merge the gradient for adversarial attacks and the gradient for network parameter updates into a single forward and backward pass to reduce computations . Wong et al . ( Wong et al. , 2020 ) alternatively argue that the cheapest adversarial attacker , Fast Gradient Sign Method ( FGSM ) ( Goodfellow et al. , 2015 ) , actually can train robust classifiers , if combined with random initialization . This work is further enhanced by ( Andriushchenko & Flammarion , 2020 ) to explicitly maximizing the gradient alignment inside the perturbation set for enhancing the quality of the FGSM solution . In this work , we aim to integrate these fast adversarial training techniques into AdvProp , for reducing the overhead of generating adversarial training samples . Adversarial propagation . It is generally believed that adversarial training hurts generalization ( Raghunathan et al. , 2019 ) . Adversarial propagation ( AdvProp ) ( Xie et al. , 2020 ) , a special form of adversarial training , challenges this belief by showing training with adversarial examples actually can improve recognition models . The key is to utilize an additional set of batch normalization layers exclusively for the adversarial images , as they have different underlying distributions to clean examples . Later works further explore the potential of AdvProp on other recognition tasks ( Chen et al. , 2021b ; Xu et al. , 2021 ; Shu et al. , 2020 ; Chen et al. , 2021a ; Xie & Yuille , 2020 ; Wang et al. , 2020 ; Gong et al. , 2021 ) , under different learning paradigms ( Jiang et al. , 2020 ; Ho & Vasconcelos , 2020 ; Xu & Yang , 2020 ) , with different adversarial data ( Merchant et al. , 2020 ; Li et al. , 2020 ; Herrmann et al. , 2021 ) , enabling extremely large-batch training ( Liu et al. , 2022 ) , etc . In this work , rather than furthering AdvProp on performance , we aim to develop a “ free ” version of it . Data augmentation . Data augmentation , which effectively increases the size and the diversity of the training dataset , is crucial for the success of deep neural networks ( Krizhevsky et al. , 2012 ; Simonyan & Zisserman , 2015 ; Szegedy et al. , 2015 ; He et al. , 2016 ) . Popular ways for augmenting data include geometric transformations ( e.g. , translation , rotation ) , color jittering ( e.g. , brightness , contrast ) , mixing images ( Zhang et al. , 2018 ; Yun et al. , 2019 ; DeVries & Taylor , 2017 ) , etc . Training with adversarial examples ( Goodfellow et al. , 2015 ; Xie et al. , 2020 ; Chen et al. , 2021b ) can be regarded as a special way to augment data—different from traditional data augmentation strategies which are usually fixed and model agnostic , the policy of generating adversarial examples is jointly evolved with the model updating throughout the whole training process . This behavior ensures the augmentation policy of adversarial examples stays current and relevant . Nonetheless , a significant drawback of augmenting adversarial examples is that the introduced computational overhead is much more expensive than that of traditional augmentation strategies . We hereby aim to make training with adversarial examples as cheap as other data augmentation strategies . 3 FAST ADVPROP . We hereby present Fast AdvProp , which aggressively revamps the costly components in AdvProp . Particularly , our modifications mainly focus on reducing the computational overheads stemmed from adversarial examples , meanwhile ( empirically ) still attempt to retain the benefits brought by AdvProp . 3.1 REVISITING ADVPROP . AdvProp ( Xie et al. , 2020 ) demonstrates adversarial examples can improve recognition models . By noticing adversarial images and clean images have different underlying distributions , AdvProp bridges such distribution mismatch by using two BN scheme—the original BN layers are applied exclusively for clean images , and the auxiliary BN layers are applied exclusively for adversarial images . This scheme ensures each BN layer is executed on a single data source ( i.e. , either clean images or adversarial images ) . More concretely , in each iteration , As shown in ( Xie et al. , 2020 ) , AdvProp substantially improves both the clean images accuracy , as well as the model robustness . We confirm it in our re-implementation—as shown in the second row of Table 1 , AdvProp , using PGD-5 attacker , helps ResNet-50 beats its vanilla counterpart by 0.8 % on ImageNet ( Russakovsky et al. , 2015 ) , 6.5 % on ImageNet-C ( Hendrycks & Dietterich , 2018 ) , 6.0 % on ImageNet-R ( Hendrycks et al. , 2020 ) and 4.2 % on Stylized-ImageNet ( Geirhos et al. , 2018 ) . But meanwhile , we note AdvProp significantly increases the training cost . For example , our AdvProp re-implementation requires 7× more forward and backward passes than the vanilla baseline . Such heavy training cost not only limits the broader exploration with AdvProp , but also makes the comparisons to other learning strategies ( which are usually “ free ” , e.g. , ( Yun et al. , 2019 ; Zhang et al. , 2018 ; Cubuk et al. , 2019a ) ) seemly unfair . To reduce the computational cost , we first give a naive attempt to simplify AdvProp ’ s training pipeline . Specifically , given PGD-5 AdvProp here is 7× more expensive than the vanilla baseline , we directly cut its total training epochs by a factor of 7 ( i.e. , from 105 epochs to 15 epochs ) . As shown in the third row of Table 1 , this 15-epoch PGD-5 AdvProp severely degrades the original AdvProp ’ s performance ( i.e. , 66.8 % vs. 77.0 % on ImageNet ) , even making the resulted model attains much lower performance than the vanilla training baseline . Moreover , we verify that applying the cheapest PGD-1 training ( i.e. , FGSM + random initialization as in ( Wong et al. , 2020 ) ) to AdvProp still leads to inferior performance . These results demonstrate that the task of accelerating AdvProp is non-trivial , therefore motivate us to explore more sophisticated solutions next .
The paper proposes Fast Advprop which is an modified implementation of adversarial propagation. Adversarial propagation aims at improving the robustness and generalization abilities of deep neural network classifiers by performing adversarial training with additional batch normalization layers that are solely used for the adversarial examples which are used during training. The paper suggests to apply different existing techniques and small modifications to increase the training speed while using AdvProp.
SP:84f6ceac94561a71cd734bd59fc2abee080f47f1
Fast AdvProp
1 INTRODUCTION . Deep neural networks are highly successful for visual recognition . As fueled by powerful computational resources and massive amounts of data , deep networks achieve compelling , sometimes even superhuman , performance on a wide range of visual benchmarks . However , when testing out of the box , these exemplary models are usually get criticized for lacking generalization/robustness—an increasing amount of works point out that deep neural networks are brittle at handling out-of-domain situations like natural image corruptions ( Hendrycks & Dietterich , 2018 ) , images with shifted styles ( Geirhos et al. , 2018 ; Hendrycks et al. , 2020 ) , etc . Adversarial propagation ( AdvProp ) ( Xie et al. , 2020 ) , which additionally feeds networks with adversarial examples during training , emerged as one of the most effective ways to train not only accurate but also robust deep neural networks . The key in AdvProp is to apply separate batch normalization ( BN ) layers ( Ioffe & Szegedy , 2015 ) to clean training samples and adversarial training samples , as they come from different underlying distributions . Later works further explore the potential of AdvProp on other learning tasks , including object detection ( Chen et al. , 2021b ; Xu et al. , 2021 ) , contrastive learning ( Jiang et al. , 2020 ; Ho & Vasconcelos , 2020 ; Xu & Yang , 2020 ) and large-batch training ( Liu et al. , 2022 ) . However , the benefits brought by AdvProp do not come for “ free ” —AdvProp introduces a significant amount of additional training cost , which is mainly incurred by generating and augmenting adversarial training samples . For instance , compared to the vanilla training baseline ( where only clean images are involved ) , the default setting in AdvProp ( Xie et al. , 2020 ) increase the total computational cost by factor of 7 , i.e. , 5/7 from generating adversarial examples , 1/7 from training adversarial examples , 1/7 from training clean images . This extremely high training cost not only limits the further explorations of AdvProp on larger networks ( Xie et al. , 2019 ; Brock et al. , 2021 ; Dosovitskiy et al. , 2020 ) , with larger datasets ( Sun et al. , 2017 ; Kuznetsova et al. , 2020 ) , and for different learning tasks , but also makes the direct comparisons against other low-cost learning algorithms ( Zhang et al. , 2018 ; DeVries & Taylor , 2017 ; Yun et al. , 2019 ; Cubuk et al. , 2019b ; a ) seemingly unfair . Sampled Batch + R an d o m N o is e Model Input “ Free ” operation Heavy operation Forward & Backward Clean Image Adversarial Image Image w/ Noise Sampled Batch Model Input ( a ) AdvProp ( b ) Fast AdvProp … Figure 1 : Comparison between AdvProp and Fast AdvProp . ( a ) AdvProp generates a paired adversarial image ( with color orange ) for each clean image ( with color blue ) in the sampled batch , therefore incurring heavy training cost . Moreover , in addition to clean images , adversarial images are also fed into networks for training , therefore further increasing the total training cost , i.e. , 2x data is used here compared to the vanilla training . ( b ) Different from AdvProp , Fast AdvProp only uses a small portion of the sampled batch to generate adversarial examples . Moreover , during the generation of adversarial images , the gradient calculation of input images and the gradient calculation of network parameters are merged into the same forward and backward pass as in ( Shafahi et al. , 2019 ; Zhang et al. , 2019 ) , therefore making generating adversarial examples for “ free ” . In this paper , we present Fast AdvProp , which can run as cheaply as the vanilla training baseline in practice . In particular , noting the most costly training components in AdvProp are ( 1 ) generating adversarial examples where multiple forward passes and backward passes are additionally required , and ( 2 ) training with both clean samples and their adversarial counterparts therefore the size of training data gets doubled , Fast AdvProp revamps the original training pipeline as the following : • Firstly , though both clean training samples and their adversarial counterparts are default components in traditional adversarial training ( Goodfellow et al. , 2015 ; Kurakin et al. , 2017 ) , we argue such pairing behavior is not a fundamental request by AdvProp . Specifically , in Fast AdvProp , we reposition adversarial examples solely as a bonus part for network training , i.e. , networks now are expected to train with a mixture of a large portion of clean images and a small portion of adversarial examples . This adjustment on training data helps lower down training cost . Though the total number of adversarial training examples is reduced , our empirical results verify this strategy is sufficient to let networks gain robust feature representations . • Secondly , we integrate the recent techniques on accelerating adversarial training ( Wong et al. , 2020 ; Zhang et al. , 2019 ; Shafahi et al. , 2019 ) into AdvProp , mainly for reducing the complexity of generating adversarial examples . However , this is non-trivial—naively adopting these fast adversarial training techniques will collapse the training , resulting in suboptimal model performance . We identify such failure is caused by the “ label leaking ” effect ( Kurakin et al. , 2017 ) , which largely weakens the regularization power imposed by adversarial training samples . We further note this leakage comes from the intra-batch communication among training samples in the same mini-batch , and resolve it via shuffling BN ( He et al. , 2020 ) . Additionally , we find a ) re-balancing the importance between clean training samples and adversarial training samples and b ) synchronizing parameter updating speed are the other two key ingredients for ensuring Fast AdvProp ’ s improvements . Our empirical results demonstrate that Fast AdvProp can successfully improve recognition models for “ free ” . For instance , without incurring any extra training cost , Fast AdvProp helps ResNet-50 ( He et al. , 2016 ) outperforms its vanilla counterpart by 0.3 % on ImageNet , 2.1 % on ImageNet-C , 1.9 % on ImageNet-R and 0.5 % on Stylized-ImageNet . Furthermore , such “ free lunch ” can consistently be observed when Fast AdvProp is applied to networks at different scales , combined with various data augmentation strategies , and adapted to other recognition tasks . By easing the computational barriers , we hope this work can encourage the community to further explore the potential of AdvProp ( or adversarial learning in general ) on developing better deep learning models . 2 RELATED WORK . Adversarial training . Adversarial training ( Szegedy et al. , 2014 ; Goodfellow et al. , 2015 ) , which trains networks with adversarial examples that are generated on the fly , is one of the most effective ways for defending against adversarial attacks . Nonetheless , compared to vanilla training , adversarial training significantly increases the computational overhead , mainly due to the high complexity of generating adversarial examples . To this end , many efforts have been devoted to accelerating adversarial training . Both ( Shafahi et al. , 2019 ) and ( Zhang et al. , 2019 ) propose to merge the gradient for adversarial attacks and the gradient for network parameter updates into a single forward and backward pass to reduce computations . Wong et al . ( Wong et al. , 2020 ) alternatively argue that the cheapest adversarial attacker , Fast Gradient Sign Method ( FGSM ) ( Goodfellow et al. , 2015 ) , actually can train robust classifiers , if combined with random initialization . This work is further enhanced by ( Andriushchenko & Flammarion , 2020 ) to explicitly maximizing the gradient alignment inside the perturbation set for enhancing the quality of the FGSM solution . In this work , we aim to integrate these fast adversarial training techniques into AdvProp , for reducing the overhead of generating adversarial training samples . Adversarial propagation . It is generally believed that adversarial training hurts generalization ( Raghunathan et al. , 2019 ) . Adversarial propagation ( AdvProp ) ( Xie et al. , 2020 ) , a special form of adversarial training , challenges this belief by showing training with adversarial examples actually can improve recognition models . The key is to utilize an additional set of batch normalization layers exclusively for the adversarial images , as they have different underlying distributions to clean examples . Later works further explore the potential of AdvProp on other recognition tasks ( Chen et al. , 2021b ; Xu et al. , 2021 ; Shu et al. , 2020 ; Chen et al. , 2021a ; Xie & Yuille , 2020 ; Wang et al. , 2020 ; Gong et al. , 2021 ) , under different learning paradigms ( Jiang et al. , 2020 ; Ho & Vasconcelos , 2020 ; Xu & Yang , 2020 ) , with different adversarial data ( Merchant et al. , 2020 ; Li et al. , 2020 ; Herrmann et al. , 2021 ) , enabling extremely large-batch training ( Liu et al. , 2022 ) , etc . In this work , rather than furthering AdvProp on performance , we aim to develop a “ free ” version of it . Data augmentation . Data augmentation , which effectively increases the size and the diversity of the training dataset , is crucial for the success of deep neural networks ( Krizhevsky et al. , 2012 ; Simonyan & Zisserman , 2015 ; Szegedy et al. , 2015 ; He et al. , 2016 ) . Popular ways for augmenting data include geometric transformations ( e.g. , translation , rotation ) , color jittering ( e.g. , brightness , contrast ) , mixing images ( Zhang et al. , 2018 ; Yun et al. , 2019 ; DeVries & Taylor , 2017 ) , etc . Training with adversarial examples ( Goodfellow et al. , 2015 ; Xie et al. , 2020 ; Chen et al. , 2021b ) can be regarded as a special way to augment data—different from traditional data augmentation strategies which are usually fixed and model agnostic , the policy of generating adversarial examples is jointly evolved with the model updating throughout the whole training process . This behavior ensures the augmentation policy of adversarial examples stays current and relevant . Nonetheless , a significant drawback of augmenting adversarial examples is that the introduced computational overhead is much more expensive than that of traditional augmentation strategies . We hereby aim to make training with adversarial examples as cheap as other data augmentation strategies . 3 FAST ADVPROP . We hereby present Fast AdvProp , which aggressively revamps the costly components in AdvProp . Particularly , our modifications mainly focus on reducing the computational overheads stemmed from adversarial examples , meanwhile ( empirically ) still attempt to retain the benefits brought by AdvProp . 3.1 REVISITING ADVPROP . AdvProp ( Xie et al. , 2020 ) demonstrates adversarial examples can improve recognition models . By noticing adversarial images and clean images have different underlying distributions , AdvProp bridges such distribution mismatch by using two BN scheme—the original BN layers are applied exclusively for clean images , and the auxiliary BN layers are applied exclusively for adversarial images . This scheme ensures each BN layer is executed on a single data source ( i.e. , either clean images or adversarial images ) . More concretely , in each iteration , As shown in ( Xie et al. , 2020 ) , AdvProp substantially improves both the clean images accuracy , as well as the model robustness . We confirm it in our re-implementation—as shown in the second row of Table 1 , AdvProp , using PGD-5 attacker , helps ResNet-50 beats its vanilla counterpart by 0.8 % on ImageNet ( Russakovsky et al. , 2015 ) , 6.5 % on ImageNet-C ( Hendrycks & Dietterich , 2018 ) , 6.0 % on ImageNet-R ( Hendrycks et al. , 2020 ) and 4.2 % on Stylized-ImageNet ( Geirhos et al. , 2018 ) . But meanwhile , we note AdvProp significantly increases the training cost . For example , our AdvProp re-implementation requires 7× more forward and backward passes than the vanilla baseline . Such heavy training cost not only limits the broader exploration with AdvProp , but also makes the comparisons to other learning strategies ( which are usually “ free ” , e.g. , ( Yun et al. , 2019 ; Zhang et al. , 2018 ; Cubuk et al. , 2019a ) ) seemly unfair . To reduce the computational cost , we first give a naive attempt to simplify AdvProp ’ s training pipeline . Specifically , given PGD-5 AdvProp here is 7× more expensive than the vanilla baseline , we directly cut its total training epochs by a factor of 7 ( i.e. , from 105 epochs to 15 epochs ) . As shown in the third row of Table 1 , this 15-epoch PGD-5 AdvProp severely degrades the original AdvProp ’ s performance ( i.e. , 66.8 % vs. 77.0 % on ImageNet ) , even making the resulted model attains much lower performance than the vanilla training baseline . Moreover , we verify that applying the cheapest PGD-1 training ( i.e. , FGSM + random initialization as in ( Wong et al. , 2020 ) ) to AdvProp still leads to inferior performance . These results demonstrate that the task of accelerating AdvProp is non-trivial , therefore motivate us to explore more sophisticated solutions next .
This paper proposed an improved version of AdvProp, to speed up the training process. Specifically, it proposes to use less adversarial examples in a mixed batch and utilizes a list of recent fast adversarial training techniques. The experiments have been conducted on ImageNet sets with different backbones, demonstrating the effectiveness of the proposed fast model.
SP:84f6ceac94561a71cd734bd59fc2abee080f47f1
Distinguishing rule- and exemplar-based generalization in learning systems
1 INTRODUCTION . Extrapolation or generalization—decisions on unseen datapoints—is always underdetermined by data ; which particular extrapolation behavior an algorithm exhibits is determined by the algorithm ’ s inductive biases ( Mitchell , 1980 ) . For modern deep learning systems , these inductive biases often deviate from those in humans . When the inductive biases of ML systems are opaque , and guarantees on extrapolation are not possible—as is often the case with many modern ML systems ( D ’ Amour et al. , 2020 ) —we can instead turn to empirical study of the behavior of a system to derive principles about the system ’ s operation . Cognitive psychology provides a rich basis for experimental designs to study the often-opaque human cognitive system via its external behavior . These can be leveraged to distinguish between competing hypotheses about a machine learning system ’ s inductive biases in the same manner ( Ritter et al. , 2017b ; Lake et al. , 2018 ; Dasgupta et al. , 2019 ) . In this paper , we draw on methods from cognitive psychology to define a protocol that teases apart the different inductive biases that go into informing how an opaque learning system extrapolates outside its training distribution . We focus in particular on combinatorial generalization for classification in the presence of spurious correlation . Our protocol goes significantly beyond existing work by controlling for various confounds . We isolate two distinct kinds of inductive bias—feature-level bias and exemplar-rule bias—that have different effects on model extrapolation . We examine these inductive biases across models in an expository points-in-a-plane setting , as well as in naturalistic image and language domains . Finally , we discuss the implications of these inductive biases and their relation to previous work on data augmentation and spurious correlation . Feature-level bias measures which features a system finds easier or harder to learn . This informs which feature a system will generalize on the basis of when both features are correlated or confounded . This kind of feature-level bias has been studied extensively in human cognition ( Landau et al. , 1988 ; Hudson Kam & Newport , 2005 ) . There has also been recent work—directly inspired by these observations ratio of predictions condition training examples extrapolation humans rule-based exemplar-based ( shape-biased ) ( no feature bias ) ( no feature bias ) cognitive psychology studies—that examines similar biases in artificial neural networks , most notably the “ shape-bias ” , the tendency to generalize image category labels according to shape rather than according to color or texture ( Ritter et al. , 2017a ; Hermann et al. , 2019 ; Geirhos et al. , 2018 ) . While there exists previous work examining specific feature biases in deep learning , we present a more general measure of feature-level bias as well as demonstrate how it interacts with—but is distinct from—another kind of inductive bias , viz . exemplar-vs-rule bias . Exemplar-vs-rule bias measures how a system uses features to inform decisions by trading off between exemplar- and rule-based generalization . A rule-based categorization decision is made on the basis of minimal features that support the category boundary ( e.g. , Ashby & Townsend , 1986 ) , while an exemplar-based decision-maker generalizes a category on the basis of similarity to category exemplars ( e.g. , Shepard & Chang , 1963 ) , and therefore may invoke many or all features that underlie a category . Extensive empirical work in cognitive psychology has found evidence of both kinds of generalization in humans ( Nosofsky et al. , 1989 ; Rips , 1989 ; Allen & Brooks , 1991 ; Rips & Collins , 1993 ; Smith & Sloman , 1994 ) . This trade-off can be understood intuitively as a continuum that varies the number of features employed to discriminate between categories ( Pothos , 2005 ) .1 This continuum also plays a role in representation learning systems such as deep neural networks ( Hinton & Salakhutdinov , 2006 ) , where feature selection is automated . 2 AN ILLUSTRATIVE EXAMPLE . We first examine an intuitive example that highlights the distinct inductive biases we care about . Consider the category learning paradigm in Fig . ( 1 ) . The stimuli vary along two feature dimensions , shape and color . Color determines the label of an object ( i.e. , green objects are “ dax ” ; purple are “ fep ” ) , and shape is unrelated to the underlying category structure and acts as a distractor . Participants ( either humans or artificial learning systems ) are independently placed in three different conditions— cue conflict , zero shot , and partial exposure—that vary in coverage of the feature space . After observing the training examples , the participant is presented with an extrapolation test consisting of an example outside the support of feature combinations observed during training ( i.e. , to classify the green circle as a “ dax ” or a “ fep , ” using arbitrary names to demonstrate that which feature is relevant to the category boundary is not given ) . We explain below how differences in classification behavior on this extrapolation isolate feature-level bias as well as exemplar-vs-rule bias . We encourage the reader to try the experiment themselves to examine their intuitions . Cue conflict ( CC , top row , Fig . ( 1 ) ) . The data presented in this condition confound color and shape ( i.e. , color and shape are equally predictive of the category boundary ) . How a system generalizes here directly measures its feature-level bias towards color or shape . 1We leave to future work the details of mathematically formalizing the properties of statistical learners that result in exemplar-vs-rule bias . We instead focus on the behavioral manifestations of this inductive bias and present an empirical protocol to measure it , even in opaque systems . Characteristic behavior ( right half of Fig . ( 1 ) ) . Since humans have an established shape bias ( Landau et al. , 1988 ) , we expect that humans will classify the test item according to the object that shares its shape , not its color ; in this case , as a “ fep. ” However , this inductive bias is not shared by ruleand exemplar-based reasoners that have no a priori propensity for features , and are equally likely to classify the test item as a “ dax ” or a “ fep. ” Zero shot ( ZS , middle row , Fig . ( 1 ) ) . This condition requires extrapolation to a new feature value “ zero-shot ” ( i.e. , without prior exposure ) . This setting is often used to examine out-of-domain ( OOD ) and compositional generalization in machine learning ( Xian et al. , 2018 ) . Behavior in this condition reveals whether the model has learned the discriminating features and whether it can extrapolate to new feature values , and thus acts as a baseline . Characteristic behavior ( right half , Fig . ( 1 ) ) . Rule- and exemplar-based behavior in this condition is confounded . A rule-based learner infers the minimal rule that color determines label , does not assign any predictive value to shape , and therefore classifies the extrapolation stimulus based on color as a “ dax. ” An exemplar-based learner categorizes based on the similarity along all feature dimensions of the extrapolation stimulus to category exemplars . Both training exemplars have no overlap with the test stimulus along the shape dimension , but the “ dax ” overlaps along the color dimension , and the learner categorizes it as a “ dax. ” Partial exposure ( PE , bottom row , Fig . ( 1 ) ) . Compared to zero shot , participants in this condition also receive “ partial exposure ” to a new feature value ( i.e. , circle ) along the shape dimension . This setting is most similar to combinatorial zero-shot generalization ( e.g. , Lake & Baroni , 2018a ) , where the learner is exposed independently to all feature values but has to generalize to a new combination . Characteristic behavior ( right half of Fig . ( 1 ) ) . This setting meaningfully distinguishes rule- and exemplar-based generalization . To understand the behavior of these two systems , we contrast this condition to the cue-conflict condition . The addition of the purple diamond-shaped “ fep ” means the learner has seen both a diamond and a circle labeled “ fep ” . A rule-based learner takes this as direct evidence that shape is not predictive of category label and classifies the extrapolation stimulus on the basis of color as a “ dax. ” This is typically also how humans extrapolate . This additional training example , however , does not impact an exemplar-based system , since it does not share any features with the extrapolation stimulus . The exemplar-based reasoner classifies on the basis of feature-overlap with training exemplars and is therefore indifferent , exactly as in the cue-conflict condition . From behavior to inductive bias . Feature-level bias is measured as deviation from chance performance in the CC condition . Exemplar-vs-rule bias is measured by the difference between performance in the PE and ZS conditions—-no difference indicates rule-based generalization , while the magnitude of the difference measures exemplar propensity . Pure exemplar-based reasoning implies no difference between the PE and CC conditions , while a non-zero difference indicates partial rule propensity . Implications . A purely exemplar-based system doesn ’ t learn decision boundaries that operate over minimal features . It instead favors a decision boundary that weights all features . This is undesirable in domains where not all feature combinations will be observed , and systematic generalization to unobserved combinations is expected ( Lake et al. , 2018 ; Marcus , 2018 ; Arjovsky et al. , 2019 ) . On the other hand , a rule-based system that applies the same category decision rules across all data regions might over-generalize , which is undesirable in some naturally occurring long-tailed distributions ( Feldman & Zhang , 2020 ; Feldman , 2020 ; Brown et al. , 2020 ) . In such cases , flexible exemplar-based learning that generalizes based on dense similarity is preferable ( Zhang et al. , 2016 ; Arpit et al. , 2017 ) . The protocol we present allows us to empirically measure the exemplar-vs-rule bias of a learner and therefore navigate the exemplar-vs-rule trade-off in various scenarios . 3 A PROTOCOL FOR EXAMINING INDUCTIVE BIAS . We embed the structure of the category learning problem discussed in Section ( 2 ) into a statistical learning problem that can be applied across domains to test black-box learners . Problem setting . We consider a setting where inputs are a composition of categorical attributes ( oracle setting in Andreas , 2019 ) with two latent binary features , zdisc , zdist , ∈ { 0 , 1 } that jointly determine the observation x via some mapping g : { 0 , 1 } 2 → X ; see Fig . ( 2 ) . These features can be derived from a richer set , e.g. , the median of a continuous feature ( see Appendix ) . We consider the training condition feature space cue conflict zero shot partial exposure extrapolation π0 = 0.5 , π1 = 0.5 π0 = 1.0 , π1 = 0.0 π0 = 0.0 , π1 = 0.0 π0 = 0.5 , π1 = 0.0 π1 = 1.0 binary classification task of fitting a model f̂ : X → { 0 , 1 } from a given model family F to predict a binary label for each observation . One of the underlying features , the discriminant , zdisc , defines the decision boundary ; the other one , the distractor , zdist , is not independently predictive of the label . This specifies a generative process x , zdisc , zdist ∼ p ( x | zdisc , zdist ) p ( zdisc , zdist ) . p ( x | zdisc , zdist ) is either generated ( e.g. , in Section ( 4 ) ) , or the empirical distribution of the subset of datapoints x with the corresponding underlying feature values ( assuming access to these annotations , e.g. , in Sections ( 5 ) and ( 6 ) ) . p ( zdisc , zdist ) is varied across training conditions , as outlined below . Training conditions . The upper-right quadrant in all subfigures of Fig . ( 2 ) , for which p ( zdisc = 1 , zdist = 1 ) = 1 , acts as a hold-out set on which we can evaluate generalization to an unseen combination of attribute values . We produce multiple training conditions with the remaining three quadrants of data by manipulating p ( zdisc , zdist ) . All the analyses in this paper compare model extrapolation to the held-out test quadrant across various training conditions . To equalize the class base rates we balance all training conditions across the discriminant ; i.e. , we enforce p ( zdisc = 0 ) = p ( zdisc = 1 ) = 0.5 . We also fix the number of datapoints across all conditions at N ; With these constraints , we can control p ( zdisc , zdist ) via two degrees of freedom : π0 = p ( zdist = 1 | zdisc = 0 ) ( this implicitly fixes p ( zdist = 0 | zdisc = 0 ) = 1 − π0 to balance the dataset ) ; and π1 = p ( zdist = 1 | zdisc = 1 ) .The three conditions in Section ( 2 ) , as well as the held-out test set , correspond to particular settings of π0 and π1 ( shown in Fig . ( 2 ) , more in Appendix ( A.2 ) ) . Measuring inductive bias . For a given model family F , let f̂ ZS denote the result of selecting a model from F by training in the zero-shot condition , and similarly f̂ PE and f̂ CC . Feature-level bias ( FLB ) and exemplar-vs-rule propensity ( EVR ) are measured as : FLB ( F ) = E [ ( A ( y , f̂ CC ( x ) ) ] − 0.5 , ( 1 ) EVR ( F ) = E [ A ( y , f̂ ZS ( x ) ) ] − E [ A ( y , f̂ PE ( x ) ) ] ( 2 ) where the expectation is taken with respect to the the data distribution under the extrapolation region ( i.e. , p ( x , y | π0 = 1 , π1 = 1 ) ) , A is the 0-1 accuracy . FLB takes values between -0.5 and 0.5 ( indicating bias toward zdist or zdisc , respectively ) ; 0 represents no feature bias . EVR takes values between 0 and 1 ( indicating rule-based and exemplar-based extrapolation , respectively ) . Related formalisms and spurious correlation . This binary formulation of discriminant and distractor features has previously been studied in the context of spurious correlation ( Sagawa et al. , 2020 ) . Rather than independently varying occupancy in the four quadrants , they directly manipulate the ( spurious ) linear correlation between the distractor and the discriminant features ( pmaj ) . In combinatorial feature spaces , a scalar spurious correlation insufficiently specifies the data distribution . The linear correlation coefficient ρ between zdisc and zdist—henceforth “ spurious correlation ” —can be written in terms of π0 and π1 : ρ ( π0 , π1 ) = α√ β ( 1− β ) ; α = π0 − π1 2 , β = π0 + π1 2 . ( 3 ) Different π0 and π1 combinations can give equal ρ ( see contours in Fig . ( 3 ) , dots indicate points along the equi-correlation contour that intersects with the PE condition : ( π0 = 0.5 , π1 = 0.0 , ρ = 0.58 ) ) . In this paper we demonstrate that different data distributions with the same spurious correlation can result in vastly different generalization behavior to the under-represented extrapolation quadrant . This indicates that sensitivity to spurious correlation is an underspecified inductive bias—we risk conflating conceptually distinct sources of inductive bias by focusing on this single metric . We argue for a formulation like ours—based on manipulating feature combinations—that can tease apart distinct inductive biases : at the level of what features a system finds easier to learn ( FLB ) as well as how to use these features to inform a decision boundary ( EVR ) . We discuss how these biases can be interdependent , but capture distinct behaviors that sensitivity to spurious correlation can not explain , thereby providing a more comprehensive picture of how a system generalizes .
This paper proposes two measures for evaluating the feature-level bias and the exemplar-vs-rule bias in learning systems. Specifically, the authors designed three independent training conditions: i. cue conflict: {x1 = 0, x2 = 1, y = 0}, {x1 = 1, x2 = 0, y = 1} ii. zero shot: {x1 = 0, x2 = 0, y = 0}, {x1 = 1, x2 = 0, y = 1} iii. partial exposure: {x1 = 0, x2 = 0, y = 0}, {x1 = 1, x2 = 0, y = 1}, {x1 = 0, x2 = 1, y = 0} and one testing condition: iv. extrapolation: {x1 = 1, x2 = 1, y = 1}. The inductive bias of a given learning system is measured by its extrapolation performance difference when trained on different training conditions. Empirically, the authors first verified their framework on a synthetic dataset with 2D inputs. The results confirm that generalized linear model favors rule-based generalization while Gaussian process favors exemplar-based generalization. On IMDB, the authors show that LSTM models exhibit high feature-level bias (overfitting to the spurious token features) favors exemplar-rule bias. On CelebA, the authors show that ResNet exhibits a wide range of feature-level bias for different features (‘male’ is easier to learn than ‘high cheekbones’). However, across all feature pairs, the model prefers exemplar-based generalization to rule-based generalization.
SP:95f67c4f7401f56019a7f6effd868750d9c2d8aa
Distinguishing rule- and exemplar-based generalization in learning systems
1 INTRODUCTION . Extrapolation or generalization—decisions on unseen datapoints—is always underdetermined by data ; which particular extrapolation behavior an algorithm exhibits is determined by the algorithm ’ s inductive biases ( Mitchell , 1980 ) . For modern deep learning systems , these inductive biases often deviate from those in humans . When the inductive biases of ML systems are opaque , and guarantees on extrapolation are not possible—as is often the case with many modern ML systems ( D ’ Amour et al. , 2020 ) —we can instead turn to empirical study of the behavior of a system to derive principles about the system ’ s operation . Cognitive psychology provides a rich basis for experimental designs to study the often-opaque human cognitive system via its external behavior . These can be leveraged to distinguish between competing hypotheses about a machine learning system ’ s inductive biases in the same manner ( Ritter et al. , 2017b ; Lake et al. , 2018 ; Dasgupta et al. , 2019 ) . In this paper , we draw on methods from cognitive psychology to define a protocol that teases apart the different inductive biases that go into informing how an opaque learning system extrapolates outside its training distribution . We focus in particular on combinatorial generalization for classification in the presence of spurious correlation . Our protocol goes significantly beyond existing work by controlling for various confounds . We isolate two distinct kinds of inductive bias—feature-level bias and exemplar-rule bias—that have different effects on model extrapolation . We examine these inductive biases across models in an expository points-in-a-plane setting , as well as in naturalistic image and language domains . Finally , we discuss the implications of these inductive biases and their relation to previous work on data augmentation and spurious correlation . Feature-level bias measures which features a system finds easier or harder to learn . This informs which feature a system will generalize on the basis of when both features are correlated or confounded . This kind of feature-level bias has been studied extensively in human cognition ( Landau et al. , 1988 ; Hudson Kam & Newport , 2005 ) . There has also been recent work—directly inspired by these observations ratio of predictions condition training examples extrapolation humans rule-based exemplar-based ( shape-biased ) ( no feature bias ) ( no feature bias ) cognitive psychology studies—that examines similar biases in artificial neural networks , most notably the “ shape-bias ” , the tendency to generalize image category labels according to shape rather than according to color or texture ( Ritter et al. , 2017a ; Hermann et al. , 2019 ; Geirhos et al. , 2018 ) . While there exists previous work examining specific feature biases in deep learning , we present a more general measure of feature-level bias as well as demonstrate how it interacts with—but is distinct from—another kind of inductive bias , viz . exemplar-vs-rule bias . Exemplar-vs-rule bias measures how a system uses features to inform decisions by trading off between exemplar- and rule-based generalization . A rule-based categorization decision is made on the basis of minimal features that support the category boundary ( e.g. , Ashby & Townsend , 1986 ) , while an exemplar-based decision-maker generalizes a category on the basis of similarity to category exemplars ( e.g. , Shepard & Chang , 1963 ) , and therefore may invoke many or all features that underlie a category . Extensive empirical work in cognitive psychology has found evidence of both kinds of generalization in humans ( Nosofsky et al. , 1989 ; Rips , 1989 ; Allen & Brooks , 1991 ; Rips & Collins , 1993 ; Smith & Sloman , 1994 ) . This trade-off can be understood intuitively as a continuum that varies the number of features employed to discriminate between categories ( Pothos , 2005 ) .1 This continuum also plays a role in representation learning systems such as deep neural networks ( Hinton & Salakhutdinov , 2006 ) , where feature selection is automated . 2 AN ILLUSTRATIVE EXAMPLE . We first examine an intuitive example that highlights the distinct inductive biases we care about . Consider the category learning paradigm in Fig . ( 1 ) . The stimuli vary along two feature dimensions , shape and color . Color determines the label of an object ( i.e. , green objects are “ dax ” ; purple are “ fep ” ) , and shape is unrelated to the underlying category structure and acts as a distractor . Participants ( either humans or artificial learning systems ) are independently placed in three different conditions— cue conflict , zero shot , and partial exposure—that vary in coverage of the feature space . After observing the training examples , the participant is presented with an extrapolation test consisting of an example outside the support of feature combinations observed during training ( i.e. , to classify the green circle as a “ dax ” or a “ fep , ” using arbitrary names to demonstrate that which feature is relevant to the category boundary is not given ) . We explain below how differences in classification behavior on this extrapolation isolate feature-level bias as well as exemplar-vs-rule bias . We encourage the reader to try the experiment themselves to examine their intuitions . Cue conflict ( CC , top row , Fig . ( 1 ) ) . The data presented in this condition confound color and shape ( i.e. , color and shape are equally predictive of the category boundary ) . How a system generalizes here directly measures its feature-level bias towards color or shape . 1We leave to future work the details of mathematically formalizing the properties of statistical learners that result in exemplar-vs-rule bias . We instead focus on the behavioral manifestations of this inductive bias and present an empirical protocol to measure it , even in opaque systems . Characteristic behavior ( right half of Fig . ( 1 ) ) . Since humans have an established shape bias ( Landau et al. , 1988 ) , we expect that humans will classify the test item according to the object that shares its shape , not its color ; in this case , as a “ fep. ” However , this inductive bias is not shared by ruleand exemplar-based reasoners that have no a priori propensity for features , and are equally likely to classify the test item as a “ dax ” or a “ fep. ” Zero shot ( ZS , middle row , Fig . ( 1 ) ) . This condition requires extrapolation to a new feature value “ zero-shot ” ( i.e. , without prior exposure ) . This setting is often used to examine out-of-domain ( OOD ) and compositional generalization in machine learning ( Xian et al. , 2018 ) . Behavior in this condition reveals whether the model has learned the discriminating features and whether it can extrapolate to new feature values , and thus acts as a baseline . Characteristic behavior ( right half , Fig . ( 1 ) ) . Rule- and exemplar-based behavior in this condition is confounded . A rule-based learner infers the minimal rule that color determines label , does not assign any predictive value to shape , and therefore classifies the extrapolation stimulus based on color as a “ dax. ” An exemplar-based learner categorizes based on the similarity along all feature dimensions of the extrapolation stimulus to category exemplars . Both training exemplars have no overlap with the test stimulus along the shape dimension , but the “ dax ” overlaps along the color dimension , and the learner categorizes it as a “ dax. ” Partial exposure ( PE , bottom row , Fig . ( 1 ) ) . Compared to zero shot , participants in this condition also receive “ partial exposure ” to a new feature value ( i.e. , circle ) along the shape dimension . This setting is most similar to combinatorial zero-shot generalization ( e.g. , Lake & Baroni , 2018a ) , where the learner is exposed independently to all feature values but has to generalize to a new combination . Characteristic behavior ( right half of Fig . ( 1 ) ) . This setting meaningfully distinguishes rule- and exemplar-based generalization . To understand the behavior of these two systems , we contrast this condition to the cue-conflict condition . The addition of the purple diamond-shaped “ fep ” means the learner has seen both a diamond and a circle labeled “ fep ” . A rule-based learner takes this as direct evidence that shape is not predictive of category label and classifies the extrapolation stimulus on the basis of color as a “ dax. ” This is typically also how humans extrapolate . This additional training example , however , does not impact an exemplar-based system , since it does not share any features with the extrapolation stimulus . The exemplar-based reasoner classifies on the basis of feature-overlap with training exemplars and is therefore indifferent , exactly as in the cue-conflict condition . From behavior to inductive bias . Feature-level bias is measured as deviation from chance performance in the CC condition . Exemplar-vs-rule bias is measured by the difference between performance in the PE and ZS conditions—-no difference indicates rule-based generalization , while the magnitude of the difference measures exemplar propensity . Pure exemplar-based reasoning implies no difference between the PE and CC conditions , while a non-zero difference indicates partial rule propensity . Implications . A purely exemplar-based system doesn ’ t learn decision boundaries that operate over minimal features . It instead favors a decision boundary that weights all features . This is undesirable in domains where not all feature combinations will be observed , and systematic generalization to unobserved combinations is expected ( Lake et al. , 2018 ; Marcus , 2018 ; Arjovsky et al. , 2019 ) . On the other hand , a rule-based system that applies the same category decision rules across all data regions might over-generalize , which is undesirable in some naturally occurring long-tailed distributions ( Feldman & Zhang , 2020 ; Feldman , 2020 ; Brown et al. , 2020 ) . In such cases , flexible exemplar-based learning that generalizes based on dense similarity is preferable ( Zhang et al. , 2016 ; Arpit et al. , 2017 ) . The protocol we present allows us to empirically measure the exemplar-vs-rule bias of a learner and therefore navigate the exemplar-vs-rule trade-off in various scenarios . 3 A PROTOCOL FOR EXAMINING INDUCTIVE BIAS . We embed the structure of the category learning problem discussed in Section ( 2 ) into a statistical learning problem that can be applied across domains to test black-box learners . Problem setting . We consider a setting where inputs are a composition of categorical attributes ( oracle setting in Andreas , 2019 ) with two latent binary features , zdisc , zdist , ∈ { 0 , 1 } that jointly determine the observation x via some mapping g : { 0 , 1 } 2 → X ; see Fig . ( 2 ) . These features can be derived from a richer set , e.g. , the median of a continuous feature ( see Appendix ) . We consider the training condition feature space cue conflict zero shot partial exposure extrapolation π0 = 0.5 , π1 = 0.5 π0 = 1.0 , π1 = 0.0 π0 = 0.0 , π1 = 0.0 π0 = 0.5 , π1 = 0.0 π1 = 1.0 binary classification task of fitting a model f̂ : X → { 0 , 1 } from a given model family F to predict a binary label for each observation . One of the underlying features , the discriminant , zdisc , defines the decision boundary ; the other one , the distractor , zdist , is not independently predictive of the label . This specifies a generative process x , zdisc , zdist ∼ p ( x | zdisc , zdist ) p ( zdisc , zdist ) . p ( x | zdisc , zdist ) is either generated ( e.g. , in Section ( 4 ) ) , or the empirical distribution of the subset of datapoints x with the corresponding underlying feature values ( assuming access to these annotations , e.g. , in Sections ( 5 ) and ( 6 ) ) . p ( zdisc , zdist ) is varied across training conditions , as outlined below . Training conditions . The upper-right quadrant in all subfigures of Fig . ( 2 ) , for which p ( zdisc = 1 , zdist = 1 ) = 1 , acts as a hold-out set on which we can evaluate generalization to an unseen combination of attribute values . We produce multiple training conditions with the remaining three quadrants of data by manipulating p ( zdisc , zdist ) . All the analyses in this paper compare model extrapolation to the held-out test quadrant across various training conditions . To equalize the class base rates we balance all training conditions across the discriminant ; i.e. , we enforce p ( zdisc = 0 ) = p ( zdisc = 1 ) = 0.5 . We also fix the number of datapoints across all conditions at N ; With these constraints , we can control p ( zdisc , zdist ) via two degrees of freedom : π0 = p ( zdist = 1 | zdisc = 0 ) ( this implicitly fixes p ( zdist = 0 | zdisc = 0 ) = 1 − π0 to balance the dataset ) ; and π1 = p ( zdist = 1 | zdisc = 1 ) .The three conditions in Section ( 2 ) , as well as the held-out test set , correspond to particular settings of π0 and π1 ( shown in Fig . ( 2 ) , more in Appendix ( A.2 ) ) . Measuring inductive bias . For a given model family F , let f̂ ZS denote the result of selecting a model from F by training in the zero-shot condition , and similarly f̂ PE and f̂ CC . Feature-level bias ( FLB ) and exemplar-vs-rule propensity ( EVR ) are measured as : FLB ( F ) = E [ ( A ( y , f̂ CC ( x ) ) ] − 0.5 , ( 1 ) EVR ( F ) = E [ A ( y , f̂ ZS ( x ) ) ] − E [ A ( y , f̂ PE ( x ) ) ] ( 2 ) where the expectation is taken with respect to the the data distribution under the extrapolation region ( i.e. , p ( x , y | π0 = 1 , π1 = 1 ) ) , A is the 0-1 accuracy . FLB takes values between -0.5 and 0.5 ( indicating bias toward zdist or zdisc , respectively ) ; 0 represents no feature bias . EVR takes values between 0 and 1 ( indicating rule-based and exemplar-based extrapolation , respectively ) . Related formalisms and spurious correlation . This binary formulation of discriminant and distractor features has previously been studied in the context of spurious correlation ( Sagawa et al. , 2020 ) . Rather than independently varying occupancy in the four quadrants , they directly manipulate the ( spurious ) linear correlation between the distractor and the discriminant features ( pmaj ) . In combinatorial feature spaces , a scalar spurious correlation insufficiently specifies the data distribution . The linear correlation coefficient ρ between zdisc and zdist—henceforth “ spurious correlation ” —can be written in terms of π0 and π1 : ρ ( π0 , π1 ) = α√ β ( 1− β ) ; α = π0 − π1 2 , β = π0 + π1 2 . ( 3 ) Different π0 and π1 combinations can give equal ρ ( see contours in Fig . ( 3 ) , dots indicate points along the equi-correlation contour that intersects with the PE condition : ( π0 = 0.5 , π1 = 0.0 , ρ = 0.58 ) ) . In this paper we demonstrate that different data distributions with the same spurious correlation can result in vastly different generalization behavior to the under-represented extrapolation quadrant . This indicates that sensitivity to spurious correlation is an underspecified inductive bias—we risk conflating conceptually distinct sources of inductive bias by focusing on this single metric . We argue for a formulation like ours—based on manipulating feature combinations—that can tease apart distinct inductive biases : at the level of what features a system finds easier to learn ( FLB ) as well as how to use these features to inform a decision boundary ( EVR ) . We discuss how these biases can be interdependent , but capture distinct behaviors that sensitivity to spurious correlation can not explain , thereby providing a more comprehensive picture of how a system generalizes .
The generalization of data distributions to unseen regions, i.e., extrapolation, remains one of the critical challenges in machine learning. The inductive biases of the learner determine such extrapolation. Unfortunately, machine learning systems often do not share the same inductive biases as humans and, as a result, may extrapolate in ways that do not match the analyst's expectations. The authors investigated two different types of such inductive bias: feature-level bias (differences in which features are more easily learned) and exemplar-based and rule-based bias (differences in how learned features are used for generalization). Inspired by these experimental approaches, we have proposed a protocol to investigate this trade-off in learning systems directly. We present empirical results for a range of models and the domains of explanatory images and language. We demonstrate that controlling for feature-level bias while measuring the trade-off between exemplars and rules provides a complete picture of extrapolative behavior than existing formalisms.
SP:95f67c4f7401f56019a7f6effd868750d9c2d8aa
Distinguishing rule- and exemplar-based generalization in learning systems
1 INTRODUCTION . Extrapolation or generalization—decisions on unseen datapoints—is always underdetermined by data ; which particular extrapolation behavior an algorithm exhibits is determined by the algorithm ’ s inductive biases ( Mitchell , 1980 ) . For modern deep learning systems , these inductive biases often deviate from those in humans . When the inductive biases of ML systems are opaque , and guarantees on extrapolation are not possible—as is often the case with many modern ML systems ( D ’ Amour et al. , 2020 ) —we can instead turn to empirical study of the behavior of a system to derive principles about the system ’ s operation . Cognitive psychology provides a rich basis for experimental designs to study the often-opaque human cognitive system via its external behavior . These can be leveraged to distinguish between competing hypotheses about a machine learning system ’ s inductive biases in the same manner ( Ritter et al. , 2017b ; Lake et al. , 2018 ; Dasgupta et al. , 2019 ) . In this paper , we draw on methods from cognitive psychology to define a protocol that teases apart the different inductive biases that go into informing how an opaque learning system extrapolates outside its training distribution . We focus in particular on combinatorial generalization for classification in the presence of spurious correlation . Our protocol goes significantly beyond existing work by controlling for various confounds . We isolate two distinct kinds of inductive bias—feature-level bias and exemplar-rule bias—that have different effects on model extrapolation . We examine these inductive biases across models in an expository points-in-a-plane setting , as well as in naturalistic image and language domains . Finally , we discuss the implications of these inductive biases and their relation to previous work on data augmentation and spurious correlation . Feature-level bias measures which features a system finds easier or harder to learn . This informs which feature a system will generalize on the basis of when both features are correlated or confounded . This kind of feature-level bias has been studied extensively in human cognition ( Landau et al. , 1988 ; Hudson Kam & Newport , 2005 ) . There has also been recent work—directly inspired by these observations ratio of predictions condition training examples extrapolation humans rule-based exemplar-based ( shape-biased ) ( no feature bias ) ( no feature bias ) cognitive psychology studies—that examines similar biases in artificial neural networks , most notably the “ shape-bias ” , the tendency to generalize image category labels according to shape rather than according to color or texture ( Ritter et al. , 2017a ; Hermann et al. , 2019 ; Geirhos et al. , 2018 ) . While there exists previous work examining specific feature biases in deep learning , we present a more general measure of feature-level bias as well as demonstrate how it interacts with—but is distinct from—another kind of inductive bias , viz . exemplar-vs-rule bias . Exemplar-vs-rule bias measures how a system uses features to inform decisions by trading off between exemplar- and rule-based generalization . A rule-based categorization decision is made on the basis of minimal features that support the category boundary ( e.g. , Ashby & Townsend , 1986 ) , while an exemplar-based decision-maker generalizes a category on the basis of similarity to category exemplars ( e.g. , Shepard & Chang , 1963 ) , and therefore may invoke many or all features that underlie a category . Extensive empirical work in cognitive psychology has found evidence of both kinds of generalization in humans ( Nosofsky et al. , 1989 ; Rips , 1989 ; Allen & Brooks , 1991 ; Rips & Collins , 1993 ; Smith & Sloman , 1994 ) . This trade-off can be understood intuitively as a continuum that varies the number of features employed to discriminate between categories ( Pothos , 2005 ) .1 This continuum also plays a role in representation learning systems such as deep neural networks ( Hinton & Salakhutdinov , 2006 ) , where feature selection is automated . 2 AN ILLUSTRATIVE EXAMPLE . We first examine an intuitive example that highlights the distinct inductive biases we care about . Consider the category learning paradigm in Fig . ( 1 ) . The stimuli vary along two feature dimensions , shape and color . Color determines the label of an object ( i.e. , green objects are “ dax ” ; purple are “ fep ” ) , and shape is unrelated to the underlying category structure and acts as a distractor . Participants ( either humans or artificial learning systems ) are independently placed in three different conditions— cue conflict , zero shot , and partial exposure—that vary in coverage of the feature space . After observing the training examples , the participant is presented with an extrapolation test consisting of an example outside the support of feature combinations observed during training ( i.e. , to classify the green circle as a “ dax ” or a “ fep , ” using arbitrary names to demonstrate that which feature is relevant to the category boundary is not given ) . We explain below how differences in classification behavior on this extrapolation isolate feature-level bias as well as exemplar-vs-rule bias . We encourage the reader to try the experiment themselves to examine their intuitions . Cue conflict ( CC , top row , Fig . ( 1 ) ) . The data presented in this condition confound color and shape ( i.e. , color and shape are equally predictive of the category boundary ) . How a system generalizes here directly measures its feature-level bias towards color or shape . 1We leave to future work the details of mathematically formalizing the properties of statistical learners that result in exemplar-vs-rule bias . We instead focus on the behavioral manifestations of this inductive bias and present an empirical protocol to measure it , even in opaque systems . Characteristic behavior ( right half of Fig . ( 1 ) ) . Since humans have an established shape bias ( Landau et al. , 1988 ) , we expect that humans will classify the test item according to the object that shares its shape , not its color ; in this case , as a “ fep. ” However , this inductive bias is not shared by ruleand exemplar-based reasoners that have no a priori propensity for features , and are equally likely to classify the test item as a “ dax ” or a “ fep. ” Zero shot ( ZS , middle row , Fig . ( 1 ) ) . This condition requires extrapolation to a new feature value “ zero-shot ” ( i.e. , without prior exposure ) . This setting is often used to examine out-of-domain ( OOD ) and compositional generalization in machine learning ( Xian et al. , 2018 ) . Behavior in this condition reveals whether the model has learned the discriminating features and whether it can extrapolate to new feature values , and thus acts as a baseline . Characteristic behavior ( right half , Fig . ( 1 ) ) . Rule- and exemplar-based behavior in this condition is confounded . A rule-based learner infers the minimal rule that color determines label , does not assign any predictive value to shape , and therefore classifies the extrapolation stimulus based on color as a “ dax. ” An exemplar-based learner categorizes based on the similarity along all feature dimensions of the extrapolation stimulus to category exemplars . Both training exemplars have no overlap with the test stimulus along the shape dimension , but the “ dax ” overlaps along the color dimension , and the learner categorizes it as a “ dax. ” Partial exposure ( PE , bottom row , Fig . ( 1 ) ) . Compared to zero shot , participants in this condition also receive “ partial exposure ” to a new feature value ( i.e. , circle ) along the shape dimension . This setting is most similar to combinatorial zero-shot generalization ( e.g. , Lake & Baroni , 2018a ) , where the learner is exposed independently to all feature values but has to generalize to a new combination . Characteristic behavior ( right half of Fig . ( 1 ) ) . This setting meaningfully distinguishes rule- and exemplar-based generalization . To understand the behavior of these two systems , we contrast this condition to the cue-conflict condition . The addition of the purple diamond-shaped “ fep ” means the learner has seen both a diamond and a circle labeled “ fep ” . A rule-based learner takes this as direct evidence that shape is not predictive of category label and classifies the extrapolation stimulus on the basis of color as a “ dax. ” This is typically also how humans extrapolate . This additional training example , however , does not impact an exemplar-based system , since it does not share any features with the extrapolation stimulus . The exemplar-based reasoner classifies on the basis of feature-overlap with training exemplars and is therefore indifferent , exactly as in the cue-conflict condition . From behavior to inductive bias . Feature-level bias is measured as deviation from chance performance in the CC condition . Exemplar-vs-rule bias is measured by the difference between performance in the PE and ZS conditions—-no difference indicates rule-based generalization , while the magnitude of the difference measures exemplar propensity . Pure exemplar-based reasoning implies no difference between the PE and CC conditions , while a non-zero difference indicates partial rule propensity . Implications . A purely exemplar-based system doesn ’ t learn decision boundaries that operate over minimal features . It instead favors a decision boundary that weights all features . This is undesirable in domains where not all feature combinations will be observed , and systematic generalization to unobserved combinations is expected ( Lake et al. , 2018 ; Marcus , 2018 ; Arjovsky et al. , 2019 ) . On the other hand , a rule-based system that applies the same category decision rules across all data regions might over-generalize , which is undesirable in some naturally occurring long-tailed distributions ( Feldman & Zhang , 2020 ; Feldman , 2020 ; Brown et al. , 2020 ) . In such cases , flexible exemplar-based learning that generalizes based on dense similarity is preferable ( Zhang et al. , 2016 ; Arpit et al. , 2017 ) . The protocol we present allows us to empirically measure the exemplar-vs-rule bias of a learner and therefore navigate the exemplar-vs-rule trade-off in various scenarios . 3 A PROTOCOL FOR EXAMINING INDUCTIVE BIAS . We embed the structure of the category learning problem discussed in Section ( 2 ) into a statistical learning problem that can be applied across domains to test black-box learners . Problem setting . We consider a setting where inputs are a composition of categorical attributes ( oracle setting in Andreas , 2019 ) with two latent binary features , zdisc , zdist , ∈ { 0 , 1 } that jointly determine the observation x via some mapping g : { 0 , 1 } 2 → X ; see Fig . ( 2 ) . These features can be derived from a richer set , e.g. , the median of a continuous feature ( see Appendix ) . We consider the training condition feature space cue conflict zero shot partial exposure extrapolation π0 = 0.5 , π1 = 0.5 π0 = 1.0 , π1 = 0.0 π0 = 0.0 , π1 = 0.0 π0 = 0.5 , π1 = 0.0 π1 = 1.0 binary classification task of fitting a model f̂ : X → { 0 , 1 } from a given model family F to predict a binary label for each observation . One of the underlying features , the discriminant , zdisc , defines the decision boundary ; the other one , the distractor , zdist , is not independently predictive of the label . This specifies a generative process x , zdisc , zdist ∼ p ( x | zdisc , zdist ) p ( zdisc , zdist ) . p ( x | zdisc , zdist ) is either generated ( e.g. , in Section ( 4 ) ) , or the empirical distribution of the subset of datapoints x with the corresponding underlying feature values ( assuming access to these annotations , e.g. , in Sections ( 5 ) and ( 6 ) ) . p ( zdisc , zdist ) is varied across training conditions , as outlined below . Training conditions . The upper-right quadrant in all subfigures of Fig . ( 2 ) , for which p ( zdisc = 1 , zdist = 1 ) = 1 , acts as a hold-out set on which we can evaluate generalization to an unseen combination of attribute values . We produce multiple training conditions with the remaining three quadrants of data by manipulating p ( zdisc , zdist ) . All the analyses in this paper compare model extrapolation to the held-out test quadrant across various training conditions . To equalize the class base rates we balance all training conditions across the discriminant ; i.e. , we enforce p ( zdisc = 0 ) = p ( zdisc = 1 ) = 0.5 . We also fix the number of datapoints across all conditions at N ; With these constraints , we can control p ( zdisc , zdist ) via two degrees of freedom : π0 = p ( zdist = 1 | zdisc = 0 ) ( this implicitly fixes p ( zdist = 0 | zdisc = 0 ) = 1 − π0 to balance the dataset ) ; and π1 = p ( zdist = 1 | zdisc = 1 ) .The three conditions in Section ( 2 ) , as well as the held-out test set , correspond to particular settings of π0 and π1 ( shown in Fig . ( 2 ) , more in Appendix ( A.2 ) ) . Measuring inductive bias . For a given model family F , let f̂ ZS denote the result of selecting a model from F by training in the zero-shot condition , and similarly f̂ PE and f̂ CC . Feature-level bias ( FLB ) and exemplar-vs-rule propensity ( EVR ) are measured as : FLB ( F ) = E [ ( A ( y , f̂ CC ( x ) ) ] − 0.5 , ( 1 ) EVR ( F ) = E [ A ( y , f̂ ZS ( x ) ) ] − E [ A ( y , f̂ PE ( x ) ) ] ( 2 ) where the expectation is taken with respect to the the data distribution under the extrapolation region ( i.e. , p ( x , y | π0 = 1 , π1 = 1 ) ) , A is the 0-1 accuracy . FLB takes values between -0.5 and 0.5 ( indicating bias toward zdist or zdisc , respectively ) ; 0 represents no feature bias . EVR takes values between 0 and 1 ( indicating rule-based and exemplar-based extrapolation , respectively ) . Related formalisms and spurious correlation . This binary formulation of discriminant and distractor features has previously been studied in the context of spurious correlation ( Sagawa et al. , 2020 ) . Rather than independently varying occupancy in the four quadrants , they directly manipulate the ( spurious ) linear correlation between the distractor and the discriminant features ( pmaj ) . In combinatorial feature spaces , a scalar spurious correlation insufficiently specifies the data distribution . The linear correlation coefficient ρ between zdisc and zdist—henceforth “ spurious correlation ” —can be written in terms of π0 and π1 : ρ ( π0 , π1 ) = α√ β ( 1− β ) ; α = π0 − π1 2 , β = π0 + π1 2 . ( 3 ) Different π0 and π1 combinations can give equal ρ ( see contours in Fig . ( 3 ) , dots indicate points along the equi-correlation contour that intersects with the PE condition : ( π0 = 0.5 , π1 = 0.0 , ρ = 0.58 ) ) . In this paper we demonstrate that different data distributions with the same spurious correlation can result in vastly different generalization behavior to the under-represented extrapolation quadrant . This indicates that sensitivity to spurious correlation is an underspecified inductive bias—we risk conflating conceptually distinct sources of inductive bias by focusing on this single metric . We argue for a formulation like ours—based on manipulating feature combinations—that can tease apart distinct inductive biases : at the level of what features a system finds easier to learn ( FLB ) as well as how to use these features to inform a decision boundary ( EVR ) . We discuss how these biases can be interdependent , but capture distinct behaviors that sensitivity to spurious correlation can not explain , thereby providing a more comprehensive picture of how a system generalizes .
This paper studies the extrapolation of machine learning models to unseen regions, and specifically studies two types of biases: feature-level bias (differences in which features are more readily learned) and exemplar-vs-rule bias (differences in how these learned features are used for generalization). Motivated by the studies of exemplar vs. rule-based generalization in cognitive psychology, the authors present a protocol directly probing this trade-off in machine learning systems. The authors present empirical results across a range of models in both expository and real-world image and language domains and demonstrate that using the trad off provides a more complete picture of extrapolation behaviour than existing methods.
SP:95f67c4f7401f56019a7f6effd868750d9c2d8aa
Imbalanced Adversarial Training with Reweighting
1 INTRODUCTION . The existence of adversarial samples ( Szegedy et al. , 2013 ; Goodfellow et al. , 2014 ) has risen huge concerns on applying deep neural network ( DNN ) models into security-critical applications , such as autonomous driving ( Chen et al. , 2015 ) and video surveillance systems ( Kurakin et al. , 2016 ) . As countermeasures against adversarial attacks , adversarial training ( Madry et al. , 2017 ; Zhang et al. , 2019 ; Wang et al. , 2019 ) has been empirically proven to be one of the most effective and reliable defense methods . In general , it can be formulated to minimize the model ’ s average error on adversarially perturbed input examples ( Madry et al. , 2017 ) . Although promising to improve the model ’ s robustness , most existing adversarial training methods assume that the number of training examples from each class is equally distributed . However , datasets collected from real-world applications typically have imbalanced distribution ( Everingham et al. , 2010 ; Lin et al. , 2014 ) . Hence , it is natural to ask : What is the behavior of adversarial training under imbalanced scenarios ? Can we directly apply existing imbalanced learning strategies in natural training to tackle the imbalance issue for adversarial training ? Recent studies find that adversarial training usually presents distinct properties from natural training . For example , compared to natural training , adversarially trained models suffer more from the overfitting issue ( Schmidt et al. , 2018 ) , and they tend to present strong class-wise performance disparities , even if the training examples are uniformly distributed over different classes ( Xu et al. , 2020a ) . Imagine that if the training data distribution is highly imbalanced , these properties of adversarial training can be greatly exaggerated and make it extremely difficult to be applied in practice . Therefore , it is necessary but challenging to answer aforementioned questions . As the initial effort to study the imbalanced problem in adversarial training , in this work , we first investigate the performance of existing adversarial training under imbalanced settings . As a preliminary study shown in Section 2.1 , we apply both natural training and PGD adversarial training ( Madry et al. , 2017 ) on multiple imbalanced training datasets constructed from CIFAR10 training dataset ( Krizhevsky et al. , 2009 ) and evaluate trained models ’ performance on class-balanced test dataset . From the preliminary results , we observe that , compared to naturally trained models , adversarially trained models always present very low standard & robust accuracy1 on under-represented classes . This observation suggests that adversarial training is more sensitive to imbalanced data distribution than natural training . Thus , when applying adversarial training in practice , imbalance learning strategies should always be considered for help . As a result , we explore potential solutions which can handle the imbalance issue for adversarial training . In this work , we focus on studying the behavior of the reweighting strategy ( He & Ma , 2013 ) and leave other strategies such as resampling ( Estabrooks et al. , 2004 ) for one future work . In Section 2.2 , we apply the reweighting strategy to adversarial training with varied weights assigning to one under-represented class and evaluate trained models ’ performance . From the results , we observe that , in adversarial training , increasing weights for an under-represented class can substantially improve the standard & robust accuracy on this class , but drastically hurt the model ’ s performance on the well-represented class . This finding indicates that the performance of adversarially trained models is very sensitive to the reweighting manipulations and it could be very hard to figure out an eligible reweighting strategy which is optimal for all classes . It is also worth noting that , in natural training , we find that upweighting the under-represented class increases model ’ s standard accuracy on this class but only slightly hurts the accuracy on the well-represented class , even when adopting a large weight for the under-represent class . To further investigate the possible reasons leading to different behaviors of the reweighing strategy in natural and adversarial training , we visualize their learned features ( in Figure 3 ) , and observe that features learned by the adversarially trained model of different classes tend to mix together while they are well separated for the naturally trained model . This observation motivates us to theoretically show that when the given data distribution has poor data separability , upweighting under-represented classes will hurt the model ’ s performance on well-represented classes . Motivated by our theoretical understanding , we propose a novel framework Separable Reweighted Adversarial Training ( SRAT ) to facilitate the reweighting strategy in imbalanced adversarial training by enhancing the separability of learned features . Through extensive experiments , we validate the effectiveness of SRAT . 2 PRELIMINARY STUDY . 2.1 THE BEHAVIOR OF ADVERSARIAL TRAINING . In this subsection , we conduct preliminary studies to examine the performance of PGD adversarial training ( Madry et al. , 2017 ) . Following previous works ( Cui et al. , 2019 ; Cao et al. , 2019 ) , we construct an imbalanced CIFAR10 ( Krizhevsky et al. , 2009 ) training dataset , where each of the first 5 classes ( a.k.a . well-represented classes ) has 5,000 training examples and each of the last 5 classes ( a.k.a . under-represented classes ) has 50 training examples . Figure 1 shows the performance of naturally and adversarially trained models using a ResNet18 ( He et al. , 2016 ) architecture . From the figure , we can observe that , compared with natural training , PGD adversarial training will result in a larger performance gap between well-represented classes and under-represented classes . For example , in natural training , the ratio between the average standard 1In this work , we denote standard accuracy as model ’ s accuracy on the input samples without perturbations and robust accuracy as model ’ s accuracy on the input samples which are adversarially perturbed . Without clear clarification , we consider the perturbation is constrained by l∞-norm 8/255 . accuracy of well-represented classes ( brown ) and under-represented classes ( violet ) is about 2:1 , while in adversarial training , this ratio expands to 16:1 . Moreover , for adversarial training , it has extremely poor performance on under-represented classes . There are 3 out of the 5 under-represented classes with 0 % standard & robust accuracy . As a conclusion , the performance of adversarial training is easier to be affected by imbalanced distribution than natural training and suffers more on under-represented classes . More results are reported in Appendix A.1 , which further support our findings . 2.2 THE REWEIGHTING STRATEGY IN NATURAL TRAINING V.S . IN ADVERSARIAL TRAINING . The preliminary study in Section 2.1 demonstrates that it is highly demanding to adjust the original adversarial training methods to accommodate imbalanced data distribution . Next , we investigate the effectiveness of adopting the reweighting strategy ( He & Ma , 2013 ) in adversarial training . Our experiments are conducted under a binary classification setting , where the training dataset contains two classes that are randomly selected from CIFAR10 dataset , with each class having 5,000 and 50 training examples respectively . Based on this training dataset , we arrange multiple trails of ( reweighted ) natural training and ( reweighted ) adversarial training , with the weight ratio between the under-represented class and well-represented class ranging from 1:1 to 200:1 . Figure 2 shows the experimental results with training data sampled from the classes “ cat ” and “ horse ” . As demonstrated in Figure 2 , increasing the weight for the under-represented class ( horse ) will drastically increase the model ’ s performance on this class , while also immensely decreasing the performance on the well-represented class ( cat ) . For example , when increasing the weight ratio from 1:1 to 150:1 , the standard accuracy of the under-represented class is improved from 0 % to∼ 60 % and its robust accuracy from 0 % to ∼ 50 % . However , the standard accuracy on the well-represented class drops from 100 % to 60 % , and its robust accuracy drops from 100 % to 50 % . These results illustrate that adversarial training ’ s performance can be significantly affected by the reweighting strategy . As a result , the reweighting strategy in this setting can hardly help improve the overall performance no matter which weight ratio is chosen , because the model ’ s performance always presents a strong tension between these two classes . More experiments using different binary imbalanced datasets are reported in Appendix A.2 , where we have similar observations . 3 THEORETICAL ANALYSIS . In Section 2.2 , we observe that in natural training , the reweighting strategy can only make a small impact on the two classes ’ performance . This phenomenon has been extensively studied by recent works ( Byrd & Lipton , 2019 ; Xu et al. , 2021 ) , where they find that a linear classifier optimized by SGD on a linearly separable data will converge to the solution of the hard-margin support vector machine ( Noble , 2006 ) . In other words , as long as the data can be well separated , reweighting will not make huge influence on the finally trained models . Inspired by their conclusions , we hypothesize that , as the adversarially trained models separate the data poorly , their performance is highly sensitive to the reweighting strategy . As a direct validation of our hypothesis , in Figure 3 , we visualize the learned ( penultimate layer ) features of the imbalanced training examples used in the binary classification problem in Section 2.2 . We find that adversarially trained models do present obviously poorer separability on the learned features . Next , we theoretically analyze the impact of reweighting on linear models which are optimized under poorly separable data and provide all detailed proof in Appendix A.3 . Binary Classification Problem . To construct the theoretical study , we focus on a binary classification problem , with a Gaussian mixture distribution D which is defined as : y ∼ { −1 , +1 } , x ∼ { N ( µ , σ2I ) , if y = +1 N ( −µ , σ2I ) , if y = −1 and µ = ( dim=d︷ ︸︸ ︷ η , ... , η ) , ( 1 ) where the two classes ’ centers ( ±µ ∈ Rd ) with each dimension have mean value ±η ( η > 0 ) and variance σ2 . Formally , we define the data separability as S = η/σ2 . Intuitively , when S is larger , it suggests that two classes are well separated . Previous work ( Byrd & Lipton , 2019 ) also closely studied this term to describe data separability . Besides , we assume the imbalanced training dataset satisfying the condition Pr . ( y = +1 ) = K · Pr . ( y = −1 ) and K > 1 , which indicates the imbalance ratio between two classes . During test , we assume two classes have the equal probability to appear . Under the data distribution D , we will discuss the performance of linear classifiers f ( x ) = sign ( wTx− b ) where w and b are the weight and bias terms of the model f . If a reweighting strategy is involved , we define the model upweights the under-represented class “ -1 ” by ρ. Lemma 3.1 Under the data distribution D as defined in Eq . ( 1 ) , with an imbalanced ratio K and a reweight ratio ρ , the optimal classifier which minimizes the ( reweighted ) empirical risk : f∗ = argmin f ( Pr . ( f ( x ) ̸=y|y=−1 ) · Pr . ( y=−1 ) · ρ+ Pr . ( f ( x ) ̸=y|y=+1 ) · Pr . ( y=+1 ) ) ( 2 ) has the solution : w = 1 and b = 12 log ( ρ K ) dσ2 η = 1 2 log ( ρ K ) d S . Lemma 3.1 indicates that the final optimized classifier has a weight vector equal to 1 and its bias term b only depends on K , ρ and the data separability S. In the following , we first focus on one special setting when ρ = 1 , which is the original ERM model without reweighting . Specifically , we aim to compare the behavior of linear models when they can poorly separate data ( like adversarial trained models ) or they can well separate data ( like naturally trained models ) . Theorem 3.1 Under two data distributions ( x ( 1 ) , y ( 1 ) ) ∈ D1 and ( x ( 2 ) , y ( 2 ) ) ∈ D2 with different separabilities S1 > S2 , let f∗1 and f ∗ 2 be the optimal non-reweighted classifiers ( ρ = 1 ) under D1 and D2 , respectively . Given the imbalance ratio K is large enough , we have : Pr . ( f∗1 ( x ( 1 ) ) ̸= y ( 1 ) |y ( 1 ) = −1 ) − Pr . ( f∗1 ( x ( 1 ) ) ̸= y ( 1 ) |y ( 1 ) = +1 ) < Pr . ( f∗2 ( x ( 2 ) ) ̸= y ( 2 ) |y ( 2 ) = −1 ) − Pr . ( f∗2 ( x ( 2 ) ) ̸= y ( 2 ) |y ( 2 ) = +1 ) . ( 3 ) Intuitively , Theorem 3.1 suggests that when the data separability S is low ( such as D2 ) , the optimized classifier ( without reweighting ) can intrinsically have a larger error difference between the underrepresented class “ -1 ” and the well-represented class “ +1 ” . Similar to the observation in Section 2.1 and Figure 3 , adversarially trained models present a weak ability to separate data , and they also present a strong performance gap between the well-represented class and under-represented class . Conclusively , Theorem 3.1 indicates that the poor ability to separate the training data can be one important reason which leads to the strong performance gap of adversarially trained models . Next , we consider the case when the reweighting strategy is applied . In particular , we compare the impact of upweighting the under-represented class on the performance of well-represented class . Theorem 3.2 Under two data distributions ( x ( 1 ) , y ( 1 ) ) ∈ D1 and ( x ( 2 ) , y ( 2 ) ) ∈ D2 with different separabilities S1 > S2 , let f∗1 and f ∗ 2 be the optimal non-reweighted classifiers ( ρ = 1 ) under D1 and D2 , respectively , and let f ′1 ∗ and f ′2 ∗ be the optimal reweighted classifiers under D1 and D2 given the optimal reweighting ratio ( ρ = K ) . Given the imbalance ratio K is large enough , we have : Pr . ( f ′1 ∗ ( x ( 1 ) ) ̸= y ( 1 ) |y ( 1 ) = +1 ) − Pr . ( f∗1 ( x ( 1 ) ) ̸= y ( 1 ) |y ( 1 ) = +1 ) < Pr . ( f ′2 ∗ ( x ( 2 ) ) ̸= y ( 2 ) |y ( 2 ) = +1 ) − Pr . ( f∗2 ( x ( 2 ) ) ̸= y ( 2 ) |y ( 2 ) = +1 ) . ( 4 ) As Theorem 3.2 shows , when the data distribution has poorer data separability ( such asD2 ) , upweighting the under-represented class can cause greater hurt on the performance of the well-represented class . It is also consistent with our empirical findings about adversarial training models . Since the adversarially trained models poorly separate the data ( Figure 3 ) , upweighting the under-represented class always drastically decreases the performance of the well-represented class ( Section 2.2 ) . Through the discussions in both Theorem 3.1 and Theorem 3.2 , we conclude that the poor separability can be one important reason which makes adversarial training and its reweighted variants extremely difficult to achieve good performance under imbalance data distribution . Therefore , in the next section , we will explore potential solutions which can facilitate the reweighting strategy in adversarial training .
This paper studies the effect of adversarial training (AT) in the context of imbalanced datasets. In particular, the authors demonstrate empirically that adversarially trained models tend to have a larger gap in accuracy between well and under represented classes, as compared to their standard counterparts. Moreover, they show that standard reweighting strategies do not considerably alleviate this issue. Motivated by their findings, they propose adding a regularization function to adversarial training to encourage greater feature separation between classes (SRAT), and study its effectiveness on unbalanced datasets.
SP:378cb82dfa688149528379e5a2d0b72468d15cdb
Imbalanced Adversarial Training with Reweighting
1 INTRODUCTION . The existence of adversarial samples ( Szegedy et al. , 2013 ; Goodfellow et al. , 2014 ) has risen huge concerns on applying deep neural network ( DNN ) models into security-critical applications , such as autonomous driving ( Chen et al. , 2015 ) and video surveillance systems ( Kurakin et al. , 2016 ) . As countermeasures against adversarial attacks , adversarial training ( Madry et al. , 2017 ; Zhang et al. , 2019 ; Wang et al. , 2019 ) has been empirically proven to be one of the most effective and reliable defense methods . In general , it can be formulated to minimize the model ’ s average error on adversarially perturbed input examples ( Madry et al. , 2017 ) . Although promising to improve the model ’ s robustness , most existing adversarial training methods assume that the number of training examples from each class is equally distributed . However , datasets collected from real-world applications typically have imbalanced distribution ( Everingham et al. , 2010 ; Lin et al. , 2014 ) . Hence , it is natural to ask : What is the behavior of adversarial training under imbalanced scenarios ? Can we directly apply existing imbalanced learning strategies in natural training to tackle the imbalance issue for adversarial training ? Recent studies find that adversarial training usually presents distinct properties from natural training . For example , compared to natural training , adversarially trained models suffer more from the overfitting issue ( Schmidt et al. , 2018 ) , and they tend to present strong class-wise performance disparities , even if the training examples are uniformly distributed over different classes ( Xu et al. , 2020a ) . Imagine that if the training data distribution is highly imbalanced , these properties of adversarial training can be greatly exaggerated and make it extremely difficult to be applied in practice . Therefore , it is necessary but challenging to answer aforementioned questions . As the initial effort to study the imbalanced problem in adversarial training , in this work , we first investigate the performance of existing adversarial training under imbalanced settings . As a preliminary study shown in Section 2.1 , we apply both natural training and PGD adversarial training ( Madry et al. , 2017 ) on multiple imbalanced training datasets constructed from CIFAR10 training dataset ( Krizhevsky et al. , 2009 ) and evaluate trained models ’ performance on class-balanced test dataset . From the preliminary results , we observe that , compared to naturally trained models , adversarially trained models always present very low standard & robust accuracy1 on under-represented classes . This observation suggests that adversarial training is more sensitive to imbalanced data distribution than natural training . Thus , when applying adversarial training in practice , imbalance learning strategies should always be considered for help . As a result , we explore potential solutions which can handle the imbalance issue for adversarial training . In this work , we focus on studying the behavior of the reweighting strategy ( He & Ma , 2013 ) and leave other strategies such as resampling ( Estabrooks et al. , 2004 ) for one future work . In Section 2.2 , we apply the reweighting strategy to adversarial training with varied weights assigning to one under-represented class and evaluate trained models ’ performance . From the results , we observe that , in adversarial training , increasing weights for an under-represented class can substantially improve the standard & robust accuracy on this class , but drastically hurt the model ’ s performance on the well-represented class . This finding indicates that the performance of adversarially trained models is very sensitive to the reweighting manipulations and it could be very hard to figure out an eligible reweighting strategy which is optimal for all classes . It is also worth noting that , in natural training , we find that upweighting the under-represented class increases model ’ s standard accuracy on this class but only slightly hurts the accuracy on the well-represented class , even when adopting a large weight for the under-represent class . To further investigate the possible reasons leading to different behaviors of the reweighing strategy in natural and adversarial training , we visualize their learned features ( in Figure 3 ) , and observe that features learned by the adversarially trained model of different classes tend to mix together while they are well separated for the naturally trained model . This observation motivates us to theoretically show that when the given data distribution has poor data separability , upweighting under-represented classes will hurt the model ’ s performance on well-represented classes . Motivated by our theoretical understanding , we propose a novel framework Separable Reweighted Adversarial Training ( SRAT ) to facilitate the reweighting strategy in imbalanced adversarial training by enhancing the separability of learned features . Through extensive experiments , we validate the effectiveness of SRAT . 2 PRELIMINARY STUDY . 2.1 THE BEHAVIOR OF ADVERSARIAL TRAINING . In this subsection , we conduct preliminary studies to examine the performance of PGD adversarial training ( Madry et al. , 2017 ) . Following previous works ( Cui et al. , 2019 ; Cao et al. , 2019 ) , we construct an imbalanced CIFAR10 ( Krizhevsky et al. , 2009 ) training dataset , where each of the first 5 classes ( a.k.a . well-represented classes ) has 5,000 training examples and each of the last 5 classes ( a.k.a . under-represented classes ) has 50 training examples . Figure 1 shows the performance of naturally and adversarially trained models using a ResNet18 ( He et al. , 2016 ) architecture . From the figure , we can observe that , compared with natural training , PGD adversarial training will result in a larger performance gap between well-represented classes and under-represented classes . For example , in natural training , the ratio between the average standard 1In this work , we denote standard accuracy as model ’ s accuracy on the input samples without perturbations and robust accuracy as model ’ s accuracy on the input samples which are adversarially perturbed . Without clear clarification , we consider the perturbation is constrained by l∞-norm 8/255 . accuracy of well-represented classes ( brown ) and under-represented classes ( violet ) is about 2:1 , while in adversarial training , this ratio expands to 16:1 . Moreover , for adversarial training , it has extremely poor performance on under-represented classes . There are 3 out of the 5 under-represented classes with 0 % standard & robust accuracy . As a conclusion , the performance of adversarial training is easier to be affected by imbalanced distribution than natural training and suffers more on under-represented classes . More results are reported in Appendix A.1 , which further support our findings . 2.2 THE REWEIGHTING STRATEGY IN NATURAL TRAINING V.S . IN ADVERSARIAL TRAINING . The preliminary study in Section 2.1 demonstrates that it is highly demanding to adjust the original adversarial training methods to accommodate imbalanced data distribution . Next , we investigate the effectiveness of adopting the reweighting strategy ( He & Ma , 2013 ) in adversarial training . Our experiments are conducted under a binary classification setting , where the training dataset contains two classes that are randomly selected from CIFAR10 dataset , with each class having 5,000 and 50 training examples respectively . Based on this training dataset , we arrange multiple trails of ( reweighted ) natural training and ( reweighted ) adversarial training , with the weight ratio between the under-represented class and well-represented class ranging from 1:1 to 200:1 . Figure 2 shows the experimental results with training data sampled from the classes “ cat ” and “ horse ” . As demonstrated in Figure 2 , increasing the weight for the under-represented class ( horse ) will drastically increase the model ’ s performance on this class , while also immensely decreasing the performance on the well-represented class ( cat ) . For example , when increasing the weight ratio from 1:1 to 150:1 , the standard accuracy of the under-represented class is improved from 0 % to∼ 60 % and its robust accuracy from 0 % to ∼ 50 % . However , the standard accuracy on the well-represented class drops from 100 % to 60 % , and its robust accuracy drops from 100 % to 50 % . These results illustrate that adversarial training ’ s performance can be significantly affected by the reweighting strategy . As a result , the reweighting strategy in this setting can hardly help improve the overall performance no matter which weight ratio is chosen , because the model ’ s performance always presents a strong tension between these two classes . More experiments using different binary imbalanced datasets are reported in Appendix A.2 , where we have similar observations . 3 THEORETICAL ANALYSIS . In Section 2.2 , we observe that in natural training , the reweighting strategy can only make a small impact on the two classes ’ performance . This phenomenon has been extensively studied by recent works ( Byrd & Lipton , 2019 ; Xu et al. , 2021 ) , where they find that a linear classifier optimized by SGD on a linearly separable data will converge to the solution of the hard-margin support vector machine ( Noble , 2006 ) . In other words , as long as the data can be well separated , reweighting will not make huge influence on the finally trained models . Inspired by their conclusions , we hypothesize that , as the adversarially trained models separate the data poorly , their performance is highly sensitive to the reweighting strategy . As a direct validation of our hypothesis , in Figure 3 , we visualize the learned ( penultimate layer ) features of the imbalanced training examples used in the binary classification problem in Section 2.2 . We find that adversarially trained models do present obviously poorer separability on the learned features . Next , we theoretically analyze the impact of reweighting on linear models which are optimized under poorly separable data and provide all detailed proof in Appendix A.3 . Binary Classification Problem . To construct the theoretical study , we focus on a binary classification problem , with a Gaussian mixture distribution D which is defined as : y ∼ { −1 , +1 } , x ∼ { N ( µ , σ2I ) , if y = +1 N ( −µ , σ2I ) , if y = −1 and µ = ( dim=d︷ ︸︸ ︷ η , ... , η ) , ( 1 ) where the two classes ’ centers ( ±µ ∈ Rd ) with each dimension have mean value ±η ( η > 0 ) and variance σ2 . Formally , we define the data separability as S = η/σ2 . Intuitively , when S is larger , it suggests that two classes are well separated . Previous work ( Byrd & Lipton , 2019 ) also closely studied this term to describe data separability . Besides , we assume the imbalanced training dataset satisfying the condition Pr . ( y = +1 ) = K · Pr . ( y = −1 ) and K > 1 , which indicates the imbalance ratio between two classes . During test , we assume two classes have the equal probability to appear . Under the data distribution D , we will discuss the performance of linear classifiers f ( x ) = sign ( wTx− b ) where w and b are the weight and bias terms of the model f . If a reweighting strategy is involved , we define the model upweights the under-represented class “ -1 ” by ρ. Lemma 3.1 Under the data distribution D as defined in Eq . ( 1 ) , with an imbalanced ratio K and a reweight ratio ρ , the optimal classifier which minimizes the ( reweighted ) empirical risk : f∗ = argmin f ( Pr . ( f ( x ) ̸=y|y=−1 ) · Pr . ( y=−1 ) · ρ+ Pr . ( f ( x ) ̸=y|y=+1 ) · Pr . ( y=+1 ) ) ( 2 ) has the solution : w = 1 and b = 12 log ( ρ K ) dσ2 η = 1 2 log ( ρ K ) d S . Lemma 3.1 indicates that the final optimized classifier has a weight vector equal to 1 and its bias term b only depends on K , ρ and the data separability S. In the following , we first focus on one special setting when ρ = 1 , which is the original ERM model without reweighting . Specifically , we aim to compare the behavior of linear models when they can poorly separate data ( like adversarial trained models ) or they can well separate data ( like naturally trained models ) . Theorem 3.1 Under two data distributions ( x ( 1 ) , y ( 1 ) ) ∈ D1 and ( x ( 2 ) , y ( 2 ) ) ∈ D2 with different separabilities S1 > S2 , let f∗1 and f ∗ 2 be the optimal non-reweighted classifiers ( ρ = 1 ) under D1 and D2 , respectively . Given the imbalance ratio K is large enough , we have : Pr . ( f∗1 ( x ( 1 ) ) ̸= y ( 1 ) |y ( 1 ) = −1 ) − Pr . ( f∗1 ( x ( 1 ) ) ̸= y ( 1 ) |y ( 1 ) = +1 ) < Pr . ( f∗2 ( x ( 2 ) ) ̸= y ( 2 ) |y ( 2 ) = −1 ) − Pr . ( f∗2 ( x ( 2 ) ) ̸= y ( 2 ) |y ( 2 ) = +1 ) . ( 3 ) Intuitively , Theorem 3.1 suggests that when the data separability S is low ( such as D2 ) , the optimized classifier ( without reweighting ) can intrinsically have a larger error difference between the underrepresented class “ -1 ” and the well-represented class “ +1 ” . Similar to the observation in Section 2.1 and Figure 3 , adversarially trained models present a weak ability to separate data , and they also present a strong performance gap between the well-represented class and under-represented class . Conclusively , Theorem 3.1 indicates that the poor ability to separate the training data can be one important reason which leads to the strong performance gap of adversarially trained models . Next , we consider the case when the reweighting strategy is applied . In particular , we compare the impact of upweighting the under-represented class on the performance of well-represented class . Theorem 3.2 Under two data distributions ( x ( 1 ) , y ( 1 ) ) ∈ D1 and ( x ( 2 ) , y ( 2 ) ) ∈ D2 with different separabilities S1 > S2 , let f∗1 and f ∗ 2 be the optimal non-reweighted classifiers ( ρ = 1 ) under D1 and D2 , respectively , and let f ′1 ∗ and f ′2 ∗ be the optimal reweighted classifiers under D1 and D2 given the optimal reweighting ratio ( ρ = K ) . Given the imbalance ratio K is large enough , we have : Pr . ( f ′1 ∗ ( x ( 1 ) ) ̸= y ( 1 ) |y ( 1 ) = +1 ) − Pr . ( f∗1 ( x ( 1 ) ) ̸= y ( 1 ) |y ( 1 ) = +1 ) < Pr . ( f ′2 ∗ ( x ( 2 ) ) ̸= y ( 2 ) |y ( 2 ) = +1 ) − Pr . ( f∗2 ( x ( 2 ) ) ̸= y ( 2 ) |y ( 2 ) = +1 ) . ( 4 ) As Theorem 3.2 shows , when the data distribution has poorer data separability ( such asD2 ) , upweighting the under-represented class can cause greater hurt on the performance of the well-represented class . It is also consistent with our empirical findings about adversarial training models . Since the adversarially trained models poorly separate the data ( Figure 3 ) , upweighting the under-represented class always drastically decreases the performance of the well-represented class ( Section 2.2 ) . Through the discussions in both Theorem 3.1 and Theorem 3.2 , we conclude that the poor separability can be one important reason which makes adversarial training and its reweighted variants extremely difficult to achieve good performance under imbalance data distribution . Therefore , in the next section , we will explore potential solutions which can facilitate the reweighting strategy in adversarial training .
The paper focuses on adversarial training for imbalanced datasets. Imbalanced datasets emerge frequently in real-world applications, while as the paper demonstrates the adversarial training on the under-represented classes results in weak performance. The paper showcases that when the classes are not separable, then a linear model in under-represented classes is weak. Two modifications in adversarial training are proposed to ameliorate that: a) a weighted average of the loss per sample (depending on the class this sample belongs into), b) an additional loss that aims in maximizing the class separation.
SP:378cb82dfa688149528379e5a2d0b72468d15cdb
Imbalanced Adversarial Training with Reweighting
1 INTRODUCTION . The existence of adversarial samples ( Szegedy et al. , 2013 ; Goodfellow et al. , 2014 ) has risen huge concerns on applying deep neural network ( DNN ) models into security-critical applications , such as autonomous driving ( Chen et al. , 2015 ) and video surveillance systems ( Kurakin et al. , 2016 ) . As countermeasures against adversarial attacks , adversarial training ( Madry et al. , 2017 ; Zhang et al. , 2019 ; Wang et al. , 2019 ) has been empirically proven to be one of the most effective and reliable defense methods . In general , it can be formulated to minimize the model ’ s average error on adversarially perturbed input examples ( Madry et al. , 2017 ) . Although promising to improve the model ’ s robustness , most existing adversarial training methods assume that the number of training examples from each class is equally distributed . However , datasets collected from real-world applications typically have imbalanced distribution ( Everingham et al. , 2010 ; Lin et al. , 2014 ) . Hence , it is natural to ask : What is the behavior of adversarial training under imbalanced scenarios ? Can we directly apply existing imbalanced learning strategies in natural training to tackle the imbalance issue for adversarial training ? Recent studies find that adversarial training usually presents distinct properties from natural training . For example , compared to natural training , adversarially trained models suffer more from the overfitting issue ( Schmidt et al. , 2018 ) , and they tend to present strong class-wise performance disparities , even if the training examples are uniformly distributed over different classes ( Xu et al. , 2020a ) . Imagine that if the training data distribution is highly imbalanced , these properties of adversarial training can be greatly exaggerated and make it extremely difficult to be applied in practice . Therefore , it is necessary but challenging to answer aforementioned questions . As the initial effort to study the imbalanced problem in adversarial training , in this work , we first investigate the performance of existing adversarial training under imbalanced settings . As a preliminary study shown in Section 2.1 , we apply both natural training and PGD adversarial training ( Madry et al. , 2017 ) on multiple imbalanced training datasets constructed from CIFAR10 training dataset ( Krizhevsky et al. , 2009 ) and evaluate trained models ’ performance on class-balanced test dataset . From the preliminary results , we observe that , compared to naturally trained models , adversarially trained models always present very low standard & robust accuracy1 on under-represented classes . This observation suggests that adversarial training is more sensitive to imbalanced data distribution than natural training . Thus , when applying adversarial training in practice , imbalance learning strategies should always be considered for help . As a result , we explore potential solutions which can handle the imbalance issue for adversarial training . In this work , we focus on studying the behavior of the reweighting strategy ( He & Ma , 2013 ) and leave other strategies such as resampling ( Estabrooks et al. , 2004 ) for one future work . In Section 2.2 , we apply the reweighting strategy to adversarial training with varied weights assigning to one under-represented class and evaluate trained models ’ performance . From the results , we observe that , in adversarial training , increasing weights for an under-represented class can substantially improve the standard & robust accuracy on this class , but drastically hurt the model ’ s performance on the well-represented class . This finding indicates that the performance of adversarially trained models is very sensitive to the reweighting manipulations and it could be very hard to figure out an eligible reweighting strategy which is optimal for all classes . It is also worth noting that , in natural training , we find that upweighting the under-represented class increases model ’ s standard accuracy on this class but only slightly hurts the accuracy on the well-represented class , even when adopting a large weight for the under-represent class . To further investigate the possible reasons leading to different behaviors of the reweighing strategy in natural and adversarial training , we visualize their learned features ( in Figure 3 ) , and observe that features learned by the adversarially trained model of different classes tend to mix together while they are well separated for the naturally trained model . This observation motivates us to theoretically show that when the given data distribution has poor data separability , upweighting under-represented classes will hurt the model ’ s performance on well-represented classes . Motivated by our theoretical understanding , we propose a novel framework Separable Reweighted Adversarial Training ( SRAT ) to facilitate the reweighting strategy in imbalanced adversarial training by enhancing the separability of learned features . Through extensive experiments , we validate the effectiveness of SRAT . 2 PRELIMINARY STUDY . 2.1 THE BEHAVIOR OF ADVERSARIAL TRAINING . In this subsection , we conduct preliminary studies to examine the performance of PGD adversarial training ( Madry et al. , 2017 ) . Following previous works ( Cui et al. , 2019 ; Cao et al. , 2019 ) , we construct an imbalanced CIFAR10 ( Krizhevsky et al. , 2009 ) training dataset , where each of the first 5 classes ( a.k.a . well-represented classes ) has 5,000 training examples and each of the last 5 classes ( a.k.a . under-represented classes ) has 50 training examples . Figure 1 shows the performance of naturally and adversarially trained models using a ResNet18 ( He et al. , 2016 ) architecture . From the figure , we can observe that , compared with natural training , PGD adversarial training will result in a larger performance gap between well-represented classes and under-represented classes . For example , in natural training , the ratio between the average standard 1In this work , we denote standard accuracy as model ’ s accuracy on the input samples without perturbations and robust accuracy as model ’ s accuracy on the input samples which are adversarially perturbed . Without clear clarification , we consider the perturbation is constrained by l∞-norm 8/255 . accuracy of well-represented classes ( brown ) and under-represented classes ( violet ) is about 2:1 , while in adversarial training , this ratio expands to 16:1 . Moreover , for adversarial training , it has extremely poor performance on under-represented classes . There are 3 out of the 5 under-represented classes with 0 % standard & robust accuracy . As a conclusion , the performance of adversarial training is easier to be affected by imbalanced distribution than natural training and suffers more on under-represented classes . More results are reported in Appendix A.1 , which further support our findings . 2.2 THE REWEIGHTING STRATEGY IN NATURAL TRAINING V.S . IN ADVERSARIAL TRAINING . The preliminary study in Section 2.1 demonstrates that it is highly demanding to adjust the original adversarial training methods to accommodate imbalanced data distribution . Next , we investigate the effectiveness of adopting the reweighting strategy ( He & Ma , 2013 ) in adversarial training . Our experiments are conducted under a binary classification setting , where the training dataset contains two classes that are randomly selected from CIFAR10 dataset , with each class having 5,000 and 50 training examples respectively . Based on this training dataset , we arrange multiple trails of ( reweighted ) natural training and ( reweighted ) adversarial training , with the weight ratio between the under-represented class and well-represented class ranging from 1:1 to 200:1 . Figure 2 shows the experimental results with training data sampled from the classes “ cat ” and “ horse ” . As demonstrated in Figure 2 , increasing the weight for the under-represented class ( horse ) will drastically increase the model ’ s performance on this class , while also immensely decreasing the performance on the well-represented class ( cat ) . For example , when increasing the weight ratio from 1:1 to 150:1 , the standard accuracy of the under-represented class is improved from 0 % to∼ 60 % and its robust accuracy from 0 % to ∼ 50 % . However , the standard accuracy on the well-represented class drops from 100 % to 60 % , and its robust accuracy drops from 100 % to 50 % . These results illustrate that adversarial training ’ s performance can be significantly affected by the reweighting strategy . As a result , the reweighting strategy in this setting can hardly help improve the overall performance no matter which weight ratio is chosen , because the model ’ s performance always presents a strong tension between these two classes . More experiments using different binary imbalanced datasets are reported in Appendix A.2 , where we have similar observations . 3 THEORETICAL ANALYSIS . In Section 2.2 , we observe that in natural training , the reweighting strategy can only make a small impact on the two classes ’ performance . This phenomenon has been extensively studied by recent works ( Byrd & Lipton , 2019 ; Xu et al. , 2021 ) , where they find that a linear classifier optimized by SGD on a linearly separable data will converge to the solution of the hard-margin support vector machine ( Noble , 2006 ) . In other words , as long as the data can be well separated , reweighting will not make huge influence on the finally trained models . Inspired by their conclusions , we hypothesize that , as the adversarially trained models separate the data poorly , their performance is highly sensitive to the reweighting strategy . As a direct validation of our hypothesis , in Figure 3 , we visualize the learned ( penultimate layer ) features of the imbalanced training examples used in the binary classification problem in Section 2.2 . We find that adversarially trained models do present obviously poorer separability on the learned features . Next , we theoretically analyze the impact of reweighting on linear models which are optimized under poorly separable data and provide all detailed proof in Appendix A.3 . Binary Classification Problem . To construct the theoretical study , we focus on a binary classification problem , with a Gaussian mixture distribution D which is defined as : y ∼ { −1 , +1 } , x ∼ { N ( µ , σ2I ) , if y = +1 N ( −µ , σ2I ) , if y = −1 and µ = ( dim=d︷ ︸︸ ︷ η , ... , η ) , ( 1 ) where the two classes ’ centers ( ±µ ∈ Rd ) with each dimension have mean value ±η ( η > 0 ) and variance σ2 . Formally , we define the data separability as S = η/σ2 . Intuitively , when S is larger , it suggests that two classes are well separated . Previous work ( Byrd & Lipton , 2019 ) also closely studied this term to describe data separability . Besides , we assume the imbalanced training dataset satisfying the condition Pr . ( y = +1 ) = K · Pr . ( y = −1 ) and K > 1 , which indicates the imbalance ratio between two classes . During test , we assume two classes have the equal probability to appear . Under the data distribution D , we will discuss the performance of linear classifiers f ( x ) = sign ( wTx− b ) where w and b are the weight and bias terms of the model f . If a reweighting strategy is involved , we define the model upweights the under-represented class “ -1 ” by ρ. Lemma 3.1 Under the data distribution D as defined in Eq . ( 1 ) , with an imbalanced ratio K and a reweight ratio ρ , the optimal classifier which minimizes the ( reweighted ) empirical risk : f∗ = argmin f ( Pr . ( f ( x ) ̸=y|y=−1 ) · Pr . ( y=−1 ) · ρ+ Pr . ( f ( x ) ̸=y|y=+1 ) · Pr . ( y=+1 ) ) ( 2 ) has the solution : w = 1 and b = 12 log ( ρ K ) dσ2 η = 1 2 log ( ρ K ) d S . Lemma 3.1 indicates that the final optimized classifier has a weight vector equal to 1 and its bias term b only depends on K , ρ and the data separability S. In the following , we first focus on one special setting when ρ = 1 , which is the original ERM model without reweighting . Specifically , we aim to compare the behavior of linear models when they can poorly separate data ( like adversarial trained models ) or they can well separate data ( like naturally trained models ) . Theorem 3.1 Under two data distributions ( x ( 1 ) , y ( 1 ) ) ∈ D1 and ( x ( 2 ) , y ( 2 ) ) ∈ D2 with different separabilities S1 > S2 , let f∗1 and f ∗ 2 be the optimal non-reweighted classifiers ( ρ = 1 ) under D1 and D2 , respectively . Given the imbalance ratio K is large enough , we have : Pr . ( f∗1 ( x ( 1 ) ) ̸= y ( 1 ) |y ( 1 ) = −1 ) − Pr . ( f∗1 ( x ( 1 ) ) ̸= y ( 1 ) |y ( 1 ) = +1 ) < Pr . ( f∗2 ( x ( 2 ) ) ̸= y ( 2 ) |y ( 2 ) = −1 ) − Pr . ( f∗2 ( x ( 2 ) ) ̸= y ( 2 ) |y ( 2 ) = +1 ) . ( 3 ) Intuitively , Theorem 3.1 suggests that when the data separability S is low ( such as D2 ) , the optimized classifier ( without reweighting ) can intrinsically have a larger error difference between the underrepresented class “ -1 ” and the well-represented class “ +1 ” . Similar to the observation in Section 2.1 and Figure 3 , adversarially trained models present a weak ability to separate data , and they also present a strong performance gap between the well-represented class and under-represented class . Conclusively , Theorem 3.1 indicates that the poor ability to separate the training data can be one important reason which leads to the strong performance gap of adversarially trained models . Next , we consider the case when the reweighting strategy is applied . In particular , we compare the impact of upweighting the under-represented class on the performance of well-represented class . Theorem 3.2 Under two data distributions ( x ( 1 ) , y ( 1 ) ) ∈ D1 and ( x ( 2 ) , y ( 2 ) ) ∈ D2 with different separabilities S1 > S2 , let f∗1 and f ∗ 2 be the optimal non-reweighted classifiers ( ρ = 1 ) under D1 and D2 , respectively , and let f ′1 ∗ and f ′2 ∗ be the optimal reweighted classifiers under D1 and D2 given the optimal reweighting ratio ( ρ = K ) . Given the imbalance ratio K is large enough , we have : Pr . ( f ′1 ∗ ( x ( 1 ) ) ̸= y ( 1 ) |y ( 1 ) = +1 ) − Pr . ( f∗1 ( x ( 1 ) ) ̸= y ( 1 ) |y ( 1 ) = +1 ) < Pr . ( f ′2 ∗ ( x ( 2 ) ) ̸= y ( 2 ) |y ( 2 ) = +1 ) − Pr . ( f∗2 ( x ( 2 ) ) ̸= y ( 2 ) |y ( 2 ) = +1 ) . ( 4 ) As Theorem 3.2 shows , when the data distribution has poorer data separability ( such asD2 ) , upweighting the under-represented class can cause greater hurt on the performance of the well-represented class . It is also consistent with our empirical findings about adversarial training models . Since the adversarially trained models poorly separate the data ( Figure 3 ) , upweighting the under-represented class always drastically decreases the performance of the well-represented class ( Section 2.2 ) . Through the discussions in both Theorem 3.1 and Theorem 3.2 , we conclude that the poor separability can be one important reason which makes adversarial training and its reweighted variants extremely difficult to achieve good performance under imbalance data distribution . Therefore , in the next section , we will explore potential solutions which can facilitate the reweighting strategy in adversarial training .
This paper provides two critical observations. The first is that adversarial training has worse performance on under-represented classes than natural training on imbalanced datasets. The second is that conventional reweighting methods that upweight under-represented classes largely hurt the performance on well-represented classes for adversarial training. Further, the authors theoretically analyze the reason for the above observations on a binary-classification case. Motivated by the theoretical analysis, the authors incorporate standard adversarial training with feature separation loss, namely SRAT, which is empirically validated SRAT can improve the performance on imbalanced datasets.
SP:378cb82dfa688149528379e5a2d0b72468d15cdb
Adversarial Attacks on Spiking Convolutional Networks for Event-based Vision
Event-based sensing using dynamic vision sensors is gaining traction in lowpower vision applications . Spiking neural networks work well with the sparse nature of event-based data and suit deployment on low-power neuromorphic hardware . Being a nascent field , the sensitivity of spiking neural networks to potentially malicious adversarial attacks has received very little attention so far . In this work , we show how white-box adversarial attack algorithms can be adapted to the discrete and sparse nature of event-based visual data , and to the continuous-time setting of spiking neural networks . We test our methods on the N-MNIST and IBM Gestures neuromorphic vision datasets and show adversarial perturbations achieve a high success rate , by injecting a relatively small number of appropriately placed events . We also verify , for the first time , the effectiveness of these perturbations directly on neuromorphic hardware . Finally , we discuss the properties of the resulting perturbations and possible future directions . 1 INTRODUCTION . Unlike the usual neural networks of contemporary deep learning , spiking neural networks ( SNN ) resemble the animal brain more closely in at least two main aspects : the way their neurons communicate through impulses ( spikes ) , and their dynamics , which evolve in continuous time . Aside from offering the field of computational neuroscience more biologically plausible neuron models and communication schemes , research in the technological applications of spiking neural networks is currently blooming because of the rise of neuromorphic technology . Neuromorphic hardware is directly compatible with spiking neural networks and enables the design of low-power models for use in battery-operated , always-on devices . Adversarial examples are an “ intriguing property of neural networks ” ( Szegedy et al. , 2013 ) by which the network is easily fooled into misclassifying an input which has been altered in an almost imperceptible way by the attacker . This property is usually undesirable in applications : it was proven , for example , that an adversarial attack may pose a threat to self-driving cars , by making them misclassify a stop sign as a speed limit sign ; and that this attack can be implemented in the real world through stickers physically placed on the road sign ( Eykholt et al. , 2018 ) . Because of their relevance to real-world applications , a large amount of work has been published on this subject , typically following a pattern where new attacks are discovered , followed by new defense strategies , in turn followed by proof of other strategies that can still break through them ( see Akhtar & Mian ( 2018 ) for a review ) . With the advent of real-world applications of spiking networks in neuromorphic devices , it is essential to make sure they work securely and reliably in a variety of contexts . In particular , there is a significant need for research on the possibility of adversarial attacks on spiking network models used for computer sensing tasks . In this paper , we make an attempt at modifying event-based data , by adding and removing events , to generate adversarial examples that fool spiking networks into misclassifying them . This offers important insight into the reliability and security of neuromorphic vision devices , with important implications for commercial applications . 1.1 WHAT IS EVENT-BASED SENSING ? . Event-based cameras , usually called Dynamic Vision Sensors ( DVS ) , share many characteristics with the mammalian retina , which make them excel in some circumstances where traditional framebased cameras do not perform well ( Liu & Delbruck , 2010 ; Liu et al. , 2019b ) . First , events are generated only when there are changes in the visual scene , automatically removing redundancies ; second , their pixels fire independently of each other which means that there is no frame rate , but rather a continuous stream of asynchronous events , so that the latency can be extremely small ; third , they have a very high dynamic range which makes them suitable to detect motion in both bright and dark settings . For these reasons , they have found applications in human-robot interaction , odometry , drone control , tracking , and surveillance , including on devices that are already commercially available ( Gallego et al. , 2019 ; Kueng et al. , 2016 ; Falanga et al. , 2020 ) . Beyond computer vision , the realm of event-based sensing extends to auditory sensors known as silicon cochleas ( Chan et al. , 2007 ) , as well as radar ( Stuijt et al. , 2021 ) and tactile sensors ( Caviglia et al. , 2016 ) . Neuromorphic sensors make available a new kind of sparse , asynchronous data , which does not suit current high-throughput , synchronous accelerators such as GPUs . To process event-based data efficiently , a new generation of neuromorphic hardware is being developed in parallel to the spiking neural network models that can be trained in software . Spiking neuromorphic implementations include large-scale simulation of neuronal networks for neuroscience research ( Furber et al. , 2012 ) and lowpower real-world deployments of machine learning algorithms . In particular , convolutional neural network ( CNN ) architectures , used for computer vision , have been run on neuromorphic chips such as IBM ’ s TrueNorth ( Esser et al. , 2016 ) , Intel ’ s Loihi ( Davies et al. , 2018 ) and SynSense ’ s Speck and Dynap-CNN hardware ( Liu et al. , 2019a ) . The full pipeline of event-based sensors that output sparse data , stateful spiking neural networks which extract semantic meaning and asynchronous hardware backends allows for large gains in power-efficiency when compared to conventional systems . 1.2 ADVERSARIAL ATTACKS ON DISCRETE DATA . The history of attack strategies against various kinds of machine-learning algorithms pre-dates the advent of deep learning ( Biggio & Roli , 2018 ) , but the phenomenon received widespread interest when adversarial examples were first found for deep convolutional networks ( Szegedy et al. , 2013 ) . Generally speaking , given a neural network classifier C and an input x which is correctly classified , finding an adversarial perturbation means finding the smallest δ such that C ( x+ δ ) 6= C ( x ) . Here , “ smallest ” refers to minimising ‖δ‖ , where the norm is chosen arbitrarily depending on the requirements of the experiment . For example , using the L∞ norm ( maximum norm ) will generally make the perturbation less noticeable to a human eye , since the difference in any pixel value between the original and perturbed images will be below a maximum value that is kept as low as possible . Conversely , the use of the L1 norm will encourage sparsity , i.e . a smaller number of perturbed pixels . The main challenges in transferring existing adversarial algorithms to event-based neuromorphic vision lie in the dynamics of the data and network , which develop in continuous time , and in the discrete nature of events , which can either be present or absent at a given time and location , unlike the continuous pixel values of traditional image data . Event-based sensors encode information in the timing , location , and polarity of events , which can be of ‘ on ’ or ‘ off ’ type . Because at any point in time an event can either be triggered or not , one can simply view event-based inputs as binary data by discretising time ( Figure 1 ) . In this view , the network ’ s input is a three-dimensional array whose entries describe the number of events at a location ( x , y ) and in time bin t ; an additional dimension , of length 2 , is added due to the polarity of events . If the time discretisation is sufficiently precise , and no more than one event appears in each bin , the data can be treated as binary . A possible approach to attacking these data is exploiting recent work done on attacking binary images , i.e . with either black or white pixels , which are used in the automatic processing of cheques and other documents . Most methods proposed for attacking binary inputs have focused on brute-force approaches that rely on heuristics to reduce the search space ( Bagheri et al. , 2018 ; Balkanski et al. , 2020 ) . For example , SCAR ( Balkanski et al. , 2020 ) is a black-box algorithm that only assumes access to the output probabilities of the network . The algorithm flips bits in areas chosen according to a specific heuristic and keeps flipped those that cause a change in the confidence of the network . Naturally , this algorithm does not scale well to large input sizes , as the number of queries made to the network grows exponentially . In particular , this becomes a serious problem when the time dimension is added , greatly increasing the dimensionality of the input . Instead , in this paper , we chose to focus on the easier problem of white box attacks , where the attacker has full access to the network and can backpropagate gradients through it . This allows us to adapt faster and more effective algorithms to the case of event-based data . To this end , we chose to adapt existing attack strategies so that they could work with the time dynamics of spiking neural networks , and with the discrete nature of event-based data . We test our attacks on the Neuromorphic MNIST ( Orchard et al. , 2015 ) and IBM Gestures ( Amir et al. , 2017 ) datasets , which are the most common benchmark datasets within the neuromorphic community . Previous work on adversarial attacks in spiking networks has been reported by Sharmin et al . ( 2020 ) ; however , their work only uses static image data with continuous pixel values converted to Poisson input frequencies , so does not involve dealing with discrete data which was the main challenge in our work . More recently , Liang et al . ( 2020 ) did apply attacks to DVS data , using a discretisedgradient technique . They report high success rates , despite some notable problems of vanishing gradients . Concurrently with our work , Marchisio et al . ( 2021 ) designed custom algorithms for DVS data , rather than adapting existing ones , but did not report on the magnitudes of the resulting perturbations . None of these validated the effectiveness of their attack strategies against an on-chip model deployed on neuromorphic hardware . Our contributions beyond the existing literature can be summarised as follows : • We provide detailed results to quantify the effectiveness and scalability of several adversarial attacks strategies , including some not tried before on SNNs . • We show targeted universal attacks on event-based data in the form of adversarial patches , which do not require prior knowledge of the input . • We validate the resulting adversarial examples on an SNN deployed on a convolutional neuromorphic chip . To the best of our knowledge , this is the first time the effectiveness of adversarial examples is demonstrated directly on neuromorphic hardware . 2 METHODS . 2.1 ATTACK STRATEGIES . Projected Gradient Descent As a baseline , we use Projected Gradient Descent ( PGD ) ( Madry et al. , 2019 ) , a standard attack algorithm which we use on discrete data in two ways . The first consists in naively rounding the data at each iteration . However , in this case , updates will be retained only if the gradient magnitude is large enough : otherwise , the small changes made to the adversarial input are lost due to the subsequent discretization . Instead , we adopt an approach that prevents this loss of information : we keep a continuous version of the image as a copy , but use the gradients computed on the discretized image to update the continuous version which is kept in memory . To adapt PGD to the scenario where we want to find the smallest perturbation that triggers a misclassification , we sort the values based on how much PGD adjusted them . We then iterate through the sorted list of indices and flip each value until a misclassification is triggered . It should be noted that this step incurs most of the computational overhead , but is necessary to produce good results . Unless stated otherwise , we used the following values for the parameters : the magnitude of the initial random perturbation to the input is set to τ = 0.01 . The maximum norm of the perturbation was set to = 1.5 . We found that 50 iterations ( Npgd ) of PGD sufficed and the results did not improve by much afterwards . Probabilistic PGD We also devised an alternative way of using PGD on discrete data , which we call “ Probabilistic PGD ” . Probabilistic PGD works by assuming that the binary input was generated by sampling from a series of independent Bernoulli random variables . This approach aligns with how the DVS camera generates the binary data : the probability of emitting a spike at time t is proportional to the light intensity , a continuous metric . For each round of PGD , the input is sampled in a differentiable manner by the Gumbel-softmax reparameterization trick ( Jang et al. , 2017 ) : xadv = σ ( [ log ( r ) − log ( 1− r ) + log ( padv ) − log ( 1− padv ) ] /T ) , where r ∼ U ( 0,1 ) , and T = 0.01 is a temperature parameter . The underlying probabilities padv , instead of the pixel values xadv , are updated using the gradient obtained from the loss function that is minimised by PGD . We saw that this generally improved the performance compared to the PGD version explained above . Gradients are averaged over Nmc = 10 samples of r. It should be noted that the need for a gradient sampling procedure significantly increases the runtime . SparseFool on discrete data To operate on event-based data efficiently , the ideal adversarial algorithm requires two main properties : sparsity and scalability . Scalability is needed because of the increased dimensionality given by the additional time dimension . Sparsity ensures that the number of events added or removed is kept to a minimum . One approach that combines the above is SparseFool ( Modas et al. , 2018 ) , which iteratively finds the closest point in L2 on the linearised decision boundary of the network using the DeepFool algorithm ( Moosavi-Dezfooli et al. , 2015 ) as a subroutine , followed by a linear solver that enforces sparsity and boundary constraints on the perturbation . Because Spiking Neural Networks ( SNNs ) have discrete outputs ( the number of spikes over time for each output neuron ) , it is easier to incur in vanishing gradients as the perturbation approaches the decision boundary . Therefore , we had to make changes to the algorithm to take this into account . Firstly , we found that clamping the perturbation at every iteration of DeepFool , so that it was no smaller than a value η , offered protection against vanishing gradients . η was treated as a hyperpa- rameter that should be kept as small as it can without incurring in vanishing gradients . Secondly , to account for the discreteness of event-based data , we rounded the output of SparseFool to the nearest integer at each iteration . Finally , SparseFool normally involves upper and lower bounds l and u on pixel values ( normally set , for images , to l = 0 ; u = 255 ) . We exploit these to enforce the binary constraint on the data ( l = 0 ; u = 1 ) , or , in the on-chip experiments , to fix a maximum firing rate in each time bin , which is the same as that of the original input ( l = 0 ; u = max ( input ) ) . Adversarial patches As the name suggests , adversarial patches are perturbations that are accumulated in a certain region of the image . The idea is that these patches are generated in a way that enables the adversary to place them anywhere in the image . This attack is targeted to a desired label , and universal , i.e . not specific to an input . To test a more realistic scenario where an adversary could potentially perform an attack without previous knowledge of the input , we apply these patches to the IBM hand gesture dataset . We note that the prediction of the CNN trained on this dataset is mostly determined by spatial location of the input . For example , the original input of “ Right Hand Wave ” is not recognised as such if it is shifted or rotated by a substantial amount . In order to simulate effective realistic attacks , we choose to limit both computed and random attack patches to the area of where the actual gesture is performed . As in Brown et al . ( 2017 ) , we generate the patches using PGD on the log softmax value of the target output neuron . PGD is performed iteratively on different images of the training set and the position of the patch is randomised after each sample . For each item in the training data , the algorithm updates the patch until the target label confidence has reached a pre-defined threshold . The algorithm skips the point if the original label equals the target label . This process is repeated for every training sample and for multiple epochs . To measure the effectiveness of our computed patches , we also generate random patches of the same size , and measure the target success rates . In a random patch , every pixel has a 50 % chance of emitting a spike at each time step .
The paper presents proof of the viability of adversarial attacks on CNN processing event-based vision data. The paper investigates adaptations of well-known white box attacks to the event-based and spiking domain, validates the claims on three public benchmarks, and investigates the effect of the adversarial attacks directly on neuromorphic hardware. The main result is that, just like for conventional computer vision, adversarial attacks can have a big effect on the prediction of CNNs for event-based vision inputs. The attacks also translate to networks run on neuromorphic hardware.
SP:6bfb1a3e8f6b4ebee8e94090ad10538702ad8dd9
Adversarial Attacks on Spiking Convolutional Networks for Event-based Vision
Event-based sensing using dynamic vision sensors is gaining traction in lowpower vision applications . Spiking neural networks work well with the sparse nature of event-based data and suit deployment on low-power neuromorphic hardware . Being a nascent field , the sensitivity of spiking neural networks to potentially malicious adversarial attacks has received very little attention so far . In this work , we show how white-box adversarial attack algorithms can be adapted to the discrete and sparse nature of event-based visual data , and to the continuous-time setting of spiking neural networks . We test our methods on the N-MNIST and IBM Gestures neuromorphic vision datasets and show adversarial perturbations achieve a high success rate , by injecting a relatively small number of appropriately placed events . We also verify , for the first time , the effectiveness of these perturbations directly on neuromorphic hardware . Finally , we discuss the properties of the resulting perturbations and possible future directions . 1 INTRODUCTION . Unlike the usual neural networks of contemporary deep learning , spiking neural networks ( SNN ) resemble the animal brain more closely in at least two main aspects : the way their neurons communicate through impulses ( spikes ) , and their dynamics , which evolve in continuous time . Aside from offering the field of computational neuroscience more biologically plausible neuron models and communication schemes , research in the technological applications of spiking neural networks is currently blooming because of the rise of neuromorphic technology . Neuromorphic hardware is directly compatible with spiking neural networks and enables the design of low-power models for use in battery-operated , always-on devices . Adversarial examples are an “ intriguing property of neural networks ” ( Szegedy et al. , 2013 ) by which the network is easily fooled into misclassifying an input which has been altered in an almost imperceptible way by the attacker . This property is usually undesirable in applications : it was proven , for example , that an adversarial attack may pose a threat to self-driving cars , by making them misclassify a stop sign as a speed limit sign ; and that this attack can be implemented in the real world through stickers physically placed on the road sign ( Eykholt et al. , 2018 ) . Because of their relevance to real-world applications , a large amount of work has been published on this subject , typically following a pattern where new attacks are discovered , followed by new defense strategies , in turn followed by proof of other strategies that can still break through them ( see Akhtar & Mian ( 2018 ) for a review ) . With the advent of real-world applications of spiking networks in neuromorphic devices , it is essential to make sure they work securely and reliably in a variety of contexts . In particular , there is a significant need for research on the possibility of adversarial attacks on spiking network models used for computer sensing tasks . In this paper , we make an attempt at modifying event-based data , by adding and removing events , to generate adversarial examples that fool spiking networks into misclassifying them . This offers important insight into the reliability and security of neuromorphic vision devices , with important implications for commercial applications . 1.1 WHAT IS EVENT-BASED SENSING ? . Event-based cameras , usually called Dynamic Vision Sensors ( DVS ) , share many characteristics with the mammalian retina , which make them excel in some circumstances where traditional framebased cameras do not perform well ( Liu & Delbruck , 2010 ; Liu et al. , 2019b ) . First , events are generated only when there are changes in the visual scene , automatically removing redundancies ; second , their pixels fire independently of each other which means that there is no frame rate , but rather a continuous stream of asynchronous events , so that the latency can be extremely small ; third , they have a very high dynamic range which makes them suitable to detect motion in both bright and dark settings . For these reasons , they have found applications in human-robot interaction , odometry , drone control , tracking , and surveillance , including on devices that are already commercially available ( Gallego et al. , 2019 ; Kueng et al. , 2016 ; Falanga et al. , 2020 ) . Beyond computer vision , the realm of event-based sensing extends to auditory sensors known as silicon cochleas ( Chan et al. , 2007 ) , as well as radar ( Stuijt et al. , 2021 ) and tactile sensors ( Caviglia et al. , 2016 ) . Neuromorphic sensors make available a new kind of sparse , asynchronous data , which does not suit current high-throughput , synchronous accelerators such as GPUs . To process event-based data efficiently , a new generation of neuromorphic hardware is being developed in parallel to the spiking neural network models that can be trained in software . Spiking neuromorphic implementations include large-scale simulation of neuronal networks for neuroscience research ( Furber et al. , 2012 ) and lowpower real-world deployments of machine learning algorithms . In particular , convolutional neural network ( CNN ) architectures , used for computer vision , have been run on neuromorphic chips such as IBM ’ s TrueNorth ( Esser et al. , 2016 ) , Intel ’ s Loihi ( Davies et al. , 2018 ) and SynSense ’ s Speck and Dynap-CNN hardware ( Liu et al. , 2019a ) . The full pipeline of event-based sensors that output sparse data , stateful spiking neural networks which extract semantic meaning and asynchronous hardware backends allows for large gains in power-efficiency when compared to conventional systems . 1.2 ADVERSARIAL ATTACKS ON DISCRETE DATA . The history of attack strategies against various kinds of machine-learning algorithms pre-dates the advent of deep learning ( Biggio & Roli , 2018 ) , but the phenomenon received widespread interest when adversarial examples were first found for deep convolutional networks ( Szegedy et al. , 2013 ) . Generally speaking , given a neural network classifier C and an input x which is correctly classified , finding an adversarial perturbation means finding the smallest δ such that C ( x+ δ ) 6= C ( x ) . Here , “ smallest ” refers to minimising ‖δ‖ , where the norm is chosen arbitrarily depending on the requirements of the experiment . For example , using the L∞ norm ( maximum norm ) will generally make the perturbation less noticeable to a human eye , since the difference in any pixel value between the original and perturbed images will be below a maximum value that is kept as low as possible . Conversely , the use of the L1 norm will encourage sparsity , i.e . a smaller number of perturbed pixels . The main challenges in transferring existing adversarial algorithms to event-based neuromorphic vision lie in the dynamics of the data and network , which develop in continuous time , and in the discrete nature of events , which can either be present or absent at a given time and location , unlike the continuous pixel values of traditional image data . Event-based sensors encode information in the timing , location , and polarity of events , which can be of ‘ on ’ or ‘ off ’ type . Because at any point in time an event can either be triggered or not , one can simply view event-based inputs as binary data by discretising time ( Figure 1 ) . In this view , the network ’ s input is a three-dimensional array whose entries describe the number of events at a location ( x , y ) and in time bin t ; an additional dimension , of length 2 , is added due to the polarity of events . If the time discretisation is sufficiently precise , and no more than one event appears in each bin , the data can be treated as binary . A possible approach to attacking these data is exploiting recent work done on attacking binary images , i.e . with either black or white pixels , which are used in the automatic processing of cheques and other documents . Most methods proposed for attacking binary inputs have focused on brute-force approaches that rely on heuristics to reduce the search space ( Bagheri et al. , 2018 ; Balkanski et al. , 2020 ) . For example , SCAR ( Balkanski et al. , 2020 ) is a black-box algorithm that only assumes access to the output probabilities of the network . The algorithm flips bits in areas chosen according to a specific heuristic and keeps flipped those that cause a change in the confidence of the network . Naturally , this algorithm does not scale well to large input sizes , as the number of queries made to the network grows exponentially . In particular , this becomes a serious problem when the time dimension is added , greatly increasing the dimensionality of the input . Instead , in this paper , we chose to focus on the easier problem of white box attacks , where the attacker has full access to the network and can backpropagate gradients through it . This allows us to adapt faster and more effective algorithms to the case of event-based data . To this end , we chose to adapt existing attack strategies so that they could work with the time dynamics of spiking neural networks , and with the discrete nature of event-based data . We test our attacks on the Neuromorphic MNIST ( Orchard et al. , 2015 ) and IBM Gestures ( Amir et al. , 2017 ) datasets , which are the most common benchmark datasets within the neuromorphic community . Previous work on adversarial attacks in spiking networks has been reported by Sharmin et al . ( 2020 ) ; however , their work only uses static image data with continuous pixel values converted to Poisson input frequencies , so does not involve dealing with discrete data which was the main challenge in our work . More recently , Liang et al . ( 2020 ) did apply attacks to DVS data , using a discretisedgradient technique . They report high success rates , despite some notable problems of vanishing gradients . Concurrently with our work , Marchisio et al . ( 2021 ) designed custom algorithms for DVS data , rather than adapting existing ones , but did not report on the magnitudes of the resulting perturbations . None of these validated the effectiveness of their attack strategies against an on-chip model deployed on neuromorphic hardware . Our contributions beyond the existing literature can be summarised as follows : • We provide detailed results to quantify the effectiveness and scalability of several adversarial attacks strategies , including some not tried before on SNNs . • We show targeted universal attacks on event-based data in the form of adversarial patches , which do not require prior knowledge of the input . • We validate the resulting adversarial examples on an SNN deployed on a convolutional neuromorphic chip . To the best of our knowledge , this is the first time the effectiveness of adversarial examples is demonstrated directly on neuromorphic hardware . 2 METHODS . 2.1 ATTACK STRATEGIES . Projected Gradient Descent As a baseline , we use Projected Gradient Descent ( PGD ) ( Madry et al. , 2019 ) , a standard attack algorithm which we use on discrete data in two ways . The first consists in naively rounding the data at each iteration . However , in this case , updates will be retained only if the gradient magnitude is large enough : otherwise , the small changes made to the adversarial input are lost due to the subsequent discretization . Instead , we adopt an approach that prevents this loss of information : we keep a continuous version of the image as a copy , but use the gradients computed on the discretized image to update the continuous version which is kept in memory . To adapt PGD to the scenario where we want to find the smallest perturbation that triggers a misclassification , we sort the values based on how much PGD adjusted them . We then iterate through the sorted list of indices and flip each value until a misclassification is triggered . It should be noted that this step incurs most of the computational overhead , but is necessary to produce good results . Unless stated otherwise , we used the following values for the parameters : the magnitude of the initial random perturbation to the input is set to τ = 0.01 . The maximum norm of the perturbation was set to = 1.5 . We found that 50 iterations ( Npgd ) of PGD sufficed and the results did not improve by much afterwards . Probabilistic PGD We also devised an alternative way of using PGD on discrete data , which we call “ Probabilistic PGD ” . Probabilistic PGD works by assuming that the binary input was generated by sampling from a series of independent Bernoulli random variables . This approach aligns with how the DVS camera generates the binary data : the probability of emitting a spike at time t is proportional to the light intensity , a continuous metric . For each round of PGD , the input is sampled in a differentiable manner by the Gumbel-softmax reparameterization trick ( Jang et al. , 2017 ) : xadv = σ ( [ log ( r ) − log ( 1− r ) + log ( padv ) − log ( 1− padv ) ] /T ) , where r ∼ U ( 0,1 ) , and T = 0.01 is a temperature parameter . The underlying probabilities padv , instead of the pixel values xadv , are updated using the gradient obtained from the loss function that is minimised by PGD . We saw that this generally improved the performance compared to the PGD version explained above . Gradients are averaged over Nmc = 10 samples of r. It should be noted that the need for a gradient sampling procedure significantly increases the runtime . SparseFool on discrete data To operate on event-based data efficiently , the ideal adversarial algorithm requires two main properties : sparsity and scalability . Scalability is needed because of the increased dimensionality given by the additional time dimension . Sparsity ensures that the number of events added or removed is kept to a minimum . One approach that combines the above is SparseFool ( Modas et al. , 2018 ) , which iteratively finds the closest point in L2 on the linearised decision boundary of the network using the DeepFool algorithm ( Moosavi-Dezfooli et al. , 2015 ) as a subroutine , followed by a linear solver that enforces sparsity and boundary constraints on the perturbation . Because Spiking Neural Networks ( SNNs ) have discrete outputs ( the number of spikes over time for each output neuron ) , it is easier to incur in vanishing gradients as the perturbation approaches the decision boundary . Therefore , we had to make changes to the algorithm to take this into account . Firstly , we found that clamping the perturbation at every iteration of DeepFool , so that it was no smaller than a value η , offered protection against vanishing gradients . η was treated as a hyperpa- rameter that should be kept as small as it can without incurring in vanishing gradients . Secondly , to account for the discreteness of event-based data , we rounded the output of SparseFool to the nearest integer at each iteration . Finally , SparseFool normally involves upper and lower bounds l and u on pixel values ( normally set , for images , to l = 0 ; u = 255 ) . We exploit these to enforce the binary constraint on the data ( l = 0 ; u = 1 ) , or , in the on-chip experiments , to fix a maximum firing rate in each time bin , which is the same as that of the original input ( l = 0 ; u = max ( input ) ) . Adversarial patches As the name suggests , adversarial patches are perturbations that are accumulated in a certain region of the image . The idea is that these patches are generated in a way that enables the adversary to place them anywhere in the image . This attack is targeted to a desired label , and universal , i.e . not specific to an input . To test a more realistic scenario where an adversary could potentially perform an attack without previous knowledge of the input , we apply these patches to the IBM hand gesture dataset . We note that the prediction of the CNN trained on this dataset is mostly determined by spatial location of the input . For example , the original input of “ Right Hand Wave ” is not recognised as such if it is shifted or rotated by a substantial amount . In order to simulate effective realistic attacks , we choose to limit both computed and random attack patches to the area of where the actual gesture is performed . As in Brown et al . ( 2017 ) , we generate the patches using PGD on the log softmax value of the target output neuron . PGD is performed iteratively on different images of the training set and the position of the patch is randomised after each sample . For each item in the training data , the algorithm updates the patch until the target label confidence has reached a pre-defined threshold . The algorithm skips the point if the original label equals the target label . This process is repeated for every training sample and for multiple epochs . To measure the effectiveness of our computed patches , we also generate random patches of the same size , and measure the target success rates . In a random patch , every pixel has a 50 % chance of emitting a spike at each time step .
This paper investigated how to adapt existing attack strategies in order to work with the discrete nature of event-based data. Also, the authors proved that Sparsefool can efficiently and reliably generate sparse perturbations on discrete data. Besides,the authors validate the adversarial examples on neuromorphic chip and the perturbation is effective after modified the networks. In a more realistic setting, the authors use adversarial patches to trigger a targeted misclassification. MNIST and IBM Gestures datasets are used to test the attack algorithms as a sequence of binary frames.
SP:6bfb1a3e8f6b4ebee8e94090ad10538702ad8dd9
Adversarial Attacks on Spiking Convolutional Networks for Event-based Vision
Event-based sensing using dynamic vision sensors is gaining traction in lowpower vision applications . Spiking neural networks work well with the sparse nature of event-based data and suit deployment on low-power neuromorphic hardware . Being a nascent field , the sensitivity of spiking neural networks to potentially malicious adversarial attacks has received very little attention so far . In this work , we show how white-box adversarial attack algorithms can be adapted to the discrete and sparse nature of event-based visual data , and to the continuous-time setting of spiking neural networks . We test our methods on the N-MNIST and IBM Gestures neuromorphic vision datasets and show adversarial perturbations achieve a high success rate , by injecting a relatively small number of appropriately placed events . We also verify , for the first time , the effectiveness of these perturbations directly on neuromorphic hardware . Finally , we discuss the properties of the resulting perturbations and possible future directions . 1 INTRODUCTION . Unlike the usual neural networks of contemporary deep learning , spiking neural networks ( SNN ) resemble the animal brain more closely in at least two main aspects : the way their neurons communicate through impulses ( spikes ) , and their dynamics , which evolve in continuous time . Aside from offering the field of computational neuroscience more biologically plausible neuron models and communication schemes , research in the technological applications of spiking neural networks is currently blooming because of the rise of neuromorphic technology . Neuromorphic hardware is directly compatible with spiking neural networks and enables the design of low-power models for use in battery-operated , always-on devices . Adversarial examples are an “ intriguing property of neural networks ” ( Szegedy et al. , 2013 ) by which the network is easily fooled into misclassifying an input which has been altered in an almost imperceptible way by the attacker . This property is usually undesirable in applications : it was proven , for example , that an adversarial attack may pose a threat to self-driving cars , by making them misclassify a stop sign as a speed limit sign ; and that this attack can be implemented in the real world through stickers physically placed on the road sign ( Eykholt et al. , 2018 ) . Because of their relevance to real-world applications , a large amount of work has been published on this subject , typically following a pattern where new attacks are discovered , followed by new defense strategies , in turn followed by proof of other strategies that can still break through them ( see Akhtar & Mian ( 2018 ) for a review ) . With the advent of real-world applications of spiking networks in neuromorphic devices , it is essential to make sure they work securely and reliably in a variety of contexts . In particular , there is a significant need for research on the possibility of adversarial attacks on spiking network models used for computer sensing tasks . In this paper , we make an attempt at modifying event-based data , by adding and removing events , to generate adversarial examples that fool spiking networks into misclassifying them . This offers important insight into the reliability and security of neuromorphic vision devices , with important implications for commercial applications . 1.1 WHAT IS EVENT-BASED SENSING ? . Event-based cameras , usually called Dynamic Vision Sensors ( DVS ) , share many characteristics with the mammalian retina , which make them excel in some circumstances where traditional framebased cameras do not perform well ( Liu & Delbruck , 2010 ; Liu et al. , 2019b ) . First , events are generated only when there are changes in the visual scene , automatically removing redundancies ; second , their pixels fire independently of each other which means that there is no frame rate , but rather a continuous stream of asynchronous events , so that the latency can be extremely small ; third , they have a very high dynamic range which makes them suitable to detect motion in both bright and dark settings . For these reasons , they have found applications in human-robot interaction , odometry , drone control , tracking , and surveillance , including on devices that are already commercially available ( Gallego et al. , 2019 ; Kueng et al. , 2016 ; Falanga et al. , 2020 ) . Beyond computer vision , the realm of event-based sensing extends to auditory sensors known as silicon cochleas ( Chan et al. , 2007 ) , as well as radar ( Stuijt et al. , 2021 ) and tactile sensors ( Caviglia et al. , 2016 ) . Neuromorphic sensors make available a new kind of sparse , asynchronous data , which does not suit current high-throughput , synchronous accelerators such as GPUs . To process event-based data efficiently , a new generation of neuromorphic hardware is being developed in parallel to the spiking neural network models that can be trained in software . Spiking neuromorphic implementations include large-scale simulation of neuronal networks for neuroscience research ( Furber et al. , 2012 ) and lowpower real-world deployments of machine learning algorithms . In particular , convolutional neural network ( CNN ) architectures , used for computer vision , have been run on neuromorphic chips such as IBM ’ s TrueNorth ( Esser et al. , 2016 ) , Intel ’ s Loihi ( Davies et al. , 2018 ) and SynSense ’ s Speck and Dynap-CNN hardware ( Liu et al. , 2019a ) . The full pipeline of event-based sensors that output sparse data , stateful spiking neural networks which extract semantic meaning and asynchronous hardware backends allows for large gains in power-efficiency when compared to conventional systems . 1.2 ADVERSARIAL ATTACKS ON DISCRETE DATA . The history of attack strategies against various kinds of machine-learning algorithms pre-dates the advent of deep learning ( Biggio & Roli , 2018 ) , but the phenomenon received widespread interest when adversarial examples were first found for deep convolutional networks ( Szegedy et al. , 2013 ) . Generally speaking , given a neural network classifier C and an input x which is correctly classified , finding an adversarial perturbation means finding the smallest δ such that C ( x+ δ ) 6= C ( x ) . Here , “ smallest ” refers to minimising ‖δ‖ , where the norm is chosen arbitrarily depending on the requirements of the experiment . For example , using the L∞ norm ( maximum norm ) will generally make the perturbation less noticeable to a human eye , since the difference in any pixel value between the original and perturbed images will be below a maximum value that is kept as low as possible . Conversely , the use of the L1 norm will encourage sparsity , i.e . a smaller number of perturbed pixels . The main challenges in transferring existing adversarial algorithms to event-based neuromorphic vision lie in the dynamics of the data and network , which develop in continuous time , and in the discrete nature of events , which can either be present or absent at a given time and location , unlike the continuous pixel values of traditional image data . Event-based sensors encode information in the timing , location , and polarity of events , which can be of ‘ on ’ or ‘ off ’ type . Because at any point in time an event can either be triggered or not , one can simply view event-based inputs as binary data by discretising time ( Figure 1 ) . In this view , the network ’ s input is a three-dimensional array whose entries describe the number of events at a location ( x , y ) and in time bin t ; an additional dimension , of length 2 , is added due to the polarity of events . If the time discretisation is sufficiently precise , and no more than one event appears in each bin , the data can be treated as binary . A possible approach to attacking these data is exploiting recent work done on attacking binary images , i.e . with either black or white pixels , which are used in the automatic processing of cheques and other documents . Most methods proposed for attacking binary inputs have focused on brute-force approaches that rely on heuristics to reduce the search space ( Bagheri et al. , 2018 ; Balkanski et al. , 2020 ) . For example , SCAR ( Balkanski et al. , 2020 ) is a black-box algorithm that only assumes access to the output probabilities of the network . The algorithm flips bits in areas chosen according to a specific heuristic and keeps flipped those that cause a change in the confidence of the network . Naturally , this algorithm does not scale well to large input sizes , as the number of queries made to the network grows exponentially . In particular , this becomes a serious problem when the time dimension is added , greatly increasing the dimensionality of the input . Instead , in this paper , we chose to focus on the easier problem of white box attacks , where the attacker has full access to the network and can backpropagate gradients through it . This allows us to adapt faster and more effective algorithms to the case of event-based data . To this end , we chose to adapt existing attack strategies so that they could work with the time dynamics of spiking neural networks , and with the discrete nature of event-based data . We test our attacks on the Neuromorphic MNIST ( Orchard et al. , 2015 ) and IBM Gestures ( Amir et al. , 2017 ) datasets , which are the most common benchmark datasets within the neuromorphic community . Previous work on adversarial attacks in spiking networks has been reported by Sharmin et al . ( 2020 ) ; however , their work only uses static image data with continuous pixel values converted to Poisson input frequencies , so does not involve dealing with discrete data which was the main challenge in our work . More recently , Liang et al . ( 2020 ) did apply attacks to DVS data , using a discretisedgradient technique . They report high success rates , despite some notable problems of vanishing gradients . Concurrently with our work , Marchisio et al . ( 2021 ) designed custom algorithms for DVS data , rather than adapting existing ones , but did not report on the magnitudes of the resulting perturbations . None of these validated the effectiveness of their attack strategies against an on-chip model deployed on neuromorphic hardware . Our contributions beyond the existing literature can be summarised as follows : • We provide detailed results to quantify the effectiveness and scalability of several adversarial attacks strategies , including some not tried before on SNNs . • We show targeted universal attacks on event-based data in the form of adversarial patches , which do not require prior knowledge of the input . • We validate the resulting adversarial examples on an SNN deployed on a convolutional neuromorphic chip . To the best of our knowledge , this is the first time the effectiveness of adversarial examples is demonstrated directly on neuromorphic hardware . 2 METHODS . 2.1 ATTACK STRATEGIES . Projected Gradient Descent As a baseline , we use Projected Gradient Descent ( PGD ) ( Madry et al. , 2019 ) , a standard attack algorithm which we use on discrete data in two ways . The first consists in naively rounding the data at each iteration . However , in this case , updates will be retained only if the gradient magnitude is large enough : otherwise , the small changes made to the adversarial input are lost due to the subsequent discretization . Instead , we adopt an approach that prevents this loss of information : we keep a continuous version of the image as a copy , but use the gradients computed on the discretized image to update the continuous version which is kept in memory . To adapt PGD to the scenario where we want to find the smallest perturbation that triggers a misclassification , we sort the values based on how much PGD adjusted them . We then iterate through the sorted list of indices and flip each value until a misclassification is triggered . It should be noted that this step incurs most of the computational overhead , but is necessary to produce good results . Unless stated otherwise , we used the following values for the parameters : the magnitude of the initial random perturbation to the input is set to τ = 0.01 . The maximum norm of the perturbation was set to = 1.5 . We found that 50 iterations ( Npgd ) of PGD sufficed and the results did not improve by much afterwards . Probabilistic PGD We also devised an alternative way of using PGD on discrete data , which we call “ Probabilistic PGD ” . Probabilistic PGD works by assuming that the binary input was generated by sampling from a series of independent Bernoulli random variables . This approach aligns with how the DVS camera generates the binary data : the probability of emitting a spike at time t is proportional to the light intensity , a continuous metric . For each round of PGD , the input is sampled in a differentiable manner by the Gumbel-softmax reparameterization trick ( Jang et al. , 2017 ) : xadv = σ ( [ log ( r ) − log ( 1− r ) + log ( padv ) − log ( 1− padv ) ] /T ) , where r ∼ U ( 0,1 ) , and T = 0.01 is a temperature parameter . The underlying probabilities padv , instead of the pixel values xadv , are updated using the gradient obtained from the loss function that is minimised by PGD . We saw that this generally improved the performance compared to the PGD version explained above . Gradients are averaged over Nmc = 10 samples of r. It should be noted that the need for a gradient sampling procedure significantly increases the runtime . SparseFool on discrete data To operate on event-based data efficiently , the ideal adversarial algorithm requires two main properties : sparsity and scalability . Scalability is needed because of the increased dimensionality given by the additional time dimension . Sparsity ensures that the number of events added or removed is kept to a minimum . One approach that combines the above is SparseFool ( Modas et al. , 2018 ) , which iteratively finds the closest point in L2 on the linearised decision boundary of the network using the DeepFool algorithm ( Moosavi-Dezfooli et al. , 2015 ) as a subroutine , followed by a linear solver that enforces sparsity and boundary constraints on the perturbation . Because Spiking Neural Networks ( SNNs ) have discrete outputs ( the number of spikes over time for each output neuron ) , it is easier to incur in vanishing gradients as the perturbation approaches the decision boundary . Therefore , we had to make changes to the algorithm to take this into account . Firstly , we found that clamping the perturbation at every iteration of DeepFool , so that it was no smaller than a value η , offered protection against vanishing gradients . η was treated as a hyperpa- rameter that should be kept as small as it can without incurring in vanishing gradients . Secondly , to account for the discreteness of event-based data , we rounded the output of SparseFool to the nearest integer at each iteration . Finally , SparseFool normally involves upper and lower bounds l and u on pixel values ( normally set , for images , to l = 0 ; u = 255 ) . We exploit these to enforce the binary constraint on the data ( l = 0 ; u = 1 ) , or , in the on-chip experiments , to fix a maximum firing rate in each time bin , which is the same as that of the original input ( l = 0 ; u = max ( input ) ) . Adversarial patches As the name suggests , adversarial patches are perturbations that are accumulated in a certain region of the image . The idea is that these patches are generated in a way that enables the adversary to place them anywhere in the image . This attack is targeted to a desired label , and universal , i.e . not specific to an input . To test a more realistic scenario where an adversary could potentially perform an attack without previous knowledge of the input , we apply these patches to the IBM hand gesture dataset . We note that the prediction of the CNN trained on this dataset is mostly determined by spatial location of the input . For example , the original input of “ Right Hand Wave ” is not recognised as such if it is shifted or rotated by a substantial amount . In order to simulate effective realistic attacks , we choose to limit both computed and random attack patches to the area of where the actual gesture is performed . As in Brown et al . ( 2017 ) , we generate the patches using PGD on the log softmax value of the target output neuron . PGD is performed iteratively on different images of the training set and the position of the patch is randomised after each sample . For each item in the training data , the algorithm updates the patch until the target label confidence has reached a pre-defined threshold . The algorithm skips the point if the original label equals the target label . This process is repeated for every training sample and for multiple epochs . To measure the effectiveness of our computed patches , we also generate random patches of the same size , and measure the target success rates . In a random patch , every pixel has a 50 % chance of emitting a spike at each time step .
Authors present white-box adversarial attack algorithms for spiking neural networks (SNNs) with event-based visual data inputs, and experimentally demonstrate vulnerability of SNNs in various settings. Extensions of existing adversarial attacks on convolutional networks (i.e., PGD and SparseFool) are presented and utilized in a setting for SNNs with event-based inputs. Experimental evaluations are performed on the Neuromorphic-MNIST and IBM Gestures dynamic vision sensor datasets, and validations of these attacks on neuromorphic hardware are performed.
SP:6bfb1a3e8f6b4ebee8e94090ad10538702ad8dd9
Evaluating Predictive Distributions: Does Bayesian Deep Learning Work?
1 Introduction . Deep learning has emerged as the state-of-the-art approach across a number of application domains in which agents learn from large amounts of data ( LeCun et al. , 2015 ) . Neural networks are increasingly used not only to predict outcomes but also to inform decisions . Common approaches in deep learning produce point estimates but not uncertainty estimates , which are often required for effective decision-making . Bayesian deep learning extends the methodology to produce such uncertainty estimates ( MacKay , 1992 ; Neal , 2012 ) . We consider agents that are trained on data pairs ( ( Xt , Yt+1 ) : t = 0 , 1 , . . . , T − 1 ) and subsequently generate predictions given new inputs . When presented with an input XT , a Bayesian neural network can generate a predictive distribution of the outcome YT+1 that is yet to be observed . This distribution characterizes the agent ’ s uncertainty about YT+1 . We refer to such a prediction as marginal to distinguish it from a joint predictive distribution over a list ( YT+1 , . . . , YT+τ ) of prospective outcomes corresponding to inputs ( XT , . . . , XT+τ−1 ) . The importance of uncertainty estimation has motivated a great deal of research over recent years ( Kendall & Gal , 2017 ) . This research has produced a variety of agents that learn to generate predictive distributions . With this proliferation of alternatives , it is increasingly important to analyze and compare their performance ( Filos et al. , 2019 ; Nado et al. , 2021 ) . In this paper , we introduce new tools for systematic evaluation of such agents . Our tools overcome several limitations faced by previous methods of evaluation . First , by focusing purely on predictive distributions , we allow for a unified treatment of approaches developed within the Bayesian neural network community and beyond . This sidesteps the Open source code available at https : //anonymous.4open.science/r/neural-testbed-B839 . question of whether any approach ‘ is really Bayesian ’ ( Wilson & Izmailov , 2020 ) . Second , our tools evaluate the quality of higher-order joint predictions ( τ > 1 ) . Until now , the Bayesian deep learning literature has focused almost exclusively on evaluating marginal predictions ( Wang et al. , 2021 ) . Finally , we develop a neural-network-based data generating process for Bayesian deep learning that can be used to drive insight and algorithm development . Where research has focused on a small set of challenge datasets , this might introduce bias through overfitting via multiple iterations of algorithm development . We use these tools to compare hundreds of agent variants . Further , we show that performance on our synthetic data generating process data is highly correlated with performance on real-world challenge datasets . We opensource all code used in this paper as The Neural Testbed . Our results reconcile several sources of confusion in the field . One concerns why particular approaches developed by the Bayesian deep learning community , such as Bayes-by-backprop , dropout , and deep ensembles , perform poorly in sequential decision tasks despite faring well based on evaluation metrics of that community ( Osband et al. , 2018 ) . Our results demonstrate that , while such methods produce accurate marginal predictions , they are no longer competitive when it comes to high-order joint predictions . Joint predictions play a critical role in sequential decision-making ( Lu et al. , 2021 ) . Another puzzling issue is that state-of-the-art methods do not employ domain-specific priors . Whether Bayesian deep learning approaches should at all is a subject of controversy ( Wenzel et al. , 2020 ) . We show that the benefits of domain-specific priors can be pronounced when evaluating high-order joint predictions , even where they are negligible for marginals . We also help to resolve a point of philosophical debate within the deep learning community : the importance of epistemic versus aleatoric uncertainty1 . The strangeness of this distinction has even made its way into wider popular culture , as satirized in the XKCD comic of Figure 1 ( Munroe , 2021 ) . For a given parametric model , we can clearly distinguish parameter uncertainty from noise , or reducible from irreducible uncertainty . However , from the perspective of a learning agent , the choice of model is subjective ; different models can lead to the same marginal predictions . Our formulation provides a clear and objective way to assess the quality of predictive distributions , without reliance on this subjective distinction between knowledge and chance . Crucially , we show that this can be judged via the quality of joint predictions , but that marginals are not sufficient . It is worth mentioning another notable contribution of this work . The quality of a predictive distribution is commonly assessed in terms of cross-entropy loss . While this measure is welldefined for both marginal and joint predictions , to the best of our knowledge , the literature has only addressed computation in the former case . For high-order joint predictions , the straightforward approach would require computing sums over exponentially many values . To render this computationally tractable , we developed a novel approximation algorithm that leverages a random partitioning operation and Monte Carlo simulation . While this approach is motivated by concepts from high-dimensional geometry ( Kaski , 1998 ; Donoho , 2006 ) , we leave its analysis as a topic for future theoretical research . 1Epistemic uncertainty relates to knowledge ( ancient Greek episteme↔knowledge ) , as opposed to aleatoric uncertainty relating to chance ( Latin alea↔dice ) ( Der Kiureghian & Ditlevsen , 2009 ) . 2 Evaluating predictive distributions . In this section , we introduce notation for the standard supervised learning framework we will consider ( classification ) as well as our evaluation metric ( the KL-loss ) . We also explain how we estimate the KL-loss for high-order joint predictions where exact computation is infeasible , using random partitions and Monte Carlo simulation . 2.1 Kullback–Leibler loss . Consider a sequence of pairs ( ( Xt , Yt+1 ) : t = 0 , 1 , 2 , . . . ) , where each Xt is a feature vector and each Yt+1 is its target label . This sequence is i.i.d . conditioned on the environment E , which produces the data , and which we view as a latent random variable . We consider an agent that is uncertain about the environment and predicts class labels YT+1 : T+τ ≡ ( YT+1 , . . . , YT+τ ) given training data pairs DT ≡ ( ( Xt , Yt+1 ) : t = 0 , 1 , 2 , . . . , T − 1 ) and unlabelled feature vectors XT : T+τ−1 ≡ ( XT , . . . , XT+τ−1 ) . From the agent ’ s perspective , each feature vector Xt is generated i.i.d from a fixed distribution P ( Xt ∈ · ) , and each class label Yt+1 is then drawn from P ( Yt+1 ∈ ·|E , Xt ) . We describe the agent ’ s predictions in terms of a generative model , parameterized by a vector θT that the agent learns from the training data DT . For any inputs XT : T+τ−1 , θT determines a predictive distribution , which could be used to sample imagined outcomes ŶT+1 : T+τ . We define the τ th-order expected KL-loss by dτKL =E [ dKL ( P ( YT+1 : T+τ ∈ ·|E , XT : T+τ−1 ) ︸ ︷︷ ︸ environment likelihood ∥∥P ( ŶT+1 : T+τ ∈ ·|θT , XT : T+τ−1 ) ︸ ︷︷ ︸ agent likelihood ) ] ( 1 ) =−E [ log ( P ( ŶT+1 : T+τ = YT+1 : T+τ ∣∣∣θT , XT : T+τ−1 , YT+1 : T+τ ) ) ] ︸ ︷︷ ︸ cross-entropy loss ≡ negative log-likelihood + C , where C = E [ log ( P ( YT+1 : T+τ |E , XT : T+τ−1 ) ) ] is independent of θT . The expectation is taken over all random variables , including the environment E , the parameters θT , XT : T+τ−1 , and YT+1 : T+τ . Note that dτKL is equivalent to the widely used notion of cross-entropy loss , though offset by a quantity that is independent of θT ( Kullback & Leibler , 1951 ) . For τ > 1 , dτKL assesses joint rather than the marginal predictions . 2.2 Marginal Versus Joint Predictions . Evaluating an agent ’ s ability to estimate uncertainty on joint instead of marginal predictions can result in very different answers . We provide a simple example that illustrates the point . Suppose the data ( ( Xt , Yt+1 ) : t = 0 , 1 , 2 , . . . ) is generated by repeated tosses of a possibly biased coin with unknown probability p of heads.2 Let Xt = 0 , to indicate that there is no input , and let each outcome Yt+1 be 0 or 1 to indicate tails or heads , respectively . Consider two agents that , without any training , predict outcomes . Agent 1 assumes p = 2/3 and models the outcome of each flip as pure chance . Agent 2 assumes that the coin is fully biased , meaning that p ∈ { 0 , 1 } , but assigns probabilities 1/3 and 2/3 to 0 and 1 . Let Ŷ 1t+1 and Ŷ 2t+1 denote the outcomes imagined by the two agents . Despite their differing assumptions , the two agents generate identical marginal predictive distributions : P ( Ŷ 1t+1 = 0 ) = P ( Ŷ 2t+1 = 0 ) = 1/3 . On the other hand , joint predictions greatly differ for large τ : P ( Ŷ 11 = 0 , .. , Ŷ 1τ = 0 ) = 1/3τ 1/3 = P ( Ŷ 21 = 0 , . . . , Ŷ 2τ = 0 ) . We can say that agent 1 attributes all uncertainty to aleatoric sources and agent 2 , epistemic sources ( although as Figure 1 alludes , there are many ways an agent can attribute sources of uncertainty ) . Evaluating marginal predictions can not distinguish between the two possibilities , though for a specific prior distribution over p , one agent could be right and the other wrong . One must evaluate joint predictions to make this distinction . 2We consider this coin as an illustrative model of more complex binary outcomes , such as whether a user will click on an ad , or whether a given mortgage will default on payments . When it comes to decision-making , this distinction can be critical ( Lu et al. , 2021 ) . In a casino , under the first agent ’ s assumption , there is large upside and little risk on repeatedly betting on heads in the long run . However , if there is a 1/3 chance the coin will always land tails , as is the case in the second agent ’ s prediction , there is a ruinous risk to repeatedly betting heads . Evaluating joint predictions beyond marginals distinguishes these cases . 2.3 Computation of Kullback–Leibler loss . In contexts we will consider , it is not possible to compute dτKL exactly . As such , we will approximate dτKL via Monte Carlo simulation . This section provides a high level overview of our approach , we push the full details to Appendix A. Algorithm 1 outlines a basic approach to estimating dτKL with respect to a synthetic data generating process . The algorithm samples a set of environments and a training dataset for each environment . For each of these pairs , the agent is re-initialized , trained , and then tested on N independent test data τ -samples . Note that each test data τ -sample includes τ data pairs . For each test data τ -sample , the likelihood of the environment is computed exactly , but that of the agent ’ s belief distribution is approximated . The estimate of dτKL is taken to be the sample mean of the log-likelihood-ratios ( Algorithm 2 ) . Algorithm 1 KL-Loss Computation 1 : for j = 1 , 2 , . . . , J do 2 : sample environment and training dataset , and train agent 3 : for n = 1 , 2 , . . . , N do 4 : sample a test data τ -sample with τ feature-label pairs 5 : compute pj , n . likelihood of environment 6 : compute p̂j , n . estimated likelihood of agent ’ s belief distribution 7 : return 1JN ∑J j=1 ∑N n=1 log ( pj , n/p̂j , n ) . estimated log-likelihood-ratio While the likelihood of an environment can be efficiently computed , that of an agent ’ s belief distribution poses a computational challenge . One approach is to estimate this likelihood via Monte Carlo simulation ( Algorithm 3 ) . This produces unbiased estimates , which can be accurate when τ is small . However , maintaining accuracy requires the number of samples to grow exponentially with τ , as discussed in Appendix A.1 . To overcome this challenge , we propose a novel approach that estimates the likelihood of the agent ’ s beliefs via a combination of randomized partitioning and Monte Carlo simulation ( Algorithm 4 ) ( Kaski , 1998 ) . We conjecture that , under suitable regularity conditions , this novel approach produces accurate estimates even when τ is large , but leave a formal analysis to future work . Even though Algorithm 1 is developed for a synthetic data generating process , it is straightforward to extend it to evaluate agents on real data . We outline our approach to real data in Section 5.1 , with full details in Appendix A.2 .
The authors discuss whether it is sufficient to consider the marginal posterior predictive vs considering a joint posterior predictive when evaluating Bayesian deep learning approaches. Introducing a set of experiments (_The Neural Testbed_), they demonstrate that the performance of common approaches can differ greatly depending on which of these predictive distributions are evaluated. Additionally, extensive code is provided for efficient implementation and evaluation of new models.
SP:222622c8f80c9d7bcd12ed6c53c0a02be13f3a40
Evaluating Predictive Distributions: Does Bayesian Deep Learning Work?
1 Introduction . Deep learning has emerged as the state-of-the-art approach across a number of application domains in which agents learn from large amounts of data ( LeCun et al. , 2015 ) . Neural networks are increasingly used not only to predict outcomes but also to inform decisions . Common approaches in deep learning produce point estimates but not uncertainty estimates , which are often required for effective decision-making . Bayesian deep learning extends the methodology to produce such uncertainty estimates ( MacKay , 1992 ; Neal , 2012 ) . We consider agents that are trained on data pairs ( ( Xt , Yt+1 ) : t = 0 , 1 , . . . , T − 1 ) and subsequently generate predictions given new inputs . When presented with an input XT , a Bayesian neural network can generate a predictive distribution of the outcome YT+1 that is yet to be observed . This distribution characterizes the agent ’ s uncertainty about YT+1 . We refer to such a prediction as marginal to distinguish it from a joint predictive distribution over a list ( YT+1 , . . . , YT+τ ) of prospective outcomes corresponding to inputs ( XT , . . . , XT+τ−1 ) . The importance of uncertainty estimation has motivated a great deal of research over recent years ( Kendall & Gal , 2017 ) . This research has produced a variety of agents that learn to generate predictive distributions . With this proliferation of alternatives , it is increasingly important to analyze and compare their performance ( Filos et al. , 2019 ; Nado et al. , 2021 ) . In this paper , we introduce new tools for systematic evaluation of such agents . Our tools overcome several limitations faced by previous methods of evaluation . First , by focusing purely on predictive distributions , we allow for a unified treatment of approaches developed within the Bayesian neural network community and beyond . This sidesteps the Open source code available at https : //anonymous.4open.science/r/neural-testbed-B839 . question of whether any approach ‘ is really Bayesian ’ ( Wilson & Izmailov , 2020 ) . Second , our tools evaluate the quality of higher-order joint predictions ( τ > 1 ) . Until now , the Bayesian deep learning literature has focused almost exclusively on evaluating marginal predictions ( Wang et al. , 2021 ) . Finally , we develop a neural-network-based data generating process for Bayesian deep learning that can be used to drive insight and algorithm development . Where research has focused on a small set of challenge datasets , this might introduce bias through overfitting via multiple iterations of algorithm development . We use these tools to compare hundreds of agent variants . Further , we show that performance on our synthetic data generating process data is highly correlated with performance on real-world challenge datasets . We opensource all code used in this paper as The Neural Testbed . Our results reconcile several sources of confusion in the field . One concerns why particular approaches developed by the Bayesian deep learning community , such as Bayes-by-backprop , dropout , and deep ensembles , perform poorly in sequential decision tasks despite faring well based on evaluation metrics of that community ( Osband et al. , 2018 ) . Our results demonstrate that , while such methods produce accurate marginal predictions , they are no longer competitive when it comes to high-order joint predictions . Joint predictions play a critical role in sequential decision-making ( Lu et al. , 2021 ) . Another puzzling issue is that state-of-the-art methods do not employ domain-specific priors . Whether Bayesian deep learning approaches should at all is a subject of controversy ( Wenzel et al. , 2020 ) . We show that the benefits of domain-specific priors can be pronounced when evaluating high-order joint predictions , even where they are negligible for marginals . We also help to resolve a point of philosophical debate within the deep learning community : the importance of epistemic versus aleatoric uncertainty1 . The strangeness of this distinction has even made its way into wider popular culture , as satirized in the XKCD comic of Figure 1 ( Munroe , 2021 ) . For a given parametric model , we can clearly distinguish parameter uncertainty from noise , or reducible from irreducible uncertainty . However , from the perspective of a learning agent , the choice of model is subjective ; different models can lead to the same marginal predictions . Our formulation provides a clear and objective way to assess the quality of predictive distributions , without reliance on this subjective distinction between knowledge and chance . Crucially , we show that this can be judged via the quality of joint predictions , but that marginals are not sufficient . It is worth mentioning another notable contribution of this work . The quality of a predictive distribution is commonly assessed in terms of cross-entropy loss . While this measure is welldefined for both marginal and joint predictions , to the best of our knowledge , the literature has only addressed computation in the former case . For high-order joint predictions , the straightforward approach would require computing sums over exponentially many values . To render this computationally tractable , we developed a novel approximation algorithm that leverages a random partitioning operation and Monte Carlo simulation . While this approach is motivated by concepts from high-dimensional geometry ( Kaski , 1998 ; Donoho , 2006 ) , we leave its analysis as a topic for future theoretical research . 1Epistemic uncertainty relates to knowledge ( ancient Greek episteme↔knowledge ) , as opposed to aleatoric uncertainty relating to chance ( Latin alea↔dice ) ( Der Kiureghian & Ditlevsen , 2009 ) . 2 Evaluating predictive distributions . In this section , we introduce notation for the standard supervised learning framework we will consider ( classification ) as well as our evaluation metric ( the KL-loss ) . We also explain how we estimate the KL-loss for high-order joint predictions where exact computation is infeasible , using random partitions and Monte Carlo simulation . 2.1 Kullback–Leibler loss . Consider a sequence of pairs ( ( Xt , Yt+1 ) : t = 0 , 1 , 2 , . . . ) , where each Xt is a feature vector and each Yt+1 is its target label . This sequence is i.i.d . conditioned on the environment E , which produces the data , and which we view as a latent random variable . We consider an agent that is uncertain about the environment and predicts class labels YT+1 : T+τ ≡ ( YT+1 , . . . , YT+τ ) given training data pairs DT ≡ ( ( Xt , Yt+1 ) : t = 0 , 1 , 2 , . . . , T − 1 ) and unlabelled feature vectors XT : T+τ−1 ≡ ( XT , . . . , XT+τ−1 ) . From the agent ’ s perspective , each feature vector Xt is generated i.i.d from a fixed distribution P ( Xt ∈ · ) , and each class label Yt+1 is then drawn from P ( Yt+1 ∈ ·|E , Xt ) . We describe the agent ’ s predictions in terms of a generative model , parameterized by a vector θT that the agent learns from the training data DT . For any inputs XT : T+τ−1 , θT determines a predictive distribution , which could be used to sample imagined outcomes ŶT+1 : T+τ . We define the τ th-order expected KL-loss by dτKL =E [ dKL ( P ( YT+1 : T+τ ∈ ·|E , XT : T+τ−1 ) ︸ ︷︷ ︸ environment likelihood ∥∥P ( ŶT+1 : T+τ ∈ ·|θT , XT : T+τ−1 ) ︸ ︷︷ ︸ agent likelihood ) ] ( 1 ) =−E [ log ( P ( ŶT+1 : T+τ = YT+1 : T+τ ∣∣∣θT , XT : T+τ−1 , YT+1 : T+τ ) ) ] ︸ ︷︷ ︸ cross-entropy loss ≡ negative log-likelihood + C , where C = E [ log ( P ( YT+1 : T+τ |E , XT : T+τ−1 ) ) ] is independent of θT . The expectation is taken over all random variables , including the environment E , the parameters θT , XT : T+τ−1 , and YT+1 : T+τ . Note that dτKL is equivalent to the widely used notion of cross-entropy loss , though offset by a quantity that is independent of θT ( Kullback & Leibler , 1951 ) . For τ > 1 , dτKL assesses joint rather than the marginal predictions . 2.2 Marginal Versus Joint Predictions . Evaluating an agent ’ s ability to estimate uncertainty on joint instead of marginal predictions can result in very different answers . We provide a simple example that illustrates the point . Suppose the data ( ( Xt , Yt+1 ) : t = 0 , 1 , 2 , . . . ) is generated by repeated tosses of a possibly biased coin with unknown probability p of heads.2 Let Xt = 0 , to indicate that there is no input , and let each outcome Yt+1 be 0 or 1 to indicate tails or heads , respectively . Consider two agents that , without any training , predict outcomes . Agent 1 assumes p = 2/3 and models the outcome of each flip as pure chance . Agent 2 assumes that the coin is fully biased , meaning that p ∈ { 0 , 1 } , but assigns probabilities 1/3 and 2/3 to 0 and 1 . Let Ŷ 1t+1 and Ŷ 2t+1 denote the outcomes imagined by the two agents . Despite their differing assumptions , the two agents generate identical marginal predictive distributions : P ( Ŷ 1t+1 = 0 ) = P ( Ŷ 2t+1 = 0 ) = 1/3 . On the other hand , joint predictions greatly differ for large τ : P ( Ŷ 11 = 0 , .. , Ŷ 1τ = 0 ) = 1/3τ 1/3 = P ( Ŷ 21 = 0 , . . . , Ŷ 2τ = 0 ) . We can say that agent 1 attributes all uncertainty to aleatoric sources and agent 2 , epistemic sources ( although as Figure 1 alludes , there are many ways an agent can attribute sources of uncertainty ) . Evaluating marginal predictions can not distinguish between the two possibilities , though for a specific prior distribution over p , one agent could be right and the other wrong . One must evaluate joint predictions to make this distinction . 2We consider this coin as an illustrative model of more complex binary outcomes , such as whether a user will click on an ad , or whether a given mortgage will default on payments . When it comes to decision-making , this distinction can be critical ( Lu et al. , 2021 ) . In a casino , under the first agent ’ s assumption , there is large upside and little risk on repeatedly betting on heads in the long run . However , if there is a 1/3 chance the coin will always land tails , as is the case in the second agent ’ s prediction , there is a ruinous risk to repeatedly betting heads . Evaluating joint predictions beyond marginals distinguishes these cases . 2.3 Computation of Kullback–Leibler loss . In contexts we will consider , it is not possible to compute dτKL exactly . As such , we will approximate dτKL via Monte Carlo simulation . This section provides a high level overview of our approach , we push the full details to Appendix A. Algorithm 1 outlines a basic approach to estimating dτKL with respect to a synthetic data generating process . The algorithm samples a set of environments and a training dataset for each environment . For each of these pairs , the agent is re-initialized , trained , and then tested on N independent test data τ -samples . Note that each test data τ -sample includes τ data pairs . For each test data τ -sample , the likelihood of the environment is computed exactly , but that of the agent ’ s belief distribution is approximated . The estimate of dτKL is taken to be the sample mean of the log-likelihood-ratios ( Algorithm 2 ) . Algorithm 1 KL-Loss Computation 1 : for j = 1 , 2 , . . . , J do 2 : sample environment and training dataset , and train agent 3 : for n = 1 , 2 , . . . , N do 4 : sample a test data τ -sample with τ feature-label pairs 5 : compute pj , n . likelihood of environment 6 : compute p̂j , n . estimated likelihood of agent ’ s belief distribution 7 : return 1JN ∑J j=1 ∑N n=1 log ( pj , n/p̂j , n ) . estimated log-likelihood-ratio While the likelihood of an environment can be efficiently computed , that of an agent ’ s belief distribution poses a computational challenge . One approach is to estimate this likelihood via Monte Carlo simulation ( Algorithm 3 ) . This produces unbiased estimates , which can be accurate when τ is small . However , maintaining accuracy requires the number of samples to grow exponentially with τ , as discussed in Appendix A.1 . To overcome this challenge , we propose a novel approach that estimates the likelihood of the agent ’ s beliefs via a combination of randomized partitioning and Monte Carlo simulation ( Algorithm 4 ) ( Kaski , 1998 ) . We conjecture that , under suitable regularity conditions , this novel approach produces accurate estimates even when τ is large , but leave a formal analysis to future work . Even though Algorithm 1 is developed for a synthetic data generating process , it is straightforward to extend it to evaluate agents on real data . We outline our approach to real data in Section 5.1 , with full details in Appendix A.2 .
This work advocates evaluating predictive distributions via joint predictions (rather than the standard practice of evaluating marginal predictions) and introduces The Neural Testbed, an open-source software which includes the testing suite, along with implementations of a handful of methods in uncertainty quantification (UQ). The core evaluation metric used is KL divergence (cross-entropy loss) between the predictive distribution and the true likelihood of the data-generating process, and this work proposes an algorithm to compute this metric with joint distributions. The empirical evaluations compare numerous standard UQ methods with the Testbed, with both synthetic and real datasets.
SP:222622c8f80c9d7bcd12ed6c53c0a02be13f3a40
Evaluating Predictive Distributions: Does Bayesian Deep Learning Work?
1 Introduction . Deep learning has emerged as the state-of-the-art approach across a number of application domains in which agents learn from large amounts of data ( LeCun et al. , 2015 ) . Neural networks are increasingly used not only to predict outcomes but also to inform decisions . Common approaches in deep learning produce point estimates but not uncertainty estimates , which are often required for effective decision-making . Bayesian deep learning extends the methodology to produce such uncertainty estimates ( MacKay , 1992 ; Neal , 2012 ) . We consider agents that are trained on data pairs ( ( Xt , Yt+1 ) : t = 0 , 1 , . . . , T − 1 ) and subsequently generate predictions given new inputs . When presented with an input XT , a Bayesian neural network can generate a predictive distribution of the outcome YT+1 that is yet to be observed . This distribution characterizes the agent ’ s uncertainty about YT+1 . We refer to such a prediction as marginal to distinguish it from a joint predictive distribution over a list ( YT+1 , . . . , YT+τ ) of prospective outcomes corresponding to inputs ( XT , . . . , XT+τ−1 ) . The importance of uncertainty estimation has motivated a great deal of research over recent years ( Kendall & Gal , 2017 ) . This research has produced a variety of agents that learn to generate predictive distributions . With this proliferation of alternatives , it is increasingly important to analyze and compare their performance ( Filos et al. , 2019 ; Nado et al. , 2021 ) . In this paper , we introduce new tools for systematic evaluation of such agents . Our tools overcome several limitations faced by previous methods of evaluation . First , by focusing purely on predictive distributions , we allow for a unified treatment of approaches developed within the Bayesian neural network community and beyond . This sidesteps the Open source code available at https : //anonymous.4open.science/r/neural-testbed-B839 . question of whether any approach ‘ is really Bayesian ’ ( Wilson & Izmailov , 2020 ) . Second , our tools evaluate the quality of higher-order joint predictions ( τ > 1 ) . Until now , the Bayesian deep learning literature has focused almost exclusively on evaluating marginal predictions ( Wang et al. , 2021 ) . Finally , we develop a neural-network-based data generating process for Bayesian deep learning that can be used to drive insight and algorithm development . Where research has focused on a small set of challenge datasets , this might introduce bias through overfitting via multiple iterations of algorithm development . We use these tools to compare hundreds of agent variants . Further , we show that performance on our synthetic data generating process data is highly correlated with performance on real-world challenge datasets . We opensource all code used in this paper as The Neural Testbed . Our results reconcile several sources of confusion in the field . One concerns why particular approaches developed by the Bayesian deep learning community , such as Bayes-by-backprop , dropout , and deep ensembles , perform poorly in sequential decision tasks despite faring well based on evaluation metrics of that community ( Osband et al. , 2018 ) . Our results demonstrate that , while such methods produce accurate marginal predictions , they are no longer competitive when it comes to high-order joint predictions . Joint predictions play a critical role in sequential decision-making ( Lu et al. , 2021 ) . Another puzzling issue is that state-of-the-art methods do not employ domain-specific priors . Whether Bayesian deep learning approaches should at all is a subject of controversy ( Wenzel et al. , 2020 ) . We show that the benefits of domain-specific priors can be pronounced when evaluating high-order joint predictions , even where they are negligible for marginals . We also help to resolve a point of philosophical debate within the deep learning community : the importance of epistemic versus aleatoric uncertainty1 . The strangeness of this distinction has even made its way into wider popular culture , as satirized in the XKCD comic of Figure 1 ( Munroe , 2021 ) . For a given parametric model , we can clearly distinguish parameter uncertainty from noise , or reducible from irreducible uncertainty . However , from the perspective of a learning agent , the choice of model is subjective ; different models can lead to the same marginal predictions . Our formulation provides a clear and objective way to assess the quality of predictive distributions , without reliance on this subjective distinction between knowledge and chance . Crucially , we show that this can be judged via the quality of joint predictions , but that marginals are not sufficient . It is worth mentioning another notable contribution of this work . The quality of a predictive distribution is commonly assessed in terms of cross-entropy loss . While this measure is welldefined for both marginal and joint predictions , to the best of our knowledge , the literature has only addressed computation in the former case . For high-order joint predictions , the straightforward approach would require computing sums over exponentially many values . To render this computationally tractable , we developed a novel approximation algorithm that leverages a random partitioning operation and Monte Carlo simulation . While this approach is motivated by concepts from high-dimensional geometry ( Kaski , 1998 ; Donoho , 2006 ) , we leave its analysis as a topic for future theoretical research . 1Epistemic uncertainty relates to knowledge ( ancient Greek episteme↔knowledge ) , as opposed to aleatoric uncertainty relating to chance ( Latin alea↔dice ) ( Der Kiureghian & Ditlevsen , 2009 ) . 2 Evaluating predictive distributions . In this section , we introduce notation for the standard supervised learning framework we will consider ( classification ) as well as our evaluation metric ( the KL-loss ) . We also explain how we estimate the KL-loss for high-order joint predictions where exact computation is infeasible , using random partitions and Monte Carlo simulation . 2.1 Kullback–Leibler loss . Consider a sequence of pairs ( ( Xt , Yt+1 ) : t = 0 , 1 , 2 , . . . ) , where each Xt is a feature vector and each Yt+1 is its target label . This sequence is i.i.d . conditioned on the environment E , which produces the data , and which we view as a latent random variable . We consider an agent that is uncertain about the environment and predicts class labels YT+1 : T+τ ≡ ( YT+1 , . . . , YT+τ ) given training data pairs DT ≡ ( ( Xt , Yt+1 ) : t = 0 , 1 , 2 , . . . , T − 1 ) and unlabelled feature vectors XT : T+τ−1 ≡ ( XT , . . . , XT+τ−1 ) . From the agent ’ s perspective , each feature vector Xt is generated i.i.d from a fixed distribution P ( Xt ∈ · ) , and each class label Yt+1 is then drawn from P ( Yt+1 ∈ ·|E , Xt ) . We describe the agent ’ s predictions in terms of a generative model , parameterized by a vector θT that the agent learns from the training data DT . For any inputs XT : T+τ−1 , θT determines a predictive distribution , which could be used to sample imagined outcomes ŶT+1 : T+τ . We define the τ th-order expected KL-loss by dτKL =E [ dKL ( P ( YT+1 : T+τ ∈ ·|E , XT : T+τ−1 ) ︸ ︷︷ ︸ environment likelihood ∥∥P ( ŶT+1 : T+τ ∈ ·|θT , XT : T+τ−1 ) ︸ ︷︷ ︸ agent likelihood ) ] ( 1 ) =−E [ log ( P ( ŶT+1 : T+τ = YT+1 : T+τ ∣∣∣θT , XT : T+τ−1 , YT+1 : T+τ ) ) ] ︸ ︷︷ ︸ cross-entropy loss ≡ negative log-likelihood + C , where C = E [ log ( P ( YT+1 : T+τ |E , XT : T+τ−1 ) ) ] is independent of θT . The expectation is taken over all random variables , including the environment E , the parameters θT , XT : T+τ−1 , and YT+1 : T+τ . Note that dτKL is equivalent to the widely used notion of cross-entropy loss , though offset by a quantity that is independent of θT ( Kullback & Leibler , 1951 ) . For τ > 1 , dτKL assesses joint rather than the marginal predictions . 2.2 Marginal Versus Joint Predictions . Evaluating an agent ’ s ability to estimate uncertainty on joint instead of marginal predictions can result in very different answers . We provide a simple example that illustrates the point . Suppose the data ( ( Xt , Yt+1 ) : t = 0 , 1 , 2 , . . . ) is generated by repeated tosses of a possibly biased coin with unknown probability p of heads.2 Let Xt = 0 , to indicate that there is no input , and let each outcome Yt+1 be 0 or 1 to indicate tails or heads , respectively . Consider two agents that , without any training , predict outcomes . Agent 1 assumes p = 2/3 and models the outcome of each flip as pure chance . Agent 2 assumes that the coin is fully biased , meaning that p ∈ { 0 , 1 } , but assigns probabilities 1/3 and 2/3 to 0 and 1 . Let Ŷ 1t+1 and Ŷ 2t+1 denote the outcomes imagined by the two agents . Despite their differing assumptions , the two agents generate identical marginal predictive distributions : P ( Ŷ 1t+1 = 0 ) = P ( Ŷ 2t+1 = 0 ) = 1/3 . On the other hand , joint predictions greatly differ for large τ : P ( Ŷ 11 = 0 , .. , Ŷ 1τ = 0 ) = 1/3τ 1/3 = P ( Ŷ 21 = 0 , . . . , Ŷ 2τ = 0 ) . We can say that agent 1 attributes all uncertainty to aleatoric sources and agent 2 , epistemic sources ( although as Figure 1 alludes , there are many ways an agent can attribute sources of uncertainty ) . Evaluating marginal predictions can not distinguish between the two possibilities , though for a specific prior distribution over p , one agent could be right and the other wrong . One must evaluate joint predictions to make this distinction . 2We consider this coin as an illustrative model of more complex binary outcomes , such as whether a user will click on an ad , or whether a given mortgage will default on payments . When it comes to decision-making , this distinction can be critical ( Lu et al. , 2021 ) . In a casino , under the first agent ’ s assumption , there is large upside and little risk on repeatedly betting on heads in the long run . However , if there is a 1/3 chance the coin will always land tails , as is the case in the second agent ’ s prediction , there is a ruinous risk to repeatedly betting heads . Evaluating joint predictions beyond marginals distinguishes these cases . 2.3 Computation of Kullback–Leibler loss . In contexts we will consider , it is not possible to compute dτKL exactly . As such , we will approximate dτKL via Monte Carlo simulation . This section provides a high level overview of our approach , we push the full details to Appendix A. Algorithm 1 outlines a basic approach to estimating dτKL with respect to a synthetic data generating process . The algorithm samples a set of environments and a training dataset for each environment . For each of these pairs , the agent is re-initialized , trained , and then tested on N independent test data τ -samples . Note that each test data τ -sample includes τ data pairs . For each test data τ -sample , the likelihood of the environment is computed exactly , but that of the agent ’ s belief distribution is approximated . The estimate of dτKL is taken to be the sample mean of the log-likelihood-ratios ( Algorithm 2 ) . Algorithm 1 KL-Loss Computation 1 : for j = 1 , 2 , . . . , J do 2 : sample environment and training dataset , and train agent 3 : for n = 1 , 2 , . . . , N do 4 : sample a test data τ -sample with τ feature-label pairs 5 : compute pj , n . likelihood of environment 6 : compute p̂j , n . estimated likelihood of agent ’ s belief distribution 7 : return 1JN ∑J j=1 ∑N n=1 log ( pj , n/p̂j , n ) . estimated log-likelihood-ratio While the likelihood of an environment can be efficiently computed , that of an agent ’ s belief distribution poses a computational challenge . One approach is to estimate this likelihood via Monte Carlo simulation ( Algorithm 3 ) . This produces unbiased estimates , which can be accurate when τ is small . However , maintaining accuracy requires the number of samples to grow exponentially with τ , as discussed in Appendix A.1 . To overcome this challenge , we propose a novel approach that estimates the likelihood of the agent ’ s beliefs via a combination of randomized partitioning and Monte Carlo simulation ( Algorithm 4 ) ( Kaski , 1998 ) . We conjecture that , under suitable regularity conditions , this novel approach produces accurate estimates even when τ is large , but leave a formal analysis to future work . Even though Algorithm 1 is developed for a synthetic data generating process , it is straightforward to extend it to evaluate agents on real data . We outline our approach to real data in Section 5.1 , with full details in Appendix A.2 .
The paper proposes a simulation based framework to evaluate different techniques proposed for uncertainty estimation of predictive models. The approach relies on simulated data to control effects such as environments where data is collected, data and model uncertainty. This control enables generating interesting insights about various techniques. 
The paper also go beyond evaluating marginal posterior predictive distributions and extend their benchmarking work to joint distributions capturing sequential decisions that can be made with such models. Some of the highlights from the results: 1) Their results show that Bayesian deep learning is impactful for capturing the joint predictive distributions. 2) Priors used in ensemble+ help with diversity and therefore enable better predictive distributions. 3) Bootstrapping help with robustness of predictions if the models hyperparameters are not tuned.
SP:222622c8f80c9d7bcd12ed6c53c0a02be13f3a40
Dual Lottery Ticket Hypothesis
1 INTRODUCTION . While over-parameterized networks perform promisingly on challenging machine learning tasks Zagoruyko & Komodakis ( 2016 ) ; Arora et al . ( 2019 ) ; Zhang et al . ( 2019 ) , they require a high cost of computational and storage resources Wang et al . ( 2020a ) ; Cheng et al . ( 2017 ) ; Deng et al . ( 2020 ) . Recent pruning techniques aim to diminish the model size by discarding irrelevant weights of well-trained models based on different criteria Gale et al . ( 2019 ) ; He et al . ( 2017 ) ; Han et al . ( 2015a ; b ) . Decisive weights are preserved and finetuned for obtaining final compressed model with acceptable performance loss . Following this line , several series of research works have been done to explore effective pruning criterion for better pruning performances . For example , regularization based pruning approaches Liu et al . ( 2017 ) ; Han et al . ( 2015a ; b ) leverage a penalty term during training for network pruning . Also , many researches take advantages of Hessian information to build more proper criteria for pruning LeCun et al . ( 1990 ) ; Hassibi & Stork ( 1993 ) ; Wang et al . ( 2019a ) ; Singh & Alistarh ( 2020 ) . However , regular pruning methods still requires full pretraining with high computational and storage costs . Pruning at initialization ( PI ) attempts determining the sparse network before training and maintains the final performances . For instance , Single-shot Network Pruning ( SNIP ) Lee et al . ( 2018 ) uses a novel criterion called connection sensitivity to measure the weights importance and decide which weights should be removed . Gradient Signal Preservation ( GraSP ) Wang et al . ( 2020a ) regards the gradient flow as an importance factor and correspondingly use it to design PI criterion . Regular pruning and PI techniques both achieve promising results on sparse network training and model compression . They only focus on designating criteria to find a specific sparse network but ignore exploring the internal relationships between the dense network and its eligible subnetwork candidates , which impedes a full understanding of the sparse network training . Lottery Ticket Hypothesis ( LTH ) Frankle & Carbin ( 2018 ) hits this problem with the first shot . It claims a trainable subnetwork exists in the randomly initialized dense network and can be found by pruning a pretrained network . In other words , as long as the dense network is initialized , the good subnetwork has been implicitly decided but needs to be revealed by the pruning process . The LTH has been validated by training the subnetwork from scratch with mask obtained from corresponding iterative magnitude pruning Han et al . ( 2015b ; a ) . The subnetwork is regarded as the winning ticket among the lottery pool given by dense networks . This valuable discovery naturally describes the relationship between a random initialized dense network and the trainable subnetwork hidden in it . However , LTH only focuses on finding one sparse structure at the expense of full pretraining , which is not universal to both practical usage and investigating the relationship between dense and its subnetworks for sparse network training . In this work , we go from a complementary direction of LTH and propose a new hypothesis called Dual Lottery Ticket Hypothesis ( DLTH ) . It studies a more challenging and general case and achieves promising performances ( see Fig . 1 ) for sparse network training . DLTH is described as any random selected subnetwork of a randomly initialized dense network can be transformed into a trainable condition . In other word , any ticket in a given lottery pool can be turned into a winning ticket . In this way , we construct a closed-loop research perspective from the dual side of LTH as shown in Fig . 2 . Compared with LTH , our proposed DLTH considers a general case - studying any subnetwork instead of a specific one – with a simple training strategy proposed to validate it . The comprehensive relationship between dense and sparse networks is inquired for sparse network training . Our contributions can be summarized as follows : • We investigate a novel view of studying sparse network training . Specifically , we present a Dual Lottery Ticket Hypothesis ( DLTH ) , a dual problem of Lottery Ticket Hypothesis ( LTH ) , articulated as : Any randomly selected subnetwork of a randomly initialized dense network can be transformed into an appropriate condition with admirable trainability . • We propose a simple sparse network training strategy , Random Sparse Network Transformation ( RST ) , to validate our proposed DLTH and achieve promising performance for sparse network optimization . Concretely , we achieve the information extrusion from the weights which will be removed to enhance sparse training by introducing a regularization term . Any subnetwork will be transformed into a trainable condition in this way . • Extensive experiments are conducted based on benchmark datasets and comparisons with competitive approaches . Our method obtains promising and consistent performance which solidly validates our DLTH and demonstrates the model effectiveness . • Our DLTH considers a more general and challenging case for sparse network training compared with LTH . In this way , we expect our work inspires a novel perspective to study sparse network training in a more flexible and adjustable way . 2 RELATED WORK . 2.1 SPARSE NETWORK TRAINING . Sparse Evolutionary Training ( SET ) Mocanu et al . ( 2018 ) proposes an evolutionary strategy to randomly add weights on sparse network and achieve better training . Dynamic Sparse Reparameterization ( DSR ) Mostafa & Wang ( 2019 ) presents a novel direction to dynamically modify the parameter budget between different layers . In this way , the sparse structure can be adaptively adjusted for more effective and efficient usage . Sparse Networks from Scratch ( SNFS ) Dettmers & Zettlemoyer ( 2019 ) designates a momentum based approach as criterion to grow weights and empirically proves it benefits the practical learning performance . Deep Rewiring ( DeepR ) Bellec et al . ( 2017 ) introduces the sparsity during the training process and augments the regular SGD optimization by involving a random walk in the parameter space . It can achieve effectively training on very sparse network relying on theoretical foundations . Rigging the Lottery ( RigL ) Evci et al . ( 2020 ) enhances the sparse network training by editing the network connectivity along with the optimizing the parameter by taking advantages of both weight magnitude and gradient information . 2.2 NETWORK PRUNING . Network pruning is a relevant research topic to our work . Related approaches aim to remove unnecessary weights based on different well-designed criteria and obtain sparse network for model compression . Diversified pruning methods can be categorized from different angles . To better present the background of our work , we customize the existing pruning methods into Training-Relevant Pruning and Training-Free Pruning groups as follow . Training-Relevant Pruning . Most pruning methods require a pre-trained network Louizos et al . ( 2017 ) ; Liu et al . ( 2017 ) ; Ye et al . ( 2018 ) ; Han et al . ( 2015b ; a ) . Algorithms utilize different ranking strategies to pick redundant weights with low importance scores , and remove them to achieve pruning along with acceptable performance drop . Pioneer magnitude-based method Han et al . ( 2015b ; a ) regards weights with low values as unnecessary ones , which is straightforward but may remove important low-value weights . Hessian-based approaches measure the weight importance by computing the their removal effects on the final loss LeCun et al . ( 1990 ) ; Hassibi & Stork ( 1993 ) . Recently published technique also achieves Hessian-free pruning Wang et al . ( 2020b ) by adding regularization which is more computational friendly . On the other hand , pruning process can be also conducted during the network training instead of relying on completed pre-trained network . To name a few , a special dropout strategy is utilized in Srinivas & Babu ( 2016 ) to adjust the dropout during training and obtain a pruned network after training . A L0 norm regularization based method is proposed for network pruning Louizos et al . ( 2017 ) . Above algorithms requiring network training are seen as Training-Relevant Pruning . Training-Free Pruning . This group of research investigates how to prune randomly initialized network without any training . Pruning at initialization is one typical direction deriving sparse network by remove part of randomly initialized weights Lee et al . ( 2018 ; 2019 ) ; Wang et al . ( 2020a ) . For instance , Single-Shot Neural Network Pruning ( SNIP ) algorithm Lee et al . ( 2018 ) first proposes a learnable sparse network strategy according to the computed connection sensitivity . An orthogonal initialization method is proposed to investigate pruning problem in signal propagation view Lee et al . ( 2019 ) . Gradient Signal Preservation ( GraSP ) considers to preserve the gradient flow as an efficient criterion to achieve pruning at initialization . On the other hand , Lottery Ticket Hypothesis ( LTH ) claims that the winning ticket subnetworks exist in randomly initialized network and can be found by deploying conventional pruning algorithm . Then the selected sparse network can be efficiently trained from scratch and achieve promising performance . Based on LTH , Early-Bird ( EB ) ticket You et al . ( 2020 ) proposes an efficient way to find winning ticket . Above algorithms obtaining sparse network from random network are seen as Training-Free Pruning . 3 LOTTERY TICKET PERSPECTIVE OF SPARSE NETWORK . Lottery Ticket Hypothesis ( LTH ) Frankle & Carbin ( 2018 ) articulates the hypothesis : dense randomly initialized networks contain subnetworks , which can be trained in isolation and deliver performances comparable to the original network . These subnetworks are treated as winning tickets in the given lottery pool with good trainability . Subnetworks are discovered by iterative magnitude pruning algorithms , which requires training a full network and removes redundant weights by specific criterion . The mask of the pruned network illustrates the sparse structure of winning tickets . Problem Formulation . We start from introducing general network pruning problem . The neural network training process can be seen as a sequence of parameter updating status using stochastic gradient descent ( SGD ) Wang et al . ( 2021 ) ; Bottou ( 2010 ) : { w ( 0 ) , w ( 1 ) , w ( 2 ) , · · · , w ( k ) , · · · , w ( K ) } , ( 1 ) where w is the model parameter with superscript k as training iteration number . For a general case , the sparse network structure can be mathematically described by a binary mask m which has the same tensor shape as w. The process of obtaining m can be formulated as a function m = Fm ( w ; D ) , where D is the training data . Further , the weights of the sparse structure are modified based on different pruning strategies Hassibi & Stork ( 1993 ) ; Wang et al . ( 2020b ) , which is given by w∗ = Fw ( w ; D ) . The final pruned network can be integrated as w̃ = Fm ( w ( km ) ; D ) · Fw ( w ( kw ) ; D ) , ( 2 ) where wkm and wkw represent different parameter conditions for Fm and Fw . The conventional pruning requires that km = kw = K. The LTH needs km = K , kw = 0 , and Fw = I , where I is the identical mapping representing model directly inherits the randomly initialized weights . Against with traditional view that directly training sparse network can not fully exploit network capacity Wang et al . ( 2020b ; a ) , LTH validates there exists sparse network with better trainability ( winning ticket ) than other subnetworks ( other tickets ) . However , to uncover this property still needs first using pruning techniques for obtaining mask and the selected sparse structure must match with corresponding randomly initialized dense network - winning ticket matches with the given lottery pool . LTH provides a novel angle to understand and reveal the connections between a randomly initialized dense network and its subnetworks with admirable tranability . However , the proposed hypothesis is valid with restrict constraint and finding subnetworks still requires pruning on pre-trained model .
This paper studies the Lotter Ticket Hypothesis (LTH) and proposes a Dual Lottery Ticket Hypothesis (DLTH). DLTH describes that any ticket in a given lottery pool can be transformed into a winning ticket. The paper uses a regularization-based method for this transformation. The experiments have been conducted on CIFAR10/100 with ResNets, which indicates a consistent empirical result with DLTH.
SP:e30dbf098b6df69639cbf8827aeaaa86ff73ebdc
Dual Lottery Ticket Hypothesis
1 INTRODUCTION . While over-parameterized networks perform promisingly on challenging machine learning tasks Zagoruyko & Komodakis ( 2016 ) ; Arora et al . ( 2019 ) ; Zhang et al . ( 2019 ) , they require a high cost of computational and storage resources Wang et al . ( 2020a ) ; Cheng et al . ( 2017 ) ; Deng et al . ( 2020 ) . Recent pruning techniques aim to diminish the model size by discarding irrelevant weights of well-trained models based on different criteria Gale et al . ( 2019 ) ; He et al . ( 2017 ) ; Han et al . ( 2015a ; b ) . Decisive weights are preserved and finetuned for obtaining final compressed model with acceptable performance loss . Following this line , several series of research works have been done to explore effective pruning criterion for better pruning performances . For example , regularization based pruning approaches Liu et al . ( 2017 ) ; Han et al . ( 2015a ; b ) leverage a penalty term during training for network pruning . Also , many researches take advantages of Hessian information to build more proper criteria for pruning LeCun et al . ( 1990 ) ; Hassibi & Stork ( 1993 ) ; Wang et al . ( 2019a ) ; Singh & Alistarh ( 2020 ) . However , regular pruning methods still requires full pretraining with high computational and storage costs . Pruning at initialization ( PI ) attempts determining the sparse network before training and maintains the final performances . For instance , Single-shot Network Pruning ( SNIP ) Lee et al . ( 2018 ) uses a novel criterion called connection sensitivity to measure the weights importance and decide which weights should be removed . Gradient Signal Preservation ( GraSP ) Wang et al . ( 2020a ) regards the gradient flow as an importance factor and correspondingly use it to design PI criterion . Regular pruning and PI techniques both achieve promising results on sparse network training and model compression . They only focus on designating criteria to find a specific sparse network but ignore exploring the internal relationships between the dense network and its eligible subnetwork candidates , which impedes a full understanding of the sparse network training . Lottery Ticket Hypothesis ( LTH ) Frankle & Carbin ( 2018 ) hits this problem with the first shot . It claims a trainable subnetwork exists in the randomly initialized dense network and can be found by pruning a pretrained network . In other words , as long as the dense network is initialized , the good subnetwork has been implicitly decided but needs to be revealed by the pruning process . The LTH has been validated by training the subnetwork from scratch with mask obtained from corresponding iterative magnitude pruning Han et al . ( 2015b ; a ) . The subnetwork is regarded as the winning ticket among the lottery pool given by dense networks . This valuable discovery naturally describes the relationship between a random initialized dense network and the trainable subnetwork hidden in it . However , LTH only focuses on finding one sparse structure at the expense of full pretraining , which is not universal to both practical usage and investigating the relationship between dense and its subnetworks for sparse network training . In this work , we go from a complementary direction of LTH and propose a new hypothesis called Dual Lottery Ticket Hypothesis ( DLTH ) . It studies a more challenging and general case and achieves promising performances ( see Fig . 1 ) for sparse network training . DLTH is described as any random selected subnetwork of a randomly initialized dense network can be transformed into a trainable condition . In other word , any ticket in a given lottery pool can be turned into a winning ticket . In this way , we construct a closed-loop research perspective from the dual side of LTH as shown in Fig . 2 . Compared with LTH , our proposed DLTH considers a general case - studying any subnetwork instead of a specific one – with a simple training strategy proposed to validate it . The comprehensive relationship between dense and sparse networks is inquired for sparse network training . Our contributions can be summarized as follows : • We investigate a novel view of studying sparse network training . Specifically , we present a Dual Lottery Ticket Hypothesis ( DLTH ) , a dual problem of Lottery Ticket Hypothesis ( LTH ) , articulated as : Any randomly selected subnetwork of a randomly initialized dense network can be transformed into an appropriate condition with admirable trainability . • We propose a simple sparse network training strategy , Random Sparse Network Transformation ( RST ) , to validate our proposed DLTH and achieve promising performance for sparse network optimization . Concretely , we achieve the information extrusion from the weights which will be removed to enhance sparse training by introducing a regularization term . Any subnetwork will be transformed into a trainable condition in this way . • Extensive experiments are conducted based on benchmark datasets and comparisons with competitive approaches . Our method obtains promising and consistent performance which solidly validates our DLTH and demonstrates the model effectiveness . • Our DLTH considers a more general and challenging case for sparse network training compared with LTH . In this way , we expect our work inspires a novel perspective to study sparse network training in a more flexible and adjustable way . 2 RELATED WORK . 2.1 SPARSE NETWORK TRAINING . Sparse Evolutionary Training ( SET ) Mocanu et al . ( 2018 ) proposes an evolutionary strategy to randomly add weights on sparse network and achieve better training . Dynamic Sparse Reparameterization ( DSR ) Mostafa & Wang ( 2019 ) presents a novel direction to dynamically modify the parameter budget between different layers . In this way , the sparse structure can be adaptively adjusted for more effective and efficient usage . Sparse Networks from Scratch ( SNFS ) Dettmers & Zettlemoyer ( 2019 ) designates a momentum based approach as criterion to grow weights and empirically proves it benefits the practical learning performance . Deep Rewiring ( DeepR ) Bellec et al . ( 2017 ) introduces the sparsity during the training process and augments the regular SGD optimization by involving a random walk in the parameter space . It can achieve effectively training on very sparse network relying on theoretical foundations . Rigging the Lottery ( RigL ) Evci et al . ( 2020 ) enhances the sparse network training by editing the network connectivity along with the optimizing the parameter by taking advantages of both weight magnitude and gradient information . 2.2 NETWORK PRUNING . Network pruning is a relevant research topic to our work . Related approaches aim to remove unnecessary weights based on different well-designed criteria and obtain sparse network for model compression . Diversified pruning methods can be categorized from different angles . To better present the background of our work , we customize the existing pruning methods into Training-Relevant Pruning and Training-Free Pruning groups as follow . Training-Relevant Pruning . Most pruning methods require a pre-trained network Louizos et al . ( 2017 ) ; Liu et al . ( 2017 ) ; Ye et al . ( 2018 ) ; Han et al . ( 2015b ; a ) . Algorithms utilize different ranking strategies to pick redundant weights with low importance scores , and remove them to achieve pruning along with acceptable performance drop . Pioneer magnitude-based method Han et al . ( 2015b ; a ) regards weights with low values as unnecessary ones , which is straightforward but may remove important low-value weights . Hessian-based approaches measure the weight importance by computing the their removal effects on the final loss LeCun et al . ( 1990 ) ; Hassibi & Stork ( 1993 ) . Recently published technique also achieves Hessian-free pruning Wang et al . ( 2020b ) by adding regularization which is more computational friendly . On the other hand , pruning process can be also conducted during the network training instead of relying on completed pre-trained network . To name a few , a special dropout strategy is utilized in Srinivas & Babu ( 2016 ) to adjust the dropout during training and obtain a pruned network after training . A L0 norm regularization based method is proposed for network pruning Louizos et al . ( 2017 ) . Above algorithms requiring network training are seen as Training-Relevant Pruning . Training-Free Pruning . This group of research investigates how to prune randomly initialized network without any training . Pruning at initialization is one typical direction deriving sparse network by remove part of randomly initialized weights Lee et al . ( 2018 ; 2019 ) ; Wang et al . ( 2020a ) . For instance , Single-Shot Neural Network Pruning ( SNIP ) algorithm Lee et al . ( 2018 ) first proposes a learnable sparse network strategy according to the computed connection sensitivity . An orthogonal initialization method is proposed to investigate pruning problem in signal propagation view Lee et al . ( 2019 ) . Gradient Signal Preservation ( GraSP ) considers to preserve the gradient flow as an efficient criterion to achieve pruning at initialization . On the other hand , Lottery Ticket Hypothesis ( LTH ) claims that the winning ticket subnetworks exist in randomly initialized network and can be found by deploying conventional pruning algorithm . Then the selected sparse network can be efficiently trained from scratch and achieve promising performance . Based on LTH , Early-Bird ( EB ) ticket You et al . ( 2020 ) proposes an efficient way to find winning ticket . Above algorithms obtaining sparse network from random network are seen as Training-Free Pruning . 3 LOTTERY TICKET PERSPECTIVE OF SPARSE NETWORK . Lottery Ticket Hypothesis ( LTH ) Frankle & Carbin ( 2018 ) articulates the hypothesis : dense randomly initialized networks contain subnetworks , which can be trained in isolation and deliver performances comparable to the original network . These subnetworks are treated as winning tickets in the given lottery pool with good trainability . Subnetworks are discovered by iterative magnitude pruning algorithms , which requires training a full network and removes redundant weights by specific criterion . The mask of the pruned network illustrates the sparse structure of winning tickets . Problem Formulation . We start from introducing general network pruning problem . The neural network training process can be seen as a sequence of parameter updating status using stochastic gradient descent ( SGD ) Wang et al . ( 2021 ) ; Bottou ( 2010 ) : { w ( 0 ) , w ( 1 ) , w ( 2 ) , · · · , w ( k ) , · · · , w ( K ) } , ( 1 ) where w is the model parameter with superscript k as training iteration number . For a general case , the sparse network structure can be mathematically described by a binary mask m which has the same tensor shape as w. The process of obtaining m can be formulated as a function m = Fm ( w ; D ) , where D is the training data . Further , the weights of the sparse structure are modified based on different pruning strategies Hassibi & Stork ( 1993 ) ; Wang et al . ( 2020b ) , which is given by w∗ = Fw ( w ; D ) . The final pruned network can be integrated as w̃ = Fm ( w ( km ) ; D ) · Fw ( w ( kw ) ; D ) , ( 2 ) where wkm and wkw represent different parameter conditions for Fm and Fw . The conventional pruning requires that km = kw = K. The LTH needs km = K , kw = 0 , and Fw = I , where I is the identical mapping representing model directly inherits the randomly initialized weights . Against with traditional view that directly training sparse network can not fully exploit network capacity Wang et al . ( 2020b ; a ) , LTH validates there exists sparse network with better trainability ( winning ticket ) than other subnetworks ( other tickets ) . However , to uncover this property still needs first using pruning techniques for obtaining mask and the selected sparse structure must match with corresponding randomly initialized dense network - winning ticket matches with the given lottery pool . LTH provides a novel angle to understand and reveal the connections between a randomly initialized dense network and its subnetworks with admirable tranability . However , the proposed hypothesis is valid with restrict constraint and finding subnetworks still requires pruning on pre-trained model .
This work proposes the so called Dual Lottery Ticket Hypothesis which claims that every ticket in the ticket pool, i.e., every random sparse subnetwork in a randomly initialized dense neural network, can be transformed into a winning ticket with admirable trainability. This "transformation" proposed in the notation of Random Sparse Network Transformation (RST), in practice, comes in with the form of a squared L2 norm regularization on the masked weights, making them still involved during training while extruding the information contained in them and transferring into the unmasked ones. The empirical experiments show good empirical performance of RST compared to the vanilla LTH, pruning-at-initialization methods and LTH variants such as EB-LTH.
SP:e30dbf098b6df69639cbf8827aeaaa86ff73ebdc
Dual Lottery Ticket Hypothesis
1 INTRODUCTION . While over-parameterized networks perform promisingly on challenging machine learning tasks Zagoruyko & Komodakis ( 2016 ) ; Arora et al . ( 2019 ) ; Zhang et al . ( 2019 ) , they require a high cost of computational and storage resources Wang et al . ( 2020a ) ; Cheng et al . ( 2017 ) ; Deng et al . ( 2020 ) . Recent pruning techniques aim to diminish the model size by discarding irrelevant weights of well-trained models based on different criteria Gale et al . ( 2019 ) ; He et al . ( 2017 ) ; Han et al . ( 2015a ; b ) . Decisive weights are preserved and finetuned for obtaining final compressed model with acceptable performance loss . Following this line , several series of research works have been done to explore effective pruning criterion for better pruning performances . For example , regularization based pruning approaches Liu et al . ( 2017 ) ; Han et al . ( 2015a ; b ) leverage a penalty term during training for network pruning . Also , many researches take advantages of Hessian information to build more proper criteria for pruning LeCun et al . ( 1990 ) ; Hassibi & Stork ( 1993 ) ; Wang et al . ( 2019a ) ; Singh & Alistarh ( 2020 ) . However , regular pruning methods still requires full pretraining with high computational and storage costs . Pruning at initialization ( PI ) attempts determining the sparse network before training and maintains the final performances . For instance , Single-shot Network Pruning ( SNIP ) Lee et al . ( 2018 ) uses a novel criterion called connection sensitivity to measure the weights importance and decide which weights should be removed . Gradient Signal Preservation ( GraSP ) Wang et al . ( 2020a ) regards the gradient flow as an importance factor and correspondingly use it to design PI criterion . Regular pruning and PI techniques both achieve promising results on sparse network training and model compression . They only focus on designating criteria to find a specific sparse network but ignore exploring the internal relationships between the dense network and its eligible subnetwork candidates , which impedes a full understanding of the sparse network training . Lottery Ticket Hypothesis ( LTH ) Frankle & Carbin ( 2018 ) hits this problem with the first shot . It claims a trainable subnetwork exists in the randomly initialized dense network and can be found by pruning a pretrained network . In other words , as long as the dense network is initialized , the good subnetwork has been implicitly decided but needs to be revealed by the pruning process . The LTH has been validated by training the subnetwork from scratch with mask obtained from corresponding iterative magnitude pruning Han et al . ( 2015b ; a ) . The subnetwork is regarded as the winning ticket among the lottery pool given by dense networks . This valuable discovery naturally describes the relationship between a random initialized dense network and the trainable subnetwork hidden in it . However , LTH only focuses on finding one sparse structure at the expense of full pretraining , which is not universal to both practical usage and investigating the relationship between dense and its subnetworks for sparse network training . In this work , we go from a complementary direction of LTH and propose a new hypothesis called Dual Lottery Ticket Hypothesis ( DLTH ) . It studies a more challenging and general case and achieves promising performances ( see Fig . 1 ) for sparse network training . DLTH is described as any random selected subnetwork of a randomly initialized dense network can be transformed into a trainable condition . In other word , any ticket in a given lottery pool can be turned into a winning ticket . In this way , we construct a closed-loop research perspective from the dual side of LTH as shown in Fig . 2 . Compared with LTH , our proposed DLTH considers a general case - studying any subnetwork instead of a specific one – with a simple training strategy proposed to validate it . The comprehensive relationship between dense and sparse networks is inquired for sparse network training . Our contributions can be summarized as follows : • We investigate a novel view of studying sparse network training . Specifically , we present a Dual Lottery Ticket Hypothesis ( DLTH ) , a dual problem of Lottery Ticket Hypothesis ( LTH ) , articulated as : Any randomly selected subnetwork of a randomly initialized dense network can be transformed into an appropriate condition with admirable trainability . • We propose a simple sparse network training strategy , Random Sparse Network Transformation ( RST ) , to validate our proposed DLTH and achieve promising performance for sparse network optimization . Concretely , we achieve the information extrusion from the weights which will be removed to enhance sparse training by introducing a regularization term . Any subnetwork will be transformed into a trainable condition in this way . • Extensive experiments are conducted based on benchmark datasets and comparisons with competitive approaches . Our method obtains promising and consistent performance which solidly validates our DLTH and demonstrates the model effectiveness . • Our DLTH considers a more general and challenging case for sparse network training compared with LTH . In this way , we expect our work inspires a novel perspective to study sparse network training in a more flexible and adjustable way . 2 RELATED WORK . 2.1 SPARSE NETWORK TRAINING . Sparse Evolutionary Training ( SET ) Mocanu et al . ( 2018 ) proposes an evolutionary strategy to randomly add weights on sparse network and achieve better training . Dynamic Sparse Reparameterization ( DSR ) Mostafa & Wang ( 2019 ) presents a novel direction to dynamically modify the parameter budget between different layers . In this way , the sparse structure can be adaptively adjusted for more effective and efficient usage . Sparse Networks from Scratch ( SNFS ) Dettmers & Zettlemoyer ( 2019 ) designates a momentum based approach as criterion to grow weights and empirically proves it benefits the practical learning performance . Deep Rewiring ( DeepR ) Bellec et al . ( 2017 ) introduces the sparsity during the training process and augments the regular SGD optimization by involving a random walk in the parameter space . It can achieve effectively training on very sparse network relying on theoretical foundations . Rigging the Lottery ( RigL ) Evci et al . ( 2020 ) enhances the sparse network training by editing the network connectivity along with the optimizing the parameter by taking advantages of both weight magnitude and gradient information . 2.2 NETWORK PRUNING . Network pruning is a relevant research topic to our work . Related approaches aim to remove unnecessary weights based on different well-designed criteria and obtain sparse network for model compression . Diversified pruning methods can be categorized from different angles . To better present the background of our work , we customize the existing pruning methods into Training-Relevant Pruning and Training-Free Pruning groups as follow . Training-Relevant Pruning . Most pruning methods require a pre-trained network Louizos et al . ( 2017 ) ; Liu et al . ( 2017 ) ; Ye et al . ( 2018 ) ; Han et al . ( 2015b ; a ) . Algorithms utilize different ranking strategies to pick redundant weights with low importance scores , and remove them to achieve pruning along with acceptable performance drop . Pioneer magnitude-based method Han et al . ( 2015b ; a ) regards weights with low values as unnecessary ones , which is straightforward but may remove important low-value weights . Hessian-based approaches measure the weight importance by computing the their removal effects on the final loss LeCun et al . ( 1990 ) ; Hassibi & Stork ( 1993 ) . Recently published technique also achieves Hessian-free pruning Wang et al . ( 2020b ) by adding regularization which is more computational friendly . On the other hand , pruning process can be also conducted during the network training instead of relying on completed pre-trained network . To name a few , a special dropout strategy is utilized in Srinivas & Babu ( 2016 ) to adjust the dropout during training and obtain a pruned network after training . A L0 norm regularization based method is proposed for network pruning Louizos et al . ( 2017 ) . Above algorithms requiring network training are seen as Training-Relevant Pruning . Training-Free Pruning . This group of research investigates how to prune randomly initialized network without any training . Pruning at initialization is one typical direction deriving sparse network by remove part of randomly initialized weights Lee et al . ( 2018 ; 2019 ) ; Wang et al . ( 2020a ) . For instance , Single-Shot Neural Network Pruning ( SNIP ) algorithm Lee et al . ( 2018 ) first proposes a learnable sparse network strategy according to the computed connection sensitivity . An orthogonal initialization method is proposed to investigate pruning problem in signal propagation view Lee et al . ( 2019 ) . Gradient Signal Preservation ( GraSP ) considers to preserve the gradient flow as an efficient criterion to achieve pruning at initialization . On the other hand , Lottery Ticket Hypothesis ( LTH ) claims that the winning ticket subnetworks exist in randomly initialized network and can be found by deploying conventional pruning algorithm . Then the selected sparse network can be efficiently trained from scratch and achieve promising performance . Based on LTH , Early-Bird ( EB ) ticket You et al . ( 2020 ) proposes an efficient way to find winning ticket . Above algorithms obtaining sparse network from random network are seen as Training-Free Pruning . 3 LOTTERY TICKET PERSPECTIVE OF SPARSE NETWORK . Lottery Ticket Hypothesis ( LTH ) Frankle & Carbin ( 2018 ) articulates the hypothesis : dense randomly initialized networks contain subnetworks , which can be trained in isolation and deliver performances comparable to the original network . These subnetworks are treated as winning tickets in the given lottery pool with good trainability . Subnetworks are discovered by iterative magnitude pruning algorithms , which requires training a full network and removes redundant weights by specific criterion . The mask of the pruned network illustrates the sparse structure of winning tickets . Problem Formulation . We start from introducing general network pruning problem . The neural network training process can be seen as a sequence of parameter updating status using stochastic gradient descent ( SGD ) Wang et al . ( 2021 ) ; Bottou ( 2010 ) : { w ( 0 ) , w ( 1 ) , w ( 2 ) , · · · , w ( k ) , · · · , w ( K ) } , ( 1 ) where w is the model parameter with superscript k as training iteration number . For a general case , the sparse network structure can be mathematically described by a binary mask m which has the same tensor shape as w. The process of obtaining m can be formulated as a function m = Fm ( w ; D ) , where D is the training data . Further , the weights of the sparse structure are modified based on different pruning strategies Hassibi & Stork ( 1993 ) ; Wang et al . ( 2020b ) , which is given by w∗ = Fw ( w ; D ) . The final pruned network can be integrated as w̃ = Fm ( w ( km ) ; D ) · Fw ( w ( kw ) ; D ) , ( 2 ) where wkm and wkw represent different parameter conditions for Fm and Fw . The conventional pruning requires that km = kw = K. The LTH needs km = K , kw = 0 , and Fw = I , where I is the identical mapping representing model directly inherits the randomly initialized weights . Against with traditional view that directly training sparse network can not fully exploit network capacity Wang et al . ( 2020b ; a ) , LTH validates there exists sparse network with better trainability ( winning ticket ) than other subnetworks ( other tickets ) . However , to uncover this property still needs first using pruning techniques for obtaining mask and the selected sparse structure must match with corresponding randomly initialized dense network - winning ticket matches with the given lottery pool . LTH provides a novel angle to understand and reveal the connections between a randomly initialized dense network and its subnetworks with admirable tranability . However , the proposed hypothesis is valid with restrict constraint and finding subnetworks still requires pruning on pre-trained model .
This paper extends the Lottery Ticket Hypothesis(LTH) to a more challenging case and proposes the concept of Dual LTH: Any randomly selected subnetwork of a randomly initialized dense network can be transformed into a winning ticket. And the authors propose Random Sparse Network Transformation(RST) to accomplish the transformation process. Experiment results on CIFAR-10/00 and part of ImageNet with ResNet-18/56 demonstrate the effectiveness of the RST and validate the Dual LTH.
SP:e30dbf098b6df69639cbf8827aeaaa86ff73ebdc
Equivalence of State Equations from Different Methods in High-dimensional Regression
1 INTRODUCTION . Classical statistical methods often failed in the high-dimensional data where the number of features is larger than the number of observed samples . Studies in high dimensional data have attracted lots of attentions in past decades . A set of state equations ( SEs ) were first introduced in approximate message passing ( AMP ) algorithm in ( Donoho et al. , 2009 ) to precisely characterize the meansquare-error ( MSE ) and the phase transition phenomenon for true signal recovery in compressed sensing ( CS ) . Since then , SEs , associated to certain AMP algorithm , have played indispensable role in various high-dimensional problems . For example , ( Donoho et al. , 2011 ) investigated the phase transition phenomenon and the precise MSE of LASSO estimator ; ( Donoho & Montanari , 2016 ) studied the variance of asymptotic distribution of M-estimator ; ( Huang , 2020 ) provided a precise characterization of min-max MSE of l1 penalized robust M-estimator and the corresponding phase transition phenomenon . Though the SEs were first introduced through certain AMP type algorithms , researchers meet them in a variety of models through different methods . For example , the SEs appeared in ( El Karoui et al. , 2013 ) when they performed the leaving-one-out ( LOO ) analysis of M-estimator in high dimensions . They showed that asymptotic normality , asymptotically unbiased property also hold as in the low dimension , nevertheless the variance of asymptotic distribution of M-estimators is higher . ( Sur & Candès , 2019 ) employed the similar idea to analyze the properties of MLE in logistic regression where the SEs were used to show that ( 1 ) asymptotically unbiased property does not hold ; ( 2 ) variance of asymptotic distribution increases ; ( 3 ) likelihood ratio test is not distributed as chi-square . SEs also appeared in another line of researches where Thrompoulidies et al . performed analysis of a family of high dimensional problems through the Convex Gaussian min-max theorem ( CGMT ) . More precisely , ( Thrampoulidis et al. , 2018 ) characterized the MSE precisely for general regularized M-estimator problem in high-dimensions ; ( Salehi et al. , 2019 ) established the correlation and MSE of the resulting estimator of regularized logistic regression ; ( Deng et al. , 2019 ) showed the changing trend of MSE with the growth of features in support vector machine and logistic regression . Lastly , an insightful series of works ( Barbier et al. , 2019 ; Ricci-Tersenghi & Semerjian , 2009 ; Moore , 2014 ; Krzakala et al. , 2016 ; Coja-Oghlan et al. , 2018 ; Mézard & Parisi , 2003 ; Del Ferraro et al. , 2014 ) have utilized the SEs ( named as cavity method in statistical physics ) as a ubiquitous tool when they studied the high dimensional statistical problem through the perspective of statisti- cal physics . Importantly , this tool has exhibited as a powerful weapon in applications of a lot of fields ( Mezard & Montanari , 2009 ; Obuchi & Kabashima , 2016 ; Vuffray , 2014 ; Lesieur et al. , 2015 ; 2016 ) . Though many papers have explicitly written down the corresponding state equations , none of them have shown that these sets of state equations are compatible . To the best of our knowledge , only ( Deng et al. , 2019 ) mentioned there is another set of state equation but without any comparison . Although SEs were proved to be important in high dimensional problems , it is awkward that for one specific problem , the resulting SEs from AMP , CGMT and LOO are different . To be more clear , let us take a look at logistic regression . The SEs derived from CGMT ( 20 ) in ( Deng et al. , 2019 ) are obviously different from the SEs derived from LOO ( 19 ) in ( Sur & Candès , 2019 ) . This is annoying , since the asymptotic performance for a specific high-dimensional problem should be unique no matter which method was used . Therefore , we are interested in the following questions : Are SEs derived from different methods all equivalent in some sense ? If so , from what viewpoint these methods are equivalent and are there more inner equivalence ? Among them , as the most direct , accessible , basic tool , equivalence of SEs is the basis of equivalence of methods and more inner equivalence . Our contributions . We successfully show that for various high dimensional problem , the different sets of SEs derived through different methods are actually equivalent to each other . More precisely , we construct the equivalence between different sets of SEs through explicit parameter transforms for LASSO , M-estimator and logistic regression . These transformations are inspired by the statistical meanings of certain quantities appeared in the SEs . Moreover , we also provide a heuristic explanation on the relation between the different methods : AMP , CGMT and LOO . To the best of our knowledge , this is the first work to clearly clarify the equivalence among SEs derived from different methods and try to establish the equivalence of different methods . Outlines . In section 2 , we show that the SEs for M-estimator from AMP , LOO and CGMT are equivalent to each other . In section 3.1 , we show the equivalence of SEs derived from AMP and CGMT for another example and explain the essential reasons behind this equivalence . In Section 3.2 , we illustrate the similar work regarding the equivalence between CGMT and LOO . Section 4 provides some discussions and future directions . Most proofs are deferred to the appendix . Notations . Let N ( 0 , Id ) , N ( 0 , 1 ) denote the d-dimensional standard Gaussian distribution and 1- dimensional standard Gaussian distribution respectively . For a vector x , we denote ∥x∥p as the lp norm of x . For an integer n we denote [ n ] as { 1 , · · · , n } . We abbreviate independent and identically distributed to i.i.d .. For a function f : R 7→ R , variable x ∈ R and t > 0 , we denote the Moreau envelope associated with f as Mf ( x ; t ) : = min z∈R f ( z ) + 1 2t ( x− z ) 2 ( 1 ) and the proximal operator , which is the solution of this minimization as Proxf ( x ; t ) : = argmin z∈R f ( z ) + 1 2t ( x− z ) 2 . ( 2 ) For multi-dimensional case x = ( x1 , · · · , xd ) T ∈ Rd , Moreau envelope and proximal operator are applied element-wisely : Mf ( x ; t ) : = ( Mf ( xi ; t ) ) ∈ Rd and Proxf ( x ; t ) : = ( Proxf ( xi ; t ) ) ∈ Rd . 2 AN ILLUSTRATIVE EXAMPLE . Suppose that xi i.i.d.∼ N ( 0 , 1dId ) and yi ∈ R satisfying that yi = x T i β ∗ + ϵi , for i ∈ [ n ] ( 3 ) where ϵi are drawn i.i.d . from distribution Pϵ with mean 0 and variance σ2∗ . We assume that the entries β∗i of β ∗ are independently distributed as Π which has finite second moment r2∗ = Eβ∼Πβ2 . Let ρ be a non-negative convex function . We are interested in the the Mean-squared-error ( MSE ) performance limn , p→∞ 1n∥β − β ∗∥2 of the M-estimator : β̂ = argmin β n∑ i=1 ρ ( yi − xTi β ) ( 4 ) when both n and d go to infinity satisfying that limn , d→∞ dn = κ∗ ∈ ( 0 , ∞ ) . This problem first studied by ( El Karoui et al. , 2013 ) where they showed that the MSE of β̂ can be characterized by a set of SEs . More precisely , they proved the following proposition . Proposition 2.1 . ( El Karoui et al. , 2013 ) Given ratio κ∗ < 1 . Consider the following system of nonlinear equations ( SEs ) regarding ( τ1 , γ1 ) : 1− κ∗ = E [ ∂Proxρ ∂x ( W1 + τ1Z1 ; λ1 ) ] κ∗τ 2 1 : = E [ W1 + τ1Z1 − Proxρ ( W1 + τ1Z1 ; λ1 ) ] 2 ( 5 ) where W1 ∼ Pϵ , Z1 ∼ N ( 0 , 1 ) is independent of W1 . If this system of nonlinear equations possesses a unique solution ( τ̄1 , λ̄1 ) , then the τ̄1 is exactly the MSE of β̂ appeared in ( 4 ) . The M -estimator was also studied by ( Donoho & Montanari , 2016 ) where they proved the following proposition . Proposition 2.2 . ( Donoho & Montanari , 2016 ) Given ratio κ∗ < 1 . Consider the following system of nonlinear equations ( SEs ) regarding ( τ2 , γ2 ) : τ22 = 1 κ∗ λ22E [ ∂Mρ ∂x ( W2 + τ2Z2 ; λ2 ) ] 2 κ∗ = λ2E [ ∂2Mρ ∂x2 ( W2 + τ2Z2 ; λ2 ) ] ( 6 ) where W2 ∼ Pϵ , Z2 ∼ N ( 0 , 1 ) is independent of W2 . If this system of nonlinear equations possesses a unique solution ( τ̄2 , λ̄2 ) , then the τ̄2 is exactly the MSE of β̂ appeared in ( 4 ) . Moreover , inspired by the work ( Thrampoulidis et al. , 2014 ) , we employ the CGMT techniques to study the M -estimator and show that the asymptotic MSE can be characterized by the the following SEs . To avoid unnecessary digression , we defer the detailed proof to the appendix A . Proposition 2.3 . Given ratio κ∗ < 1 . Consider the following system of nonlinear equations ( SEs ) regarding ( τ3 , α , µ ) : 0 = α 2 − τ3 √ κ∗ − α µ2 E [ ∂Mρ ∂t ( W3 + τ3Z3 ; α/µ ) ] 0 =− µ √ κ∗ + E [ Z3 ∂Mρ ∂x ( W3 + τ3Z3 ; α/µ ) ] 0 = µ 2 + 1 µ E [ ∂Mρ ∂t ( W3 + τ3Z3 ; α/µ ) ] ( 7 ) where W3 ∼ Pϵ , Z3 ∼ N ( 0 , 1 ) is independent of W3 . If this system of nonlinear equations possesses a unique solution ( τ̄3 , ᾱ , µ̄ ) , then the τ̄3 is exactly the MSE of β̂ appeared in ( 4 ) . On the one hand , these three sets of SEs are different at the first glance . On the other hand , since they are all supposed to describe the MSE of the M -estimators in high dimension , there shall be some relation between these three sets of equations . A striking fact is that we can actually show that all these three set of SEs are equivalent to each other . More precisely , we have the following theorem . Theorem 1 . For M-estimator ( 4 ) , the SEs derived from AMP ( 6 ) , LOO ( 5 ) and CGMT ( 7 ) are equivalent . Specifically , ( 6 ) can be converted into the same form as ( 5 ) after the following parameter transformations : τ1 = τ2 , λ1 = λ2 . ( 8 ) ( 6 ) can be converted into the same form as ( 7 ) after the following parameter transformations : τ1 = τ3 , λ1 = α µ . ( 9 ) The equivalence of these three sets of SEs seems straightforward , however , it suggests us that all the three procedures : AMP , CGMT and LOO might be deeply entangled in some sense . This will be investigated in this manuscript . The proof of this theorem is deferred to the appendix B .
This paper provides derivations of equivalences between what they refer to as "state evolution" (SE) equations derived from different perspectives: convex Gaussian min-max (CGMT), approximate message-passing (AMP) and leave-one-out (LOO) approaches. They focus on M-estimators for high-dimensional linear regression. The SE equations describe the mean-square error reconstruction of the M-estimator.
SP:0055dca69c153ed21b420741c479a2ef00be2ef6
Equivalence of State Equations from Different Methods in High-dimensional Regression
1 INTRODUCTION . Classical statistical methods often failed in the high-dimensional data where the number of features is larger than the number of observed samples . Studies in high dimensional data have attracted lots of attentions in past decades . A set of state equations ( SEs ) were first introduced in approximate message passing ( AMP ) algorithm in ( Donoho et al. , 2009 ) to precisely characterize the meansquare-error ( MSE ) and the phase transition phenomenon for true signal recovery in compressed sensing ( CS ) . Since then , SEs , associated to certain AMP algorithm , have played indispensable role in various high-dimensional problems . For example , ( Donoho et al. , 2011 ) investigated the phase transition phenomenon and the precise MSE of LASSO estimator ; ( Donoho & Montanari , 2016 ) studied the variance of asymptotic distribution of M-estimator ; ( Huang , 2020 ) provided a precise characterization of min-max MSE of l1 penalized robust M-estimator and the corresponding phase transition phenomenon . Though the SEs were first introduced through certain AMP type algorithms , researchers meet them in a variety of models through different methods . For example , the SEs appeared in ( El Karoui et al. , 2013 ) when they performed the leaving-one-out ( LOO ) analysis of M-estimator in high dimensions . They showed that asymptotic normality , asymptotically unbiased property also hold as in the low dimension , nevertheless the variance of asymptotic distribution of M-estimators is higher . ( Sur & Candès , 2019 ) employed the similar idea to analyze the properties of MLE in logistic regression where the SEs were used to show that ( 1 ) asymptotically unbiased property does not hold ; ( 2 ) variance of asymptotic distribution increases ; ( 3 ) likelihood ratio test is not distributed as chi-square . SEs also appeared in another line of researches where Thrompoulidies et al . performed analysis of a family of high dimensional problems through the Convex Gaussian min-max theorem ( CGMT ) . More precisely , ( Thrampoulidis et al. , 2018 ) characterized the MSE precisely for general regularized M-estimator problem in high-dimensions ; ( Salehi et al. , 2019 ) established the correlation and MSE of the resulting estimator of regularized logistic regression ; ( Deng et al. , 2019 ) showed the changing trend of MSE with the growth of features in support vector machine and logistic regression . Lastly , an insightful series of works ( Barbier et al. , 2019 ; Ricci-Tersenghi & Semerjian , 2009 ; Moore , 2014 ; Krzakala et al. , 2016 ; Coja-Oghlan et al. , 2018 ; Mézard & Parisi , 2003 ; Del Ferraro et al. , 2014 ) have utilized the SEs ( named as cavity method in statistical physics ) as a ubiquitous tool when they studied the high dimensional statistical problem through the perspective of statisti- cal physics . Importantly , this tool has exhibited as a powerful weapon in applications of a lot of fields ( Mezard & Montanari , 2009 ; Obuchi & Kabashima , 2016 ; Vuffray , 2014 ; Lesieur et al. , 2015 ; 2016 ) . Though many papers have explicitly written down the corresponding state equations , none of them have shown that these sets of state equations are compatible . To the best of our knowledge , only ( Deng et al. , 2019 ) mentioned there is another set of state equation but without any comparison . Although SEs were proved to be important in high dimensional problems , it is awkward that for one specific problem , the resulting SEs from AMP , CGMT and LOO are different . To be more clear , let us take a look at logistic regression . The SEs derived from CGMT ( 20 ) in ( Deng et al. , 2019 ) are obviously different from the SEs derived from LOO ( 19 ) in ( Sur & Candès , 2019 ) . This is annoying , since the asymptotic performance for a specific high-dimensional problem should be unique no matter which method was used . Therefore , we are interested in the following questions : Are SEs derived from different methods all equivalent in some sense ? If so , from what viewpoint these methods are equivalent and are there more inner equivalence ? Among them , as the most direct , accessible , basic tool , equivalence of SEs is the basis of equivalence of methods and more inner equivalence . Our contributions . We successfully show that for various high dimensional problem , the different sets of SEs derived through different methods are actually equivalent to each other . More precisely , we construct the equivalence between different sets of SEs through explicit parameter transforms for LASSO , M-estimator and logistic regression . These transformations are inspired by the statistical meanings of certain quantities appeared in the SEs . Moreover , we also provide a heuristic explanation on the relation between the different methods : AMP , CGMT and LOO . To the best of our knowledge , this is the first work to clearly clarify the equivalence among SEs derived from different methods and try to establish the equivalence of different methods . Outlines . In section 2 , we show that the SEs for M-estimator from AMP , LOO and CGMT are equivalent to each other . In section 3.1 , we show the equivalence of SEs derived from AMP and CGMT for another example and explain the essential reasons behind this equivalence . In Section 3.2 , we illustrate the similar work regarding the equivalence between CGMT and LOO . Section 4 provides some discussions and future directions . Most proofs are deferred to the appendix . Notations . Let N ( 0 , Id ) , N ( 0 , 1 ) denote the d-dimensional standard Gaussian distribution and 1- dimensional standard Gaussian distribution respectively . For a vector x , we denote ∥x∥p as the lp norm of x . For an integer n we denote [ n ] as { 1 , · · · , n } . We abbreviate independent and identically distributed to i.i.d .. For a function f : R 7→ R , variable x ∈ R and t > 0 , we denote the Moreau envelope associated with f as Mf ( x ; t ) : = min z∈R f ( z ) + 1 2t ( x− z ) 2 ( 1 ) and the proximal operator , which is the solution of this minimization as Proxf ( x ; t ) : = argmin z∈R f ( z ) + 1 2t ( x− z ) 2 . ( 2 ) For multi-dimensional case x = ( x1 , · · · , xd ) T ∈ Rd , Moreau envelope and proximal operator are applied element-wisely : Mf ( x ; t ) : = ( Mf ( xi ; t ) ) ∈ Rd and Proxf ( x ; t ) : = ( Proxf ( xi ; t ) ) ∈ Rd . 2 AN ILLUSTRATIVE EXAMPLE . Suppose that xi i.i.d.∼ N ( 0 , 1dId ) and yi ∈ R satisfying that yi = x T i β ∗ + ϵi , for i ∈ [ n ] ( 3 ) where ϵi are drawn i.i.d . from distribution Pϵ with mean 0 and variance σ2∗ . We assume that the entries β∗i of β ∗ are independently distributed as Π which has finite second moment r2∗ = Eβ∼Πβ2 . Let ρ be a non-negative convex function . We are interested in the the Mean-squared-error ( MSE ) performance limn , p→∞ 1n∥β − β ∗∥2 of the M-estimator : β̂ = argmin β n∑ i=1 ρ ( yi − xTi β ) ( 4 ) when both n and d go to infinity satisfying that limn , d→∞ dn = κ∗ ∈ ( 0 , ∞ ) . This problem first studied by ( El Karoui et al. , 2013 ) where they showed that the MSE of β̂ can be characterized by a set of SEs . More precisely , they proved the following proposition . Proposition 2.1 . ( El Karoui et al. , 2013 ) Given ratio κ∗ < 1 . Consider the following system of nonlinear equations ( SEs ) regarding ( τ1 , γ1 ) : 1− κ∗ = E [ ∂Proxρ ∂x ( W1 + τ1Z1 ; λ1 ) ] κ∗τ 2 1 : = E [ W1 + τ1Z1 − Proxρ ( W1 + τ1Z1 ; λ1 ) ] 2 ( 5 ) where W1 ∼ Pϵ , Z1 ∼ N ( 0 , 1 ) is independent of W1 . If this system of nonlinear equations possesses a unique solution ( τ̄1 , λ̄1 ) , then the τ̄1 is exactly the MSE of β̂ appeared in ( 4 ) . The M -estimator was also studied by ( Donoho & Montanari , 2016 ) where they proved the following proposition . Proposition 2.2 . ( Donoho & Montanari , 2016 ) Given ratio κ∗ < 1 . Consider the following system of nonlinear equations ( SEs ) regarding ( τ2 , γ2 ) : τ22 = 1 κ∗ λ22E [ ∂Mρ ∂x ( W2 + τ2Z2 ; λ2 ) ] 2 κ∗ = λ2E [ ∂2Mρ ∂x2 ( W2 + τ2Z2 ; λ2 ) ] ( 6 ) where W2 ∼ Pϵ , Z2 ∼ N ( 0 , 1 ) is independent of W2 . If this system of nonlinear equations possesses a unique solution ( τ̄2 , λ̄2 ) , then the τ̄2 is exactly the MSE of β̂ appeared in ( 4 ) . Moreover , inspired by the work ( Thrampoulidis et al. , 2014 ) , we employ the CGMT techniques to study the M -estimator and show that the asymptotic MSE can be characterized by the the following SEs . To avoid unnecessary digression , we defer the detailed proof to the appendix A . Proposition 2.3 . Given ratio κ∗ < 1 . Consider the following system of nonlinear equations ( SEs ) regarding ( τ3 , α , µ ) : 0 = α 2 − τ3 √ κ∗ − α µ2 E [ ∂Mρ ∂t ( W3 + τ3Z3 ; α/µ ) ] 0 =− µ √ κ∗ + E [ Z3 ∂Mρ ∂x ( W3 + τ3Z3 ; α/µ ) ] 0 = µ 2 + 1 µ E [ ∂Mρ ∂t ( W3 + τ3Z3 ; α/µ ) ] ( 7 ) where W3 ∼ Pϵ , Z3 ∼ N ( 0 , 1 ) is independent of W3 . If this system of nonlinear equations possesses a unique solution ( τ̄3 , ᾱ , µ̄ ) , then the τ̄3 is exactly the MSE of β̂ appeared in ( 4 ) . On the one hand , these three sets of SEs are different at the first glance . On the other hand , since they are all supposed to describe the MSE of the M -estimators in high dimension , there shall be some relation between these three sets of equations . A striking fact is that we can actually show that all these three set of SEs are equivalent to each other . More precisely , we have the following theorem . Theorem 1 . For M-estimator ( 4 ) , the SEs derived from AMP ( 6 ) , LOO ( 5 ) and CGMT ( 7 ) are equivalent . Specifically , ( 6 ) can be converted into the same form as ( 5 ) after the following parameter transformations : τ1 = τ2 , λ1 = λ2 . ( 8 ) ( 6 ) can be converted into the same form as ( 7 ) after the following parameter transformations : τ1 = τ3 , λ1 = α µ . ( 9 ) The equivalence of these three sets of SEs seems straightforward , however , it suggests us that all the three procedures : AMP , CGMT and LOO might be deeply entangled in some sense . This will be investigated in this manuscript . The proof of this theorem is deferred to the appendix B .
This paper considers the state evolution equations obtained via different methods (AMP, LOO and CGMT), and it shows that their fixed points are the same for some high-dimensional inference problems (M-estimation, LASSO, and logistic regression). Most of these state evolutions were obtained in recent work (which is properly cited here). An exception is Proposition 3.2, which gives the state evolution for CGMT in the case of LASSO. However, the proof of this result closely follows the existing literature. Consequently, the main novelty of this contribution is in showing that the fixed points (when unique) are the same for different methods.
SP:0055dca69c153ed21b420741c479a2ef00be2ef6
Equivalence of State Equations from Different Methods in High-dimensional Regression
1 INTRODUCTION . Classical statistical methods often failed in the high-dimensional data where the number of features is larger than the number of observed samples . Studies in high dimensional data have attracted lots of attentions in past decades . A set of state equations ( SEs ) were first introduced in approximate message passing ( AMP ) algorithm in ( Donoho et al. , 2009 ) to precisely characterize the meansquare-error ( MSE ) and the phase transition phenomenon for true signal recovery in compressed sensing ( CS ) . Since then , SEs , associated to certain AMP algorithm , have played indispensable role in various high-dimensional problems . For example , ( Donoho et al. , 2011 ) investigated the phase transition phenomenon and the precise MSE of LASSO estimator ; ( Donoho & Montanari , 2016 ) studied the variance of asymptotic distribution of M-estimator ; ( Huang , 2020 ) provided a precise characterization of min-max MSE of l1 penalized robust M-estimator and the corresponding phase transition phenomenon . Though the SEs were first introduced through certain AMP type algorithms , researchers meet them in a variety of models through different methods . For example , the SEs appeared in ( El Karoui et al. , 2013 ) when they performed the leaving-one-out ( LOO ) analysis of M-estimator in high dimensions . They showed that asymptotic normality , asymptotically unbiased property also hold as in the low dimension , nevertheless the variance of asymptotic distribution of M-estimators is higher . ( Sur & Candès , 2019 ) employed the similar idea to analyze the properties of MLE in logistic regression where the SEs were used to show that ( 1 ) asymptotically unbiased property does not hold ; ( 2 ) variance of asymptotic distribution increases ; ( 3 ) likelihood ratio test is not distributed as chi-square . SEs also appeared in another line of researches where Thrompoulidies et al . performed analysis of a family of high dimensional problems through the Convex Gaussian min-max theorem ( CGMT ) . More precisely , ( Thrampoulidis et al. , 2018 ) characterized the MSE precisely for general regularized M-estimator problem in high-dimensions ; ( Salehi et al. , 2019 ) established the correlation and MSE of the resulting estimator of regularized logistic regression ; ( Deng et al. , 2019 ) showed the changing trend of MSE with the growth of features in support vector machine and logistic regression . Lastly , an insightful series of works ( Barbier et al. , 2019 ; Ricci-Tersenghi & Semerjian , 2009 ; Moore , 2014 ; Krzakala et al. , 2016 ; Coja-Oghlan et al. , 2018 ; Mézard & Parisi , 2003 ; Del Ferraro et al. , 2014 ) have utilized the SEs ( named as cavity method in statistical physics ) as a ubiquitous tool when they studied the high dimensional statistical problem through the perspective of statisti- cal physics . Importantly , this tool has exhibited as a powerful weapon in applications of a lot of fields ( Mezard & Montanari , 2009 ; Obuchi & Kabashima , 2016 ; Vuffray , 2014 ; Lesieur et al. , 2015 ; 2016 ) . Though many papers have explicitly written down the corresponding state equations , none of them have shown that these sets of state equations are compatible . To the best of our knowledge , only ( Deng et al. , 2019 ) mentioned there is another set of state equation but without any comparison . Although SEs were proved to be important in high dimensional problems , it is awkward that for one specific problem , the resulting SEs from AMP , CGMT and LOO are different . To be more clear , let us take a look at logistic regression . The SEs derived from CGMT ( 20 ) in ( Deng et al. , 2019 ) are obviously different from the SEs derived from LOO ( 19 ) in ( Sur & Candès , 2019 ) . This is annoying , since the asymptotic performance for a specific high-dimensional problem should be unique no matter which method was used . Therefore , we are interested in the following questions : Are SEs derived from different methods all equivalent in some sense ? If so , from what viewpoint these methods are equivalent and are there more inner equivalence ? Among them , as the most direct , accessible , basic tool , equivalence of SEs is the basis of equivalence of methods and more inner equivalence . Our contributions . We successfully show that for various high dimensional problem , the different sets of SEs derived through different methods are actually equivalent to each other . More precisely , we construct the equivalence between different sets of SEs through explicit parameter transforms for LASSO , M-estimator and logistic regression . These transformations are inspired by the statistical meanings of certain quantities appeared in the SEs . Moreover , we also provide a heuristic explanation on the relation between the different methods : AMP , CGMT and LOO . To the best of our knowledge , this is the first work to clearly clarify the equivalence among SEs derived from different methods and try to establish the equivalence of different methods . Outlines . In section 2 , we show that the SEs for M-estimator from AMP , LOO and CGMT are equivalent to each other . In section 3.1 , we show the equivalence of SEs derived from AMP and CGMT for another example and explain the essential reasons behind this equivalence . In Section 3.2 , we illustrate the similar work regarding the equivalence between CGMT and LOO . Section 4 provides some discussions and future directions . Most proofs are deferred to the appendix . Notations . Let N ( 0 , Id ) , N ( 0 , 1 ) denote the d-dimensional standard Gaussian distribution and 1- dimensional standard Gaussian distribution respectively . For a vector x , we denote ∥x∥p as the lp norm of x . For an integer n we denote [ n ] as { 1 , · · · , n } . We abbreviate independent and identically distributed to i.i.d .. For a function f : R 7→ R , variable x ∈ R and t > 0 , we denote the Moreau envelope associated with f as Mf ( x ; t ) : = min z∈R f ( z ) + 1 2t ( x− z ) 2 ( 1 ) and the proximal operator , which is the solution of this minimization as Proxf ( x ; t ) : = argmin z∈R f ( z ) + 1 2t ( x− z ) 2 . ( 2 ) For multi-dimensional case x = ( x1 , · · · , xd ) T ∈ Rd , Moreau envelope and proximal operator are applied element-wisely : Mf ( x ; t ) : = ( Mf ( xi ; t ) ) ∈ Rd and Proxf ( x ; t ) : = ( Proxf ( xi ; t ) ) ∈ Rd . 2 AN ILLUSTRATIVE EXAMPLE . Suppose that xi i.i.d.∼ N ( 0 , 1dId ) and yi ∈ R satisfying that yi = x T i β ∗ + ϵi , for i ∈ [ n ] ( 3 ) where ϵi are drawn i.i.d . from distribution Pϵ with mean 0 and variance σ2∗ . We assume that the entries β∗i of β ∗ are independently distributed as Π which has finite second moment r2∗ = Eβ∼Πβ2 . Let ρ be a non-negative convex function . We are interested in the the Mean-squared-error ( MSE ) performance limn , p→∞ 1n∥β − β ∗∥2 of the M-estimator : β̂ = argmin β n∑ i=1 ρ ( yi − xTi β ) ( 4 ) when both n and d go to infinity satisfying that limn , d→∞ dn = κ∗ ∈ ( 0 , ∞ ) . This problem first studied by ( El Karoui et al. , 2013 ) where they showed that the MSE of β̂ can be characterized by a set of SEs . More precisely , they proved the following proposition . Proposition 2.1 . ( El Karoui et al. , 2013 ) Given ratio κ∗ < 1 . Consider the following system of nonlinear equations ( SEs ) regarding ( τ1 , γ1 ) : 1− κ∗ = E [ ∂Proxρ ∂x ( W1 + τ1Z1 ; λ1 ) ] κ∗τ 2 1 : = E [ W1 + τ1Z1 − Proxρ ( W1 + τ1Z1 ; λ1 ) ] 2 ( 5 ) where W1 ∼ Pϵ , Z1 ∼ N ( 0 , 1 ) is independent of W1 . If this system of nonlinear equations possesses a unique solution ( τ̄1 , λ̄1 ) , then the τ̄1 is exactly the MSE of β̂ appeared in ( 4 ) . The M -estimator was also studied by ( Donoho & Montanari , 2016 ) where they proved the following proposition . Proposition 2.2 . ( Donoho & Montanari , 2016 ) Given ratio κ∗ < 1 . Consider the following system of nonlinear equations ( SEs ) regarding ( τ2 , γ2 ) : τ22 = 1 κ∗ λ22E [ ∂Mρ ∂x ( W2 + τ2Z2 ; λ2 ) ] 2 κ∗ = λ2E [ ∂2Mρ ∂x2 ( W2 + τ2Z2 ; λ2 ) ] ( 6 ) where W2 ∼ Pϵ , Z2 ∼ N ( 0 , 1 ) is independent of W2 . If this system of nonlinear equations possesses a unique solution ( τ̄2 , λ̄2 ) , then the τ̄2 is exactly the MSE of β̂ appeared in ( 4 ) . Moreover , inspired by the work ( Thrampoulidis et al. , 2014 ) , we employ the CGMT techniques to study the M -estimator and show that the asymptotic MSE can be characterized by the the following SEs . To avoid unnecessary digression , we defer the detailed proof to the appendix A . Proposition 2.3 . Given ratio κ∗ < 1 . Consider the following system of nonlinear equations ( SEs ) regarding ( τ3 , α , µ ) : 0 = α 2 − τ3 √ κ∗ − α µ2 E [ ∂Mρ ∂t ( W3 + τ3Z3 ; α/µ ) ] 0 =− µ √ κ∗ + E [ Z3 ∂Mρ ∂x ( W3 + τ3Z3 ; α/µ ) ] 0 = µ 2 + 1 µ E [ ∂Mρ ∂t ( W3 + τ3Z3 ; α/µ ) ] ( 7 ) where W3 ∼ Pϵ , Z3 ∼ N ( 0 , 1 ) is independent of W3 . If this system of nonlinear equations possesses a unique solution ( τ̄3 , ᾱ , µ̄ ) , then the τ̄3 is exactly the MSE of β̂ appeared in ( 4 ) . On the one hand , these three sets of SEs are different at the first glance . On the other hand , since they are all supposed to describe the MSE of the M -estimators in high dimension , there shall be some relation between these three sets of equations . A striking fact is that we can actually show that all these three set of SEs are equivalent to each other . More precisely , we have the following theorem . Theorem 1 . For M-estimator ( 4 ) , the SEs derived from AMP ( 6 ) , LOO ( 5 ) and CGMT ( 7 ) are equivalent . Specifically , ( 6 ) can be converted into the same form as ( 5 ) after the following parameter transformations : τ1 = τ2 , λ1 = λ2 . ( 8 ) ( 6 ) can be converted into the same form as ( 7 ) after the following parameter transformations : τ1 = τ3 , λ1 = α µ . ( 9 ) The equivalence of these three sets of SEs seems straightforward , however , it suggests us that all the three procedures : AMP , CGMT and LOO might be deeply entangled in some sense . This will be investigated in this manuscript . The proof of this theorem is deferred to the appendix B .
This paper compares the so-called "State Evolution" equations from 3 different derivations for the MSE of high dimensional M-estimators in the proportional asymptotic regime (number of samples and features go to infinity at a fixed rate). There are currently 3 well-known frameworks for analysis in this regime: 1. Approximate Message Passing (AMP) 2. Convex Gaussian Min-Max Theorem (CGMT) 3. Leave One Out (LOO) The paper shows that there lies an equivalence between the results derived by the 3 methods via a parameter transformation. Two important special cases of LASSO and Binary Logistic Regression are considered and the results are clearly stated.
SP:0055dca69c153ed21b420741c479a2ef00be2ef6
Fast Generic Interaction Detection for Model Interpretability and Compression
1 INTRODUCTION . Explainable machine learning is an active research field that focuses on providing interpretable models , transparent explanations , and confident decisions to practical AI systems . Investigating feature interaction is vital to model interpretability . Interaction detection should be able to reveal which subset of features influence the output jointly , and what the corresponding nonlinear transformation is . We aim to find the underlying interactions from data , such that we can interpret the model properly . To go one step further , we hope that new models can be built with the aid of the detected interaction knowledge economically to avoid heavy parameterization . In this paper , we first restrict ourselves to interaction detection . A novel method is derived directly from the most acknowledged definition of feature interaction ( Friedman et al. , 2008 ) . We further apply the obtained interaction knowledge to design a transparent and refined neural network ( NN ) . This approach fits well into the data science life cycle ( Yu & Kumbier , 2019 ) , which was applied , for instance in Tsang et al . ( 2020a ) , successfully for interpretable recommender system design . The main contributions of this paper include : 1 ) a fast and principled interaction detection method , 2 ) a lightweight and interpretable neural network model that can surpass its Teacher , 3 ) thorough theoretical analysis and performance evaluations with real datasets . More details are given below . 1 . We propose a generic interaction detection method based on a global statistical metric , namely the expected Hessian , Hij : = Ex [ ∂2F ( x ) ∂xi∂xj ] . Notably , our method is model-agnostic and applicable to any pre-trained learning model , F ( x ) , being for instance , a deep neural network model or a tree model . It is also flexible to use for multi-way interaction detection . 2 . To speed up the detection process , we evaluate the expected Hessian via adaptive sampling using the Upper Confidence Bound ( UCB ) algorithm ( Lai & Robbins , 1985 ) , which can significantly reduce the computational complexity . Besides , thorough analysis of the proposed interaction detection method are conducted . 3 . Using the detected interaction pairs , we further design a compressed but interpretable Student model which can surpass its Teacher by 26 % in terms of data fitting performance averaged over various datasets . The compressed model reduces its size over 100 times compared to the baseline fully-connected , over-parameterized neural network ( OverparaFC ) . 4 . We demonstrate the linkages between our compressed model and the classic alternating conditional expectation ( ACE ) model ( Breiman & Friedman , 1985 ) . 5 . We conduct large-scale performance evaluations and further explain the obtained model interpretability with some real datasets . The remainder of this paper is organized as follows . Section 2 introduces all related works . Our proposed interaction detection method is introduced in Section 3 . By exploiting the detection outcome , a new variant of lightweight and interpretable deep learning model is introduced in Section 4 . Experimental results are given in Section 5 . Finally , we conclude the paper in Section 6 . 2 RELATED WORKS . Interaction Detection : Early works adopt pure statistics for detecting feature interactions , and representatives include ANOVA and GUIDE ( Wonnacott & Wonnacott , 1990 ; Fisher , 1992 ; Loh , 2002 ) . These works have motivated a plethora of new methods with the aim to enhance the detection accuracy and/or efficiency . The first class of methods centered around the GA2M and tree models , see for instance Lou et al . ( 2013 ) ; Sorokina et al . ( 2008 ) ; Friedman et al . ( 2008 ) ; Lundberg et al . ( 2020 ) . The second class of methods were built on the so-called factorization machines ( Rendle , 2010 ) as well as its new variants ( Xiao et al. , 2017 ; Song et al. , 2019 ) with attention mechanism . The third class exploits the most recent advances in deep learning , including the Neural Interaction Detection ( NID ) and some new variants ( Tsang et al. , 2018a ; b ; Cui et al. , 2019 ) : Persistence Interaction Detection ( PID ) ( Liu et al. , 2020 ) , Integrated Hessians ( IH ) ( Janizek et al. , 2020 ) , Shapley interaction ( Zhang et al. , 2020 ; Sundararajan et al. , 2020 ) , etc . Although we have witnessed well improved interaction detection performance for many datasets over the decades , the above methods still lead to inconsistent detection results for some other datasets . The reasons are twofold . Firstly , the interaction strength is empirically defined , for instance , NID method computes the interaction strength via summarizing the neural network weights . Secondly , a specific deep learning model is required , for instance , an ` 1-regularized ReLU network is required by the latest NID and PID methods to maintain high accuracy . In contrast , our proposed method is derived directly from the definition of feature interaction ( Friedman et al. , 2008 ) and moreover is not confined to any specific learning model . Model Interpretability : There are two categories of approaches to address model interpretability , namely the transparency-based and post-hoc approaches ( Došilović et al. , 2018 ) . Transparency-based approaches require the model itself to be simple and interpretable , like linear models , decision trees , etc . One can directly read off the interpretations from their coefficients or decision rules . But often , they are less accurate due to limited representation power . In contrast , post-hoc approaches extract useful information from a pre-trained model , which is often complex and hard to interpret . Well-known methods such as LIME ( Ribeiro et al. , 2016 ) and SHAP ( Lundberg & Lee , 2017 ) fall in this category , but they did not take feature interaction into account . Recently proposed symbolic metamodel ( Alaa & van der Schaar , 2019 ) captures nonlinear interactions by approximating the black-box model with explicit symbolic expressions . There are also some other post-hoc approaches based on sensitivity analysis ( Cortez & Embrechts , 2013 ) , which return a quantification of feature importance νi = E [ ( ∂F ( x ) ∂xi ) 2 ] ( Kucherenko et al. , 2009 ) and interactions νij = E [ |∂ 2F ( x ) ∂xi∂xj |2 ] ( Roustant et al. , 2014 ) by input perturbation . Our work aims to combine the strengths of the two categories . Concretely , we first extract the interaction knowledge by a post-hoc method , and then build a transparent and interpretable learning model as illustrated in Figure 3 . Model Compression and Knowledge Distillation ( KD ) : Model compression ( Bucilua et al. , 2006 ) aims to learn a small compressed model ( Student ) from a large complex model ( Teacher ) with augmented training data produced by the Teacher . Compared to the Teacher , the Student can make similar or even better predictions . Knowledge distillation ( Hinton et al. , 2015 ) mainly deals with multi-class classification problems and extracts “ valuable information that defines a rich similarity structure over the data ” . Our work introduces a novel viewpoint of knowledge ( the interacted relationships ) and targets a lightweight but more accurate Student model . 3 PROPOSED INTERACTION DETECTION METHOD . Before diving into in-depth discussions of interaction detection , we need to formally define what feature interaction is . The textbook definition according to Friedman et al . ( 2008 ) is given below . Definition 3.1 ( Friedman & Popescu 2008 ) . A function F : Rp → R is said to exhibit an interaction between two of its variables xi and xj if the difference in the value of F ( x ) as a result of changing the value of xi depends on the value of xj . Equivalently , if Ex [ |∂ 2F ( x ) ∂xi∂xj |2 ] > 0 , namely the partial derivative w.r.t xj turns out to be dependent on xi , then we say xi and xj are interacted . Otherwise , xi and xj have no interaction , if F ( x ) can be expressed as the sum of two functions f\i and f\j ( Sorokina et al. , 2008 ) , namely , F ( x ) = f\i ( x1 , . . . , xi−1 , xi+1 , . . . , xp ) + f\j ( x1 , . . . , xj−1 , xj+1 , . . . , xp ) , where f\i ( j ) is irrespective to xi ( j ) . Similarly , higher-order ( multi-way ) interaction can be defined . In this paper , we mainly focus on pairwise interaction , while multi-way interaction is only briefly discussed due to space limitations . 3.1 INTERACTION STRENGTH MEASURE . Motivated by the above definition of interaction , it is natural to take advantage of the Hessian matrix H : = ∇2xxF ( x ) . The magnitude of its entry | ∂2F ( x ) ∂xi∂xj | contains rich information about the local curvature at a data point x . Note that F ( x ) is a regression function here , not a loss function . This idea was originally considered in the economics community ( Ai & Norton , 2003 ) and rediscovered for sensitivity analysis in Roustant et al . ( 2014 ) . The goodness of F ( x ) as an approximator can essentially influence the interaction detection performance , see our Theorem M.2 in the supplement . We define g ( x , i , j ) : = |∂ 2F ( x ) ∂xi∂xj |2 to measure the local interaction strength of the i-th and j-th features at point x . We then use f ( i , j ) : = Ex [ g ( x , i , j ) ] = Ex [ |∂ 2F ( x ) ∂xi∂xj |2 ] as a measure of the global interaction strength . If f ( i , j ) ≈ 0 , we say feature xi and xj have weak interaction ; otherwise , if f ( i , j ) is significantly larger than zero , then xi and xj have strong interaction . In this paper , we focus on the global interaction . 3.2 INTERACTION STRENGTH EVALUATION The above defined global interaction strength f ( i , j ) = Ex [ |∂ 2F ( x ) ∂xi∂xj |2 ] is mostly unavailable due to the unknown input distribution x ∼ P ( x ) . The Monte Carlo method can be used to approximate it by computing the sample mean over the training data ( Roustant et al. , 2014 ) . Analytical Evaluation : The Hessian matrix∇2xxF ( x ) for neural networks at a certain data point can be calculated analytically and efficiently , by using the automatic differentiation ( Paszke et al. , 2017 ) . However , using this analytical solution is problematic for some learning models , such as the ReLU network , Random Forest ( RF ) , etc. , see supplement A . For example , the landscape of a ReLU network is piece-wise linear as shown in Figure 1 , thus the exact Hessian is a zero matrix at almost every point . So , we turn to the following numerical evaluation for broader horizons . Numerical Evaluation : Finite difference method is a common way to approximate the Hessian on a given data point ( Campolongo & Braddock , 1999 ) , i.e. , ∂2F ( x ) ∂xi∂xj ≈ 1 4hihj [ F ( x + eihi + ejhj ) − F ( x + eihi − ejhj ) − F ( x + ejhj − eihi ) + F ( x− eihi − ejhj ) ] , ( 1 ) where ei is a one-hot vector with the i-th element being equal to one and the rest of elements being zeros . We also note that if the computation of gradient ∂F∂x is cheap ( e.g. , F is a neural network ) , then Hij can be approximated as 12h [ ∂F ( x+ejh ) ∂xi − ∂F ( x−ejh ) ∂xi ] to reduce computation , which is similar to the feature interaction score defined in Greenside et al . ( 2018 ) . The choice of perturbation size hi or hj ( abbr . hi ( j ) ) is critical . Generally , we do not want hi ( j ) to be too small ( incurring round-off error ) or too large ( incurring truncation error ) to get a good overall approximation of the derivative ( Jerrell , 1997 ; Baydin et al. , 2018 ) . For our problem , we particularly do not want hi ( j ) to be too small so that the four evaluated points ( shown in the numerator of Equation 1 ) lie on the same hyperplane ( e.g. , region A in Figure 1 ) , which makes the quantity in Equation 1 always zero . The following theorem reveals that choosing a sufficiently small hi ( j ) is not necessary . Theorem 3.1 . For any x and y , function F shows no interaction between them , i.e. , it can be decomposed as F ( x , y ) = a ( x ) + b ( y ) if and only if , for any h , k > 0 , F ( x + h , y + k ) − F ( x + h , y − k ) − F ( x− h , y + k ) + F ( x− h , y − k ) = 0 . The magnitude of the numerator in Equation 1 tells us whether F is locally separable for variables xi and xj at point x , see our proof in supplement B . The main issue of the finite difference method lies in the computational complexity for approximating the global interaction strength f ( i , j ) , especially when the function evaluation itself is expensive . Using all the training samples for finding just a few strongest interaction pairs can be a total waste of computation resources . In general , for a dataset with N samples in p-dimensional feature spaces , a total number of 4Np ( p− 1 ) /2 arithmetic evaluations of the surrogate regression function F are needed . If the Hessian happens to be sparse , that is , there are only a few interactions existing in the ground truth function , massive evaluations on those feature pairs with zero interaction strength should be avoided . 3.3 IDENTIFICATION OF THE k-STRONGEST PAIRWISE INTERACTIONS In practice , we do not have to obtain the interaction strengths for all interaction pairs , because many of them are simply too weak to have an impact on the output , and the top k strongest pairwise interactions are well sufficient for data modeling and prediction . Finding the top k strongest pairwise interactions fits perfectly into the best k-arms identification problem in the context of multi-armed bandits . Inspired by the recent work ( Bagaria et al. , 2018b ) , we can treat each entry of the Hessian Hij as an arm Ar ( see Figure 2 ) . Since Hessian is a symmetric matrix , we only need to consider n = p ( p− 1 ) /2 arms in the set { Ar : r ∈ [ n ] } . For example , if we choose to pull the arm for the i-th row and j-th column of the Hessian , we will evaluate the local interaction strength g ( xξ , i , j ) on a randomly selected training data point xξ . The strength g ( xξ , i , j ) can be regarded as a random reward , where xξ is uniformly drawn from the training data { x1 , . . . , xN } . For ease of notation , we let f ( r ; ξ ) : = g ( xξ , i , j ) as the random reward of the arm r , and define µr : = Eξ [ f ( r ; ξ ) ] as the true mean value . Our goal is to find the best k arms with the highest mean reward . This reformulation is reasonable since the following three essential assumptions for multi-armed bandits ( Slivkins et al. , 2019 ) are satisfied . a . Only the reward will be observed after each pull ; b . The reward for each arm is drawn independently and identically from its reward distribution ; c. The reward for each round is bounded . Since we only consider functions F ( x ) defined on a compact set , if F is a continuous function and twice differentiable , its first- and second-order derivatives are bounded accordingly . 3.4 DETECTING THE k-STRONGEST PAIRWISE INTERACTIONS WITH UCB ALGORITHM In this section , we briefly introduce the UCB algorithm ( Lai & Robbins , 1985 ) for finding the k-strongest interactions . Here , we design a sequence of estimators { f̂ ` ( r ) } for the mean reward of the arm Ar and construct confidence interval C ( ` ) . We let f̂ ` ( r ) denote the estimator after ` pulls of the arm Ar . Several assumptions need to be made before we give out the primary outcome . Assumption 1 . Finite m evaluations of one arm are sufficient to obtain an accurate reward . Assumption 2 . Estimators f̂ ` ( r ) are σr-subgaussian . Assumption 2 is satisfied because the reward is bounded ( Hoeffding ’ s lemma , 1963 ) . Here , σrs are pre-defined parameters . In the following analysis , we will choose σ = maxr { σr } , such that all f̂ ` ( r ) are σ-subgaussian . Let f̂ ` ( r ) : = 1 ` ∑ ` i=1 f ( r ; ξi ) , and we construct the 1− δ confidence intervals ( see supplement C ) of f̂ ` ( r ) as , C ( ` ) : = { √ 2σ2 log 2δ ` if ` ≤ m 0 if ` > m , ( 2 ) µr ∈ [ f̂ ` ( r ) − C ( ` ) , f̂ ` ( r ) + C ( ` ) ] , w.p . 1− δ , ( 3 ) where µr denotes the true expectation . Increasing number of pulls of one arm , the uncertainty of the reward for that arm will decrease . When the number of pulls reaches m , we can remove the uncertainty of the arm and set C ( ` ) = 0 . Let ` r ( t ) count the number of pulls of arm Ar till iteration t. To simplify the notations , we let µ̂r ( t ) = f̂ ` r ( t ) ( r ) and Cr ( t ) = C ( ` r ( t ) ) be the sample means and confidence intervals at iteration t. Now , we formally introduce the complete procedure in Algorithm 1 . The Algorithm 1 is initialized by evaluating all arms O ( log ( n ) ) times , then at each subsequent iteration , it picks the arm with the highest UCB , i.e. , maxj { µ̂j ( t ) +Cj ( t ) } , to evaluate ( see Figure 2 ) . If one arm has been evaluated for m times , we will its true mean value and set the uncertainty to zero . At the end of each iteration , if there exists one arm whose Lower Confidence Bound ( LCB ) is higher than all the other ’ s UCB , we will put it into the set of k best arms . In the following , we give a theoretical analysis on the complexity of this algorithm . We have to further define ∆ ( k ) i : = max ( 0 , µi∗k − µi ) , where i ∗ k is the index for the k-th best arm and ∆ ( k ) i indicates the gap of true values between the top-k arms and the rest . Theorem 3.2 . With probability 1−Θ ( 1n2 ) , given maximal pulling times m for each arm , Algorithm 1 returns the k-strongest interaction pairs in O ( ∑n i=1 log ( n ) ( σ2 log ( nm ) ( ∆ ( k ) i ) 2 ∧m ) ) time , where ( · ∧ · ) is short for min ( · , · ) . Remark 3.1 . When k n , the complexity of Algorithm 1 for finding the top k interactions is O ( n log ( mn ) log ( n ) + km log ( n ) ) under some natural assumptions on the distribution of ∆i , being superior to the naive algorithm ( every arm is pulled m times ) with complexity O ( nm ) . Remark 3.2 . For k = 1 , namely the strongest interaction pair identification , it requires at most∑n i=1 ( ( 8σ2 ( ∆ ( 1 ) i ) 2 log ( n3m ) ) ∧m ) pulls . We leave the complete proof in supplement C .
The authors propose two key ideas. The first is the idea of using the UCB algorithm to identify strong feature interactions in a computationally efficient way; each set of interacting features is an "arm" that could be "pulled", and pulling the arm corresponds to evaluating the strength of the interaction by computing the corresponding entry in the Hessian on a random training example. The finite difference method is used for computing Hessians. The second key idea is that of using the identified pairwise interactions to build a lightweight GAM-like model that they call ParaACE. In experiments, the authors show the UCB approach is effective at identifying feature interactions compared to alternative methods, and they demonstrate that ParaACE offers strong gains in model compression compared to other competing approaches, and often improves performance relative to its overparameterized teacher model.
SP:49c03477c8b78b257e3543b5b0b3035582cd28ca
Fast Generic Interaction Detection for Model Interpretability and Compression
1 INTRODUCTION . Explainable machine learning is an active research field that focuses on providing interpretable models , transparent explanations , and confident decisions to practical AI systems . Investigating feature interaction is vital to model interpretability . Interaction detection should be able to reveal which subset of features influence the output jointly , and what the corresponding nonlinear transformation is . We aim to find the underlying interactions from data , such that we can interpret the model properly . To go one step further , we hope that new models can be built with the aid of the detected interaction knowledge economically to avoid heavy parameterization . In this paper , we first restrict ourselves to interaction detection . A novel method is derived directly from the most acknowledged definition of feature interaction ( Friedman et al. , 2008 ) . We further apply the obtained interaction knowledge to design a transparent and refined neural network ( NN ) . This approach fits well into the data science life cycle ( Yu & Kumbier , 2019 ) , which was applied , for instance in Tsang et al . ( 2020a ) , successfully for interpretable recommender system design . The main contributions of this paper include : 1 ) a fast and principled interaction detection method , 2 ) a lightweight and interpretable neural network model that can surpass its Teacher , 3 ) thorough theoretical analysis and performance evaluations with real datasets . More details are given below . 1 . We propose a generic interaction detection method based on a global statistical metric , namely the expected Hessian , Hij : = Ex [ ∂2F ( x ) ∂xi∂xj ] . Notably , our method is model-agnostic and applicable to any pre-trained learning model , F ( x ) , being for instance , a deep neural network model or a tree model . It is also flexible to use for multi-way interaction detection . 2 . To speed up the detection process , we evaluate the expected Hessian via adaptive sampling using the Upper Confidence Bound ( UCB ) algorithm ( Lai & Robbins , 1985 ) , which can significantly reduce the computational complexity . Besides , thorough analysis of the proposed interaction detection method are conducted . 3 . Using the detected interaction pairs , we further design a compressed but interpretable Student model which can surpass its Teacher by 26 % in terms of data fitting performance averaged over various datasets . The compressed model reduces its size over 100 times compared to the baseline fully-connected , over-parameterized neural network ( OverparaFC ) . 4 . We demonstrate the linkages between our compressed model and the classic alternating conditional expectation ( ACE ) model ( Breiman & Friedman , 1985 ) . 5 . We conduct large-scale performance evaluations and further explain the obtained model interpretability with some real datasets . The remainder of this paper is organized as follows . Section 2 introduces all related works . Our proposed interaction detection method is introduced in Section 3 . By exploiting the detection outcome , a new variant of lightweight and interpretable deep learning model is introduced in Section 4 . Experimental results are given in Section 5 . Finally , we conclude the paper in Section 6 . 2 RELATED WORKS . Interaction Detection : Early works adopt pure statistics for detecting feature interactions , and representatives include ANOVA and GUIDE ( Wonnacott & Wonnacott , 1990 ; Fisher , 1992 ; Loh , 2002 ) . These works have motivated a plethora of new methods with the aim to enhance the detection accuracy and/or efficiency . The first class of methods centered around the GA2M and tree models , see for instance Lou et al . ( 2013 ) ; Sorokina et al . ( 2008 ) ; Friedman et al . ( 2008 ) ; Lundberg et al . ( 2020 ) . The second class of methods were built on the so-called factorization machines ( Rendle , 2010 ) as well as its new variants ( Xiao et al. , 2017 ; Song et al. , 2019 ) with attention mechanism . The third class exploits the most recent advances in deep learning , including the Neural Interaction Detection ( NID ) and some new variants ( Tsang et al. , 2018a ; b ; Cui et al. , 2019 ) : Persistence Interaction Detection ( PID ) ( Liu et al. , 2020 ) , Integrated Hessians ( IH ) ( Janizek et al. , 2020 ) , Shapley interaction ( Zhang et al. , 2020 ; Sundararajan et al. , 2020 ) , etc . Although we have witnessed well improved interaction detection performance for many datasets over the decades , the above methods still lead to inconsistent detection results for some other datasets . The reasons are twofold . Firstly , the interaction strength is empirically defined , for instance , NID method computes the interaction strength via summarizing the neural network weights . Secondly , a specific deep learning model is required , for instance , an ` 1-regularized ReLU network is required by the latest NID and PID methods to maintain high accuracy . In contrast , our proposed method is derived directly from the definition of feature interaction ( Friedman et al. , 2008 ) and moreover is not confined to any specific learning model . Model Interpretability : There are two categories of approaches to address model interpretability , namely the transparency-based and post-hoc approaches ( Došilović et al. , 2018 ) . Transparency-based approaches require the model itself to be simple and interpretable , like linear models , decision trees , etc . One can directly read off the interpretations from their coefficients or decision rules . But often , they are less accurate due to limited representation power . In contrast , post-hoc approaches extract useful information from a pre-trained model , which is often complex and hard to interpret . Well-known methods such as LIME ( Ribeiro et al. , 2016 ) and SHAP ( Lundberg & Lee , 2017 ) fall in this category , but they did not take feature interaction into account . Recently proposed symbolic metamodel ( Alaa & van der Schaar , 2019 ) captures nonlinear interactions by approximating the black-box model with explicit symbolic expressions . There are also some other post-hoc approaches based on sensitivity analysis ( Cortez & Embrechts , 2013 ) , which return a quantification of feature importance νi = E [ ( ∂F ( x ) ∂xi ) 2 ] ( Kucherenko et al. , 2009 ) and interactions νij = E [ |∂ 2F ( x ) ∂xi∂xj |2 ] ( Roustant et al. , 2014 ) by input perturbation . Our work aims to combine the strengths of the two categories . Concretely , we first extract the interaction knowledge by a post-hoc method , and then build a transparent and interpretable learning model as illustrated in Figure 3 . Model Compression and Knowledge Distillation ( KD ) : Model compression ( Bucilua et al. , 2006 ) aims to learn a small compressed model ( Student ) from a large complex model ( Teacher ) with augmented training data produced by the Teacher . Compared to the Teacher , the Student can make similar or even better predictions . Knowledge distillation ( Hinton et al. , 2015 ) mainly deals with multi-class classification problems and extracts “ valuable information that defines a rich similarity structure over the data ” . Our work introduces a novel viewpoint of knowledge ( the interacted relationships ) and targets a lightweight but more accurate Student model . 3 PROPOSED INTERACTION DETECTION METHOD . Before diving into in-depth discussions of interaction detection , we need to formally define what feature interaction is . The textbook definition according to Friedman et al . ( 2008 ) is given below . Definition 3.1 ( Friedman & Popescu 2008 ) . A function F : Rp → R is said to exhibit an interaction between two of its variables xi and xj if the difference in the value of F ( x ) as a result of changing the value of xi depends on the value of xj . Equivalently , if Ex [ |∂ 2F ( x ) ∂xi∂xj |2 ] > 0 , namely the partial derivative w.r.t xj turns out to be dependent on xi , then we say xi and xj are interacted . Otherwise , xi and xj have no interaction , if F ( x ) can be expressed as the sum of two functions f\i and f\j ( Sorokina et al. , 2008 ) , namely , F ( x ) = f\i ( x1 , . . . , xi−1 , xi+1 , . . . , xp ) + f\j ( x1 , . . . , xj−1 , xj+1 , . . . , xp ) , where f\i ( j ) is irrespective to xi ( j ) . Similarly , higher-order ( multi-way ) interaction can be defined . In this paper , we mainly focus on pairwise interaction , while multi-way interaction is only briefly discussed due to space limitations . 3.1 INTERACTION STRENGTH MEASURE . Motivated by the above definition of interaction , it is natural to take advantage of the Hessian matrix H : = ∇2xxF ( x ) . The magnitude of its entry | ∂2F ( x ) ∂xi∂xj | contains rich information about the local curvature at a data point x . Note that F ( x ) is a regression function here , not a loss function . This idea was originally considered in the economics community ( Ai & Norton , 2003 ) and rediscovered for sensitivity analysis in Roustant et al . ( 2014 ) . The goodness of F ( x ) as an approximator can essentially influence the interaction detection performance , see our Theorem M.2 in the supplement . We define g ( x , i , j ) : = |∂ 2F ( x ) ∂xi∂xj |2 to measure the local interaction strength of the i-th and j-th features at point x . We then use f ( i , j ) : = Ex [ g ( x , i , j ) ] = Ex [ |∂ 2F ( x ) ∂xi∂xj |2 ] as a measure of the global interaction strength . If f ( i , j ) ≈ 0 , we say feature xi and xj have weak interaction ; otherwise , if f ( i , j ) is significantly larger than zero , then xi and xj have strong interaction . In this paper , we focus on the global interaction . 3.2 INTERACTION STRENGTH EVALUATION The above defined global interaction strength f ( i , j ) = Ex [ |∂ 2F ( x ) ∂xi∂xj |2 ] is mostly unavailable due to the unknown input distribution x ∼ P ( x ) . The Monte Carlo method can be used to approximate it by computing the sample mean over the training data ( Roustant et al. , 2014 ) . Analytical Evaluation : The Hessian matrix∇2xxF ( x ) for neural networks at a certain data point can be calculated analytically and efficiently , by using the automatic differentiation ( Paszke et al. , 2017 ) . However , using this analytical solution is problematic for some learning models , such as the ReLU network , Random Forest ( RF ) , etc. , see supplement A . For example , the landscape of a ReLU network is piece-wise linear as shown in Figure 1 , thus the exact Hessian is a zero matrix at almost every point . So , we turn to the following numerical evaluation for broader horizons . Numerical Evaluation : Finite difference method is a common way to approximate the Hessian on a given data point ( Campolongo & Braddock , 1999 ) , i.e. , ∂2F ( x ) ∂xi∂xj ≈ 1 4hihj [ F ( x + eihi + ejhj ) − F ( x + eihi − ejhj ) − F ( x + ejhj − eihi ) + F ( x− eihi − ejhj ) ] , ( 1 ) where ei is a one-hot vector with the i-th element being equal to one and the rest of elements being zeros . We also note that if the computation of gradient ∂F∂x is cheap ( e.g. , F is a neural network ) , then Hij can be approximated as 12h [ ∂F ( x+ejh ) ∂xi − ∂F ( x−ejh ) ∂xi ] to reduce computation , which is similar to the feature interaction score defined in Greenside et al . ( 2018 ) . The choice of perturbation size hi or hj ( abbr . hi ( j ) ) is critical . Generally , we do not want hi ( j ) to be too small ( incurring round-off error ) or too large ( incurring truncation error ) to get a good overall approximation of the derivative ( Jerrell , 1997 ; Baydin et al. , 2018 ) . For our problem , we particularly do not want hi ( j ) to be too small so that the four evaluated points ( shown in the numerator of Equation 1 ) lie on the same hyperplane ( e.g. , region A in Figure 1 ) , which makes the quantity in Equation 1 always zero . The following theorem reveals that choosing a sufficiently small hi ( j ) is not necessary . Theorem 3.1 . For any x and y , function F shows no interaction between them , i.e. , it can be decomposed as F ( x , y ) = a ( x ) + b ( y ) if and only if , for any h , k > 0 , F ( x + h , y + k ) − F ( x + h , y − k ) − F ( x− h , y + k ) + F ( x− h , y − k ) = 0 . The magnitude of the numerator in Equation 1 tells us whether F is locally separable for variables xi and xj at point x , see our proof in supplement B . The main issue of the finite difference method lies in the computational complexity for approximating the global interaction strength f ( i , j ) , especially when the function evaluation itself is expensive . Using all the training samples for finding just a few strongest interaction pairs can be a total waste of computation resources . In general , for a dataset with N samples in p-dimensional feature spaces , a total number of 4Np ( p− 1 ) /2 arithmetic evaluations of the surrogate regression function F are needed . If the Hessian happens to be sparse , that is , there are only a few interactions existing in the ground truth function , massive evaluations on those feature pairs with zero interaction strength should be avoided . 3.3 IDENTIFICATION OF THE k-STRONGEST PAIRWISE INTERACTIONS In practice , we do not have to obtain the interaction strengths for all interaction pairs , because many of them are simply too weak to have an impact on the output , and the top k strongest pairwise interactions are well sufficient for data modeling and prediction . Finding the top k strongest pairwise interactions fits perfectly into the best k-arms identification problem in the context of multi-armed bandits . Inspired by the recent work ( Bagaria et al. , 2018b ) , we can treat each entry of the Hessian Hij as an arm Ar ( see Figure 2 ) . Since Hessian is a symmetric matrix , we only need to consider n = p ( p− 1 ) /2 arms in the set { Ar : r ∈ [ n ] } . For example , if we choose to pull the arm for the i-th row and j-th column of the Hessian , we will evaluate the local interaction strength g ( xξ , i , j ) on a randomly selected training data point xξ . The strength g ( xξ , i , j ) can be regarded as a random reward , where xξ is uniformly drawn from the training data { x1 , . . . , xN } . For ease of notation , we let f ( r ; ξ ) : = g ( xξ , i , j ) as the random reward of the arm r , and define µr : = Eξ [ f ( r ; ξ ) ] as the true mean value . Our goal is to find the best k arms with the highest mean reward . This reformulation is reasonable since the following three essential assumptions for multi-armed bandits ( Slivkins et al. , 2019 ) are satisfied . a . Only the reward will be observed after each pull ; b . The reward for each arm is drawn independently and identically from its reward distribution ; c. The reward for each round is bounded . Since we only consider functions F ( x ) defined on a compact set , if F is a continuous function and twice differentiable , its first- and second-order derivatives are bounded accordingly . 3.4 DETECTING THE k-STRONGEST PAIRWISE INTERACTIONS WITH UCB ALGORITHM In this section , we briefly introduce the UCB algorithm ( Lai & Robbins , 1985 ) for finding the k-strongest interactions . Here , we design a sequence of estimators { f̂ ` ( r ) } for the mean reward of the arm Ar and construct confidence interval C ( ` ) . We let f̂ ` ( r ) denote the estimator after ` pulls of the arm Ar . Several assumptions need to be made before we give out the primary outcome . Assumption 1 . Finite m evaluations of one arm are sufficient to obtain an accurate reward . Assumption 2 . Estimators f̂ ` ( r ) are σr-subgaussian . Assumption 2 is satisfied because the reward is bounded ( Hoeffding ’ s lemma , 1963 ) . Here , σrs are pre-defined parameters . In the following analysis , we will choose σ = maxr { σr } , such that all f̂ ` ( r ) are σ-subgaussian . Let f̂ ` ( r ) : = 1 ` ∑ ` i=1 f ( r ; ξi ) , and we construct the 1− δ confidence intervals ( see supplement C ) of f̂ ` ( r ) as , C ( ` ) : = { √ 2σ2 log 2δ ` if ` ≤ m 0 if ` > m , ( 2 ) µr ∈ [ f̂ ` ( r ) − C ( ` ) , f̂ ` ( r ) + C ( ` ) ] , w.p . 1− δ , ( 3 ) where µr denotes the true expectation . Increasing number of pulls of one arm , the uncertainty of the reward for that arm will decrease . When the number of pulls reaches m , we can remove the uncertainty of the arm and set C ( ` ) = 0 . Let ` r ( t ) count the number of pulls of arm Ar till iteration t. To simplify the notations , we let µ̂r ( t ) = f̂ ` r ( t ) ( r ) and Cr ( t ) = C ( ` r ( t ) ) be the sample means and confidence intervals at iteration t. Now , we formally introduce the complete procedure in Algorithm 1 . The Algorithm 1 is initialized by evaluating all arms O ( log ( n ) ) times , then at each subsequent iteration , it picks the arm with the highest UCB , i.e. , maxj { µ̂j ( t ) +Cj ( t ) } , to evaluate ( see Figure 2 ) . If one arm has been evaluated for m times , we will its true mean value and set the uncertainty to zero . At the end of each iteration , if there exists one arm whose Lower Confidence Bound ( LCB ) is higher than all the other ’ s UCB , we will put it into the set of k best arms . In the following , we give a theoretical analysis on the complexity of this algorithm . We have to further define ∆ ( k ) i : = max ( 0 , µi∗k − µi ) , where i ∗ k is the index for the k-th best arm and ∆ ( k ) i indicates the gap of true values between the top-k arms and the rest . Theorem 3.2 . With probability 1−Θ ( 1n2 ) , given maximal pulling times m for each arm , Algorithm 1 returns the k-strongest interaction pairs in O ( ∑n i=1 log ( n ) ( σ2 log ( nm ) ( ∆ ( k ) i ) 2 ∧m ) ) time , where ( · ∧ · ) is short for min ( · , · ) . Remark 3.1 . When k n , the complexity of Algorithm 1 for finding the top k interactions is O ( n log ( mn ) log ( n ) + km log ( n ) ) under some natural assumptions on the distribution of ∆i , being superior to the naive algorithm ( every arm is pulled m times ) with complexity O ( nm ) . Remark 3.2 . For k = 1 , namely the strongest interaction pair identification , it requires at most∑n i=1 ( ( 8σ2 ( ∆ ( 1 ) i ) 2 log ( n3m ) ) ∧m ) pulls . We leave the complete proof in supplement C .
Identification of feature interactions from black-box models, on a global as well as on a local scale, can lead to a better understanding of the operating modes of the black-box models. In this paper, the authors presented a principled approach to identify global interactions by casting the problem as a multi-arm bandit problem and proposes a solution using UCB algorithm. The authors claim that their method interaction discovery method is free of ad-hoc assumptions with good detection accuracy and stability. Furthermore, the authors showcase the importance of the learned interactions by proposing a new deep learning model based on these interactions and showcase the improvements in model size (thereby competing against pruning methods) as well as in accuracy (thereby competing against generalization methods).
SP:49c03477c8b78b257e3543b5b0b3035582cd28ca
Fast Generic Interaction Detection for Model Interpretability and Compression
1 INTRODUCTION . Explainable machine learning is an active research field that focuses on providing interpretable models , transparent explanations , and confident decisions to practical AI systems . Investigating feature interaction is vital to model interpretability . Interaction detection should be able to reveal which subset of features influence the output jointly , and what the corresponding nonlinear transformation is . We aim to find the underlying interactions from data , such that we can interpret the model properly . To go one step further , we hope that new models can be built with the aid of the detected interaction knowledge economically to avoid heavy parameterization . In this paper , we first restrict ourselves to interaction detection . A novel method is derived directly from the most acknowledged definition of feature interaction ( Friedman et al. , 2008 ) . We further apply the obtained interaction knowledge to design a transparent and refined neural network ( NN ) . This approach fits well into the data science life cycle ( Yu & Kumbier , 2019 ) , which was applied , for instance in Tsang et al . ( 2020a ) , successfully for interpretable recommender system design . The main contributions of this paper include : 1 ) a fast and principled interaction detection method , 2 ) a lightweight and interpretable neural network model that can surpass its Teacher , 3 ) thorough theoretical analysis and performance evaluations with real datasets . More details are given below . 1 . We propose a generic interaction detection method based on a global statistical metric , namely the expected Hessian , Hij : = Ex [ ∂2F ( x ) ∂xi∂xj ] . Notably , our method is model-agnostic and applicable to any pre-trained learning model , F ( x ) , being for instance , a deep neural network model or a tree model . It is also flexible to use for multi-way interaction detection . 2 . To speed up the detection process , we evaluate the expected Hessian via adaptive sampling using the Upper Confidence Bound ( UCB ) algorithm ( Lai & Robbins , 1985 ) , which can significantly reduce the computational complexity . Besides , thorough analysis of the proposed interaction detection method are conducted . 3 . Using the detected interaction pairs , we further design a compressed but interpretable Student model which can surpass its Teacher by 26 % in terms of data fitting performance averaged over various datasets . The compressed model reduces its size over 100 times compared to the baseline fully-connected , over-parameterized neural network ( OverparaFC ) . 4 . We demonstrate the linkages between our compressed model and the classic alternating conditional expectation ( ACE ) model ( Breiman & Friedman , 1985 ) . 5 . We conduct large-scale performance evaluations and further explain the obtained model interpretability with some real datasets . The remainder of this paper is organized as follows . Section 2 introduces all related works . Our proposed interaction detection method is introduced in Section 3 . By exploiting the detection outcome , a new variant of lightweight and interpretable deep learning model is introduced in Section 4 . Experimental results are given in Section 5 . Finally , we conclude the paper in Section 6 . 2 RELATED WORKS . Interaction Detection : Early works adopt pure statistics for detecting feature interactions , and representatives include ANOVA and GUIDE ( Wonnacott & Wonnacott , 1990 ; Fisher , 1992 ; Loh , 2002 ) . These works have motivated a plethora of new methods with the aim to enhance the detection accuracy and/or efficiency . The first class of methods centered around the GA2M and tree models , see for instance Lou et al . ( 2013 ) ; Sorokina et al . ( 2008 ) ; Friedman et al . ( 2008 ) ; Lundberg et al . ( 2020 ) . The second class of methods were built on the so-called factorization machines ( Rendle , 2010 ) as well as its new variants ( Xiao et al. , 2017 ; Song et al. , 2019 ) with attention mechanism . The third class exploits the most recent advances in deep learning , including the Neural Interaction Detection ( NID ) and some new variants ( Tsang et al. , 2018a ; b ; Cui et al. , 2019 ) : Persistence Interaction Detection ( PID ) ( Liu et al. , 2020 ) , Integrated Hessians ( IH ) ( Janizek et al. , 2020 ) , Shapley interaction ( Zhang et al. , 2020 ; Sundararajan et al. , 2020 ) , etc . Although we have witnessed well improved interaction detection performance for many datasets over the decades , the above methods still lead to inconsistent detection results for some other datasets . The reasons are twofold . Firstly , the interaction strength is empirically defined , for instance , NID method computes the interaction strength via summarizing the neural network weights . Secondly , a specific deep learning model is required , for instance , an ` 1-regularized ReLU network is required by the latest NID and PID methods to maintain high accuracy . In contrast , our proposed method is derived directly from the definition of feature interaction ( Friedman et al. , 2008 ) and moreover is not confined to any specific learning model . Model Interpretability : There are two categories of approaches to address model interpretability , namely the transparency-based and post-hoc approaches ( Došilović et al. , 2018 ) . Transparency-based approaches require the model itself to be simple and interpretable , like linear models , decision trees , etc . One can directly read off the interpretations from their coefficients or decision rules . But often , they are less accurate due to limited representation power . In contrast , post-hoc approaches extract useful information from a pre-trained model , which is often complex and hard to interpret . Well-known methods such as LIME ( Ribeiro et al. , 2016 ) and SHAP ( Lundberg & Lee , 2017 ) fall in this category , but they did not take feature interaction into account . Recently proposed symbolic metamodel ( Alaa & van der Schaar , 2019 ) captures nonlinear interactions by approximating the black-box model with explicit symbolic expressions . There are also some other post-hoc approaches based on sensitivity analysis ( Cortez & Embrechts , 2013 ) , which return a quantification of feature importance νi = E [ ( ∂F ( x ) ∂xi ) 2 ] ( Kucherenko et al. , 2009 ) and interactions νij = E [ |∂ 2F ( x ) ∂xi∂xj |2 ] ( Roustant et al. , 2014 ) by input perturbation . Our work aims to combine the strengths of the two categories . Concretely , we first extract the interaction knowledge by a post-hoc method , and then build a transparent and interpretable learning model as illustrated in Figure 3 . Model Compression and Knowledge Distillation ( KD ) : Model compression ( Bucilua et al. , 2006 ) aims to learn a small compressed model ( Student ) from a large complex model ( Teacher ) with augmented training data produced by the Teacher . Compared to the Teacher , the Student can make similar or even better predictions . Knowledge distillation ( Hinton et al. , 2015 ) mainly deals with multi-class classification problems and extracts “ valuable information that defines a rich similarity structure over the data ” . Our work introduces a novel viewpoint of knowledge ( the interacted relationships ) and targets a lightweight but more accurate Student model . 3 PROPOSED INTERACTION DETECTION METHOD . Before diving into in-depth discussions of interaction detection , we need to formally define what feature interaction is . The textbook definition according to Friedman et al . ( 2008 ) is given below . Definition 3.1 ( Friedman & Popescu 2008 ) . A function F : Rp → R is said to exhibit an interaction between two of its variables xi and xj if the difference in the value of F ( x ) as a result of changing the value of xi depends on the value of xj . Equivalently , if Ex [ |∂ 2F ( x ) ∂xi∂xj |2 ] > 0 , namely the partial derivative w.r.t xj turns out to be dependent on xi , then we say xi and xj are interacted . Otherwise , xi and xj have no interaction , if F ( x ) can be expressed as the sum of two functions f\i and f\j ( Sorokina et al. , 2008 ) , namely , F ( x ) = f\i ( x1 , . . . , xi−1 , xi+1 , . . . , xp ) + f\j ( x1 , . . . , xj−1 , xj+1 , . . . , xp ) , where f\i ( j ) is irrespective to xi ( j ) . Similarly , higher-order ( multi-way ) interaction can be defined . In this paper , we mainly focus on pairwise interaction , while multi-way interaction is only briefly discussed due to space limitations . 3.1 INTERACTION STRENGTH MEASURE . Motivated by the above definition of interaction , it is natural to take advantage of the Hessian matrix H : = ∇2xxF ( x ) . The magnitude of its entry | ∂2F ( x ) ∂xi∂xj | contains rich information about the local curvature at a data point x . Note that F ( x ) is a regression function here , not a loss function . This idea was originally considered in the economics community ( Ai & Norton , 2003 ) and rediscovered for sensitivity analysis in Roustant et al . ( 2014 ) . The goodness of F ( x ) as an approximator can essentially influence the interaction detection performance , see our Theorem M.2 in the supplement . We define g ( x , i , j ) : = |∂ 2F ( x ) ∂xi∂xj |2 to measure the local interaction strength of the i-th and j-th features at point x . We then use f ( i , j ) : = Ex [ g ( x , i , j ) ] = Ex [ |∂ 2F ( x ) ∂xi∂xj |2 ] as a measure of the global interaction strength . If f ( i , j ) ≈ 0 , we say feature xi and xj have weak interaction ; otherwise , if f ( i , j ) is significantly larger than zero , then xi and xj have strong interaction . In this paper , we focus on the global interaction . 3.2 INTERACTION STRENGTH EVALUATION The above defined global interaction strength f ( i , j ) = Ex [ |∂ 2F ( x ) ∂xi∂xj |2 ] is mostly unavailable due to the unknown input distribution x ∼ P ( x ) . The Monte Carlo method can be used to approximate it by computing the sample mean over the training data ( Roustant et al. , 2014 ) . Analytical Evaluation : The Hessian matrix∇2xxF ( x ) for neural networks at a certain data point can be calculated analytically and efficiently , by using the automatic differentiation ( Paszke et al. , 2017 ) . However , using this analytical solution is problematic for some learning models , such as the ReLU network , Random Forest ( RF ) , etc. , see supplement A . For example , the landscape of a ReLU network is piece-wise linear as shown in Figure 1 , thus the exact Hessian is a zero matrix at almost every point . So , we turn to the following numerical evaluation for broader horizons . Numerical Evaluation : Finite difference method is a common way to approximate the Hessian on a given data point ( Campolongo & Braddock , 1999 ) , i.e. , ∂2F ( x ) ∂xi∂xj ≈ 1 4hihj [ F ( x + eihi + ejhj ) − F ( x + eihi − ejhj ) − F ( x + ejhj − eihi ) + F ( x− eihi − ejhj ) ] , ( 1 ) where ei is a one-hot vector with the i-th element being equal to one and the rest of elements being zeros . We also note that if the computation of gradient ∂F∂x is cheap ( e.g. , F is a neural network ) , then Hij can be approximated as 12h [ ∂F ( x+ejh ) ∂xi − ∂F ( x−ejh ) ∂xi ] to reduce computation , which is similar to the feature interaction score defined in Greenside et al . ( 2018 ) . The choice of perturbation size hi or hj ( abbr . hi ( j ) ) is critical . Generally , we do not want hi ( j ) to be too small ( incurring round-off error ) or too large ( incurring truncation error ) to get a good overall approximation of the derivative ( Jerrell , 1997 ; Baydin et al. , 2018 ) . For our problem , we particularly do not want hi ( j ) to be too small so that the four evaluated points ( shown in the numerator of Equation 1 ) lie on the same hyperplane ( e.g. , region A in Figure 1 ) , which makes the quantity in Equation 1 always zero . The following theorem reveals that choosing a sufficiently small hi ( j ) is not necessary . Theorem 3.1 . For any x and y , function F shows no interaction between them , i.e. , it can be decomposed as F ( x , y ) = a ( x ) + b ( y ) if and only if , for any h , k > 0 , F ( x + h , y + k ) − F ( x + h , y − k ) − F ( x− h , y + k ) + F ( x− h , y − k ) = 0 . The magnitude of the numerator in Equation 1 tells us whether F is locally separable for variables xi and xj at point x , see our proof in supplement B . The main issue of the finite difference method lies in the computational complexity for approximating the global interaction strength f ( i , j ) , especially when the function evaluation itself is expensive . Using all the training samples for finding just a few strongest interaction pairs can be a total waste of computation resources . In general , for a dataset with N samples in p-dimensional feature spaces , a total number of 4Np ( p− 1 ) /2 arithmetic evaluations of the surrogate regression function F are needed . If the Hessian happens to be sparse , that is , there are only a few interactions existing in the ground truth function , massive evaluations on those feature pairs with zero interaction strength should be avoided . 3.3 IDENTIFICATION OF THE k-STRONGEST PAIRWISE INTERACTIONS In practice , we do not have to obtain the interaction strengths for all interaction pairs , because many of them are simply too weak to have an impact on the output , and the top k strongest pairwise interactions are well sufficient for data modeling and prediction . Finding the top k strongest pairwise interactions fits perfectly into the best k-arms identification problem in the context of multi-armed bandits . Inspired by the recent work ( Bagaria et al. , 2018b ) , we can treat each entry of the Hessian Hij as an arm Ar ( see Figure 2 ) . Since Hessian is a symmetric matrix , we only need to consider n = p ( p− 1 ) /2 arms in the set { Ar : r ∈ [ n ] } . For example , if we choose to pull the arm for the i-th row and j-th column of the Hessian , we will evaluate the local interaction strength g ( xξ , i , j ) on a randomly selected training data point xξ . The strength g ( xξ , i , j ) can be regarded as a random reward , where xξ is uniformly drawn from the training data { x1 , . . . , xN } . For ease of notation , we let f ( r ; ξ ) : = g ( xξ , i , j ) as the random reward of the arm r , and define µr : = Eξ [ f ( r ; ξ ) ] as the true mean value . Our goal is to find the best k arms with the highest mean reward . This reformulation is reasonable since the following three essential assumptions for multi-armed bandits ( Slivkins et al. , 2019 ) are satisfied . a . Only the reward will be observed after each pull ; b . The reward for each arm is drawn independently and identically from its reward distribution ; c. The reward for each round is bounded . Since we only consider functions F ( x ) defined on a compact set , if F is a continuous function and twice differentiable , its first- and second-order derivatives are bounded accordingly . 3.4 DETECTING THE k-STRONGEST PAIRWISE INTERACTIONS WITH UCB ALGORITHM In this section , we briefly introduce the UCB algorithm ( Lai & Robbins , 1985 ) for finding the k-strongest interactions . Here , we design a sequence of estimators { f̂ ` ( r ) } for the mean reward of the arm Ar and construct confidence interval C ( ` ) . We let f̂ ` ( r ) denote the estimator after ` pulls of the arm Ar . Several assumptions need to be made before we give out the primary outcome . Assumption 1 . Finite m evaluations of one arm are sufficient to obtain an accurate reward . Assumption 2 . Estimators f̂ ` ( r ) are σr-subgaussian . Assumption 2 is satisfied because the reward is bounded ( Hoeffding ’ s lemma , 1963 ) . Here , σrs are pre-defined parameters . In the following analysis , we will choose σ = maxr { σr } , such that all f̂ ` ( r ) are σ-subgaussian . Let f̂ ` ( r ) : = 1 ` ∑ ` i=1 f ( r ; ξi ) , and we construct the 1− δ confidence intervals ( see supplement C ) of f̂ ` ( r ) as , C ( ` ) : = { √ 2σ2 log 2δ ` if ` ≤ m 0 if ` > m , ( 2 ) µr ∈ [ f̂ ` ( r ) − C ( ` ) , f̂ ` ( r ) + C ( ` ) ] , w.p . 1− δ , ( 3 ) where µr denotes the true expectation . Increasing number of pulls of one arm , the uncertainty of the reward for that arm will decrease . When the number of pulls reaches m , we can remove the uncertainty of the arm and set C ( ` ) = 0 . Let ` r ( t ) count the number of pulls of arm Ar till iteration t. To simplify the notations , we let µ̂r ( t ) = f̂ ` r ( t ) ( r ) and Cr ( t ) = C ( ` r ( t ) ) be the sample means and confidence intervals at iteration t. Now , we formally introduce the complete procedure in Algorithm 1 . The Algorithm 1 is initialized by evaluating all arms O ( log ( n ) ) times , then at each subsequent iteration , it picks the arm with the highest UCB , i.e. , maxj { µ̂j ( t ) +Cj ( t ) } , to evaluate ( see Figure 2 ) . If one arm has been evaluated for m times , we will its true mean value and set the uncertainty to zero . At the end of each iteration , if there exists one arm whose Lower Confidence Bound ( LCB ) is higher than all the other ’ s UCB , we will put it into the set of k best arms . In the following , we give a theoretical analysis on the complexity of this algorithm . We have to further define ∆ ( k ) i : = max ( 0 , µi∗k − µi ) , where i ∗ k is the index for the k-th best arm and ∆ ( k ) i indicates the gap of true values between the top-k arms and the rest . Theorem 3.2 . With probability 1−Θ ( 1n2 ) , given maximal pulling times m for each arm , Algorithm 1 returns the k-strongest interaction pairs in O ( ∑n i=1 log ( n ) ( σ2 log ( nm ) ( ∆ ( k ) i ) 2 ∧m ) ) time , where ( · ∧ · ) is short for min ( · , · ) . Remark 3.1 . When k n , the complexity of Algorithm 1 for finding the top k interactions is O ( n log ( mn ) log ( n ) + km log ( n ) ) under some natural assumptions on the distribution of ∆i , being superior to the naive algorithm ( every arm is pulled m times ) with complexity O ( nm ) . Remark 3.2 . For k = 1 , namely the strongest interaction pair identification , it requires at most∑n i=1 ( ( 8σ2 ( ∆ ( 1 ) i ) 2 log ( n3m ) ) ∧m ) pulls . We leave the complete proof in supplement C .
The paper handles the important area of model that can be interpreted using feature interactions - aligned to theme of explainable deep learning. The authors chose to use the problem of multi-arm bandit, solving it by UCB algorithm with good speed and accuracy. A lightweight and interpretable deep learning model (called ParaACE), built using alternating conditional expectation (ACE) method is the crux of the work. It is shown that the proposed method improves accuracy by 26% and reduces the model size by 100+ times as compared to its Teacher model over various datasets. The paper has extensive supplementary material, as well as shared code.
SP:49c03477c8b78b257e3543b5b0b3035582cd28ca
DRIBO: Robust Deep Reinforcement Learning via Multi-View Information Bottleneck
1 INTRODUCTION . Deep reinforcement learning ( DRL ) methods have been shown to be successful in learning highquality controllers directly from raw images in an end-to-end fashion ( Mnih et al. , 2015 ; Levine et al. , 2016 ; Bojarski et al. , 2016 ) . However , it has been observed that DRL agents perform poorly in environments different from those where the agents were trained on , even when these environments contain semantically equivalent information relevant to the control task ( Farebrother et al. , 2018 ; Cobbe et al. , 2019 ; Zhang et al. , 2018b ; a ; Yu et al. , 2019 ) . By contrast , humans routinely adapt to new , unseen environments . For example , while visual scenes can be drastically different when driving in different cities , human drivers can quickly adjust to driving in a new city which they have never visited . We argue that this ability to adapt stems from the fact that driving skills are invariant to many visual details that are actually not relevant to driving . Conversely , DRL agents without this ability are hindered from understanding the temporal structure of task-relevant dynamics without being distracted by task-irrelevant visual details ( Jonschkowski & Brock , 2015 ; Zhang et al. , 2021 ; Agarwal et al. , 2021 ; Lee et al. , 2020b ) . Viewing from a representation learning perspective , a desired representation for RL should facilitate the prediction of future states ( beyond expected rewards ) on potential actions and discard excessive , task-irrelevant information from visual observations . An RL agent that learns from such representations has the advantage of learning an optimal policy more easily upon the prediction and being more robust to visual changes . In addition , the resulting policy is more likely to generalize to unseen environments if the task-relevant information in the new environment remains similar to that in the training environments . Prior works ( Hafner et al. , 2019 ; Lee et al. , 2020a ) that encode images into a low-dimensional latent space for RL typically rely on a reconstruction loss to learn representations that are sufficient to reconstruct the input images and predict ahead in the latent space While these approaches can learn representations that retain information in the visual observations , they do nothing to discard the irrelevant information . We tackle this problem by considering state representations for RL that are robust under the multi-view setting ( Li et al. , 2018 ; Federici et al. , 2020 ; Fischer , 2020 ) , where each view is assumed to provide the same amount of task-relevant information while all the information not shared by them is deemed task-irrelevant . Data augmentation can be easily leveraged to generate such multi-view observations without requiring additional new data . Data augmentation in RL has delivered promising results for visual control tasks ( Laskin et al. , 2020b ; Lange et al. , 2012 ; Laskin et al. , 2020a ) . However , these methods rarely exploit the sequential aspect of RL which requires an ideal representation to be predictive of future states given actions . In fact , the sequential nature of RL provides an additional temporal dimension for identifying task-irrelevant information when it is independent of actions . Instead of learning representations from each visual observation ( Laskin et al. , 2020a ) , we propose to learn a predictive model that captures the temporal evolution of representations from a sequence of observations and actions . Concretely , we introduce a new multi-view information bottleneck ( MIB ) objective that maximizes the mutual information between sequences of observations and representations while reducing the task-irrelevant information identified from the multi-view observations . We incorporate this MIB objective into RL by using it as an auxiliary learning objective . We illustrate our approach in Figure 1 . Our contributions are summarized below . • We propose DRIBO , a novel technique that learns robust representations in RL by identifying and discarding task-irrelevant information in the representations based on MIB . • We leverage the sequential nature of RL to learn representations better suited for RL with a non-reconstruction-based , DRIBO loss that maximizes the mutual information between sequences of observations and representations while disregarding task-irrelevant information . • Empirically , we show that our approach can ( i ) lead to better robustness against task-irrelevant distractors on the DeepMind Control Suite and ( ii ) significantly improve generalization on the Procgen benchmarks compared to current state-of-the-arts . 2 RELATED WORK . Reconstruction-based Representation Learning . Early works first trained autoencoders to learn representations to reconstruct raw observations . Then , the RL agent was trained from the learned representations ( Lange & Riedmiller , 2010 ; Lange et al. , 2012 ) . However , there is no guarantee that the agent will capture useful information for control . To address this problem , learning encoder and dynamics jointly has been proved effective in learning task-oriented and predictive representations ( Wahlström et al. , 2015 ; Watter et al. , 2015 ) . More recently , Hafner et al . ( 2019 ; 2020 ; 2021 ) and Lee et al . ( 2020a ) learn a latent dynamics model and train RL agents with predictive latent representations . However , these approaches suffer from the problem of embedding all details into representations even when they are task-irrelevant . The reason is that improving reconstruction quality from representations to visual observations forces the representations to retain more details . Despite success on many benchmarks , task-irrelevant visual changes can affect performance significantly ( Zhang et al. , 2018a ) . Experimentally , we show that our non-reconstructive approach , DRIBO , is substantially more robust against visual changes than prior works . We also compare DRIBO with another non-reconstructive method , DBC ( Zhang et al. , 2021 ) , which uses bisimulation metrics to learn representations in RL that contain only task-relevant information . Contrastive Representations Learning . Contrastive representation learning methods train an encoder that obeys similarity constraints in a dataset typically organized by similar and dissimilar pairs . The similar examples are typically obtained from nearby image patches ( Oord et al. , 2018 ; Hénaff et al. , 2020 ) or through data augmentation ( Chen et al. , 2020 ) . A scoring function that lower-bounds mutual information is one of the typical objects to be maximized ( Belghazi et al. , 2018 ; Oord et al. , 2018 ; Hjelm et al. , 2019 ; Poole et al. , 2019 ) . A number of works have applied the above ideas to RL settings to extract predictive signals . EMI ( Kim et al. , 2019 ) applies a Jensen-Shannon divergence-based lower bound on mutual information across subsequent frames as an exploration bonus . DRIML ( Mazoure et al. , 2020 ) uses an auxiliary contrastive objective to maximize concordance between representations to increase predictive properties of the representations conditioned on actions . CURL ( Laskin et al. , 2020a ) incorporates contrastive learning into RL algorithms to maximize similarity between augmented versions of the same observation . However , solely maximizing the lower-bound of mutual information retains all the information including those that are task-irrelevant ( Federici et al. , 2020 ; Fischer , 2020 ) . Multi-View Information Bottleneck ( MIB ) . MVRL ( Li et al. , 2019 ) uses the multi-view setting to tackle partially observable Markov decision processes with more than one observation model . For classification tasks , Federici et al . ( 2020 ) uses MIB by maximizing the mutual information between the representations of the two views while at the same time eliminating the label-irrelevant information identified by multi-view observations . Fischer ( 2020 ) describes a variant of the Conditional Entropy Bottleneck ( CEB ) which is mathematically equivalent to MIB . However , MIB/CEB can not be directly used in RL settings due to the sequential nature of decision making problems . PI-SAC ( Lee et al. , 2020b ) uses a contrastive version of CEB to model Predictive Information ( Bialek & Tishby , 1999 ) which is the mutual information between the past and the future to solve RL problems . However , this approach does not scale to long sequential data in RL and in practice only models short-term Predictive Information . Task-relevant information in RL is relevant because they influence not only current control decision and reward but also states and rewards well into the future . Our work , DRIBO , learns robust representations with a predictive model to maximize the mutual information between sequences of representations and observations , while eliminating task-irrelevant information based on the information bottleneck principle . Learning a predictive model also adopts richer learning signals than those provided by individual observation and reward alone . Philosophically and technically , our approach is different from PI-SAC which does not quantify task-irrelevant information from multi-view observations and can not capture long-term dependencies . Another line of work , IDAAC ( Raileanu & Fergus , 2021 ) , leverages an adversarial framework so that the learned representations yield features that are instance-independent and invariant to task-irrelevant changes . 3 PRELIMINARIES . We denote a Markov decision process ( MDP ) asM , with state s , action a , and reward r. S and A stand for the corresponding random variables . We denote a policy onM as π . The agent ’ s goal is to learn a policy π that maximizes the cumulative rewards . We define S⊆Rd as the state-representation space . The visual observations are o∈O , where we denote multi-view observations from the viewpoint i as o ( i ) . O stands for the random variable of the observation . We introduce a multi-view trajectory τM= [ s1 , o ( i ) 1 , a1 , . . . , sT , o ( i ) T , aT ] where T is the length . Knowing that the trajectory density is defined over joint observations , states , and actions , we write : pπ ( τ M ) =π ( aT |sT ) P ( i ) obs ( o ( i ) T |sT ) P ( sT |sT−1 , aT−1 ) · · ·π ( a1|s1 ) P ( i ) obs ( o ( i ) 1 |s1 ) P0 ( s1 ) ( 1 ) with P0 being the initial state distribution , P being the transition model and P ( i ) obs being the unknown observation model for view i. DRL agents learn from visual observations by treating consecutive observations as states to implicitly capture the predictive property . However , rich details in observations can easily distract the agent . An ideal representation should contain no task-irrelevant information and satisfy some underlying MDP which determines the distribution of the multi-view trajectory in Eq . ( 1 ) . Thus , instead of mapping a single-step observation to a representation , we consider learning a predictive model that correlates sequential observations and representations . Let a∗1 : T be the optimal action sequence for some o1 : T which is obtained by executing the action sequence a1 : T . We assume that o1 : T contains enough information to obtain a∗1 : T which maximizes the cumulative rewards . With this assumption , we define task-relevant information if it is necessary for deriving a∗1 : T . By contrast , task-irrelevant information does not contribute to the choice of a∗1 : T . We first consider sufficient representations that are discriminative enough to obtain A ∗ at each timestep . This property can be quantified by the amount of mutual information between O1 : T and A∗1 : T and mutual information between S1 : T and A ∗ 1 : T . Definition 1 . Representations S1 : T of O1 : T are sufficient for RL iff I ( O1 : T ; A∗1 : T ) =I ( S1 : T ; A∗1 : T ) . RL agents that have access to a sufficient representation St at timestep t must be able to generate A∗t as if it has access to the original observations . This can be better understood by subdividing I ( O1 : T ; S1 : T ) into two components using the chain rule of mutual information : I ( O1 : T ; S1 : T ) = I ( S1 : T ; O1 : T |A∗1 : T ) + I ( S1 : T ; A∗1 : T ) ( 2 ) Conditional mutual information I ( S1 : T ; O1 : T |A∗1 : T ) quantifies the information in S1 : T that is taskirrelevant . I ( S1 : T ; A∗1 : T ) quantifies task-relevant information that is accessible from S1 : T . The last term is independent of the representation as long as St is sufficient for A∗t ( see Definition 1 ) . Thus , a representation contains minimal task-irrelevant information whenever I ( O1 : T ; S1 : T |A∗1 : T ) is minimized . Maximizing I ( O1 : T ; S1 : T ) learns a sufficient representation . With the information bottleneck principle ( Tishby et al. , 2000 ) , we can construct an objective to maximize I ( O1 : T ; S1 : T ) while minimizing I ( S1 : T ; O1 : T |A∗1 : T ) to compress away task-irrelevant information . However , estimating the mutual information between long sequences is difficult due to the high dimensionality of the problem . In addition , the minimization of I ( S1 : T ; O1 : T |A∗1 : T ) can only be done directly in supervised settings whereA∗1 : T are observed . One option is to use MIB which can compress away task-irrelevant information in the representations in unsupervised settings ( Federici et al. , 2020 ) . The problem , however , is that MIB in its original form only considers a single observation and its representation and thus does not guarantee that the learned representations retain the important temporal structure of RL . In the next section , we describe how we extend MIB to RL settings .
This paper tackles the problem of generalization amidst visual distractors for control tasks. In particular, the distractors have no dependence on the optimal policy and thus clearly form a task-irrelevant component. The proposal is to use mutual information between two views as a proxy for how much task-relevant information is present in the constructed representation. This objective is adapted for RL to consider the long term sequential nature. Finally, the authors test this approach on ProcGen and DMC Suite with distractors, while also performing certain ablations.
SP:d0409cf6d032a169c8b9ce918a49a7ba5e838ba6
DRIBO: Robust Deep Reinforcement Learning via Multi-View Information Bottleneck
1 INTRODUCTION . Deep reinforcement learning ( DRL ) methods have been shown to be successful in learning highquality controllers directly from raw images in an end-to-end fashion ( Mnih et al. , 2015 ; Levine et al. , 2016 ; Bojarski et al. , 2016 ) . However , it has been observed that DRL agents perform poorly in environments different from those where the agents were trained on , even when these environments contain semantically equivalent information relevant to the control task ( Farebrother et al. , 2018 ; Cobbe et al. , 2019 ; Zhang et al. , 2018b ; a ; Yu et al. , 2019 ) . By contrast , humans routinely adapt to new , unseen environments . For example , while visual scenes can be drastically different when driving in different cities , human drivers can quickly adjust to driving in a new city which they have never visited . We argue that this ability to adapt stems from the fact that driving skills are invariant to many visual details that are actually not relevant to driving . Conversely , DRL agents without this ability are hindered from understanding the temporal structure of task-relevant dynamics without being distracted by task-irrelevant visual details ( Jonschkowski & Brock , 2015 ; Zhang et al. , 2021 ; Agarwal et al. , 2021 ; Lee et al. , 2020b ) . Viewing from a representation learning perspective , a desired representation for RL should facilitate the prediction of future states ( beyond expected rewards ) on potential actions and discard excessive , task-irrelevant information from visual observations . An RL agent that learns from such representations has the advantage of learning an optimal policy more easily upon the prediction and being more robust to visual changes . In addition , the resulting policy is more likely to generalize to unseen environments if the task-relevant information in the new environment remains similar to that in the training environments . Prior works ( Hafner et al. , 2019 ; Lee et al. , 2020a ) that encode images into a low-dimensional latent space for RL typically rely on a reconstruction loss to learn representations that are sufficient to reconstruct the input images and predict ahead in the latent space While these approaches can learn representations that retain information in the visual observations , they do nothing to discard the irrelevant information . We tackle this problem by considering state representations for RL that are robust under the multi-view setting ( Li et al. , 2018 ; Federici et al. , 2020 ; Fischer , 2020 ) , where each view is assumed to provide the same amount of task-relevant information while all the information not shared by them is deemed task-irrelevant . Data augmentation can be easily leveraged to generate such multi-view observations without requiring additional new data . Data augmentation in RL has delivered promising results for visual control tasks ( Laskin et al. , 2020b ; Lange et al. , 2012 ; Laskin et al. , 2020a ) . However , these methods rarely exploit the sequential aspect of RL which requires an ideal representation to be predictive of future states given actions . In fact , the sequential nature of RL provides an additional temporal dimension for identifying task-irrelevant information when it is independent of actions . Instead of learning representations from each visual observation ( Laskin et al. , 2020a ) , we propose to learn a predictive model that captures the temporal evolution of representations from a sequence of observations and actions . Concretely , we introduce a new multi-view information bottleneck ( MIB ) objective that maximizes the mutual information between sequences of observations and representations while reducing the task-irrelevant information identified from the multi-view observations . We incorporate this MIB objective into RL by using it as an auxiliary learning objective . We illustrate our approach in Figure 1 . Our contributions are summarized below . • We propose DRIBO , a novel technique that learns robust representations in RL by identifying and discarding task-irrelevant information in the representations based on MIB . • We leverage the sequential nature of RL to learn representations better suited for RL with a non-reconstruction-based , DRIBO loss that maximizes the mutual information between sequences of observations and representations while disregarding task-irrelevant information . • Empirically , we show that our approach can ( i ) lead to better robustness against task-irrelevant distractors on the DeepMind Control Suite and ( ii ) significantly improve generalization on the Procgen benchmarks compared to current state-of-the-arts . 2 RELATED WORK . Reconstruction-based Representation Learning . Early works first trained autoencoders to learn representations to reconstruct raw observations . Then , the RL agent was trained from the learned representations ( Lange & Riedmiller , 2010 ; Lange et al. , 2012 ) . However , there is no guarantee that the agent will capture useful information for control . To address this problem , learning encoder and dynamics jointly has been proved effective in learning task-oriented and predictive representations ( Wahlström et al. , 2015 ; Watter et al. , 2015 ) . More recently , Hafner et al . ( 2019 ; 2020 ; 2021 ) and Lee et al . ( 2020a ) learn a latent dynamics model and train RL agents with predictive latent representations . However , these approaches suffer from the problem of embedding all details into representations even when they are task-irrelevant . The reason is that improving reconstruction quality from representations to visual observations forces the representations to retain more details . Despite success on many benchmarks , task-irrelevant visual changes can affect performance significantly ( Zhang et al. , 2018a ) . Experimentally , we show that our non-reconstructive approach , DRIBO , is substantially more robust against visual changes than prior works . We also compare DRIBO with another non-reconstructive method , DBC ( Zhang et al. , 2021 ) , which uses bisimulation metrics to learn representations in RL that contain only task-relevant information . Contrastive Representations Learning . Contrastive representation learning methods train an encoder that obeys similarity constraints in a dataset typically organized by similar and dissimilar pairs . The similar examples are typically obtained from nearby image patches ( Oord et al. , 2018 ; Hénaff et al. , 2020 ) or through data augmentation ( Chen et al. , 2020 ) . A scoring function that lower-bounds mutual information is one of the typical objects to be maximized ( Belghazi et al. , 2018 ; Oord et al. , 2018 ; Hjelm et al. , 2019 ; Poole et al. , 2019 ) . A number of works have applied the above ideas to RL settings to extract predictive signals . EMI ( Kim et al. , 2019 ) applies a Jensen-Shannon divergence-based lower bound on mutual information across subsequent frames as an exploration bonus . DRIML ( Mazoure et al. , 2020 ) uses an auxiliary contrastive objective to maximize concordance between representations to increase predictive properties of the representations conditioned on actions . CURL ( Laskin et al. , 2020a ) incorporates contrastive learning into RL algorithms to maximize similarity between augmented versions of the same observation . However , solely maximizing the lower-bound of mutual information retains all the information including those that are task-irrelevant ( Federici et al. , 2020 ; Fischer , 2020 ) . Multi-View Information Bottleneck ( MIB ) . MVRL ( Li et al. , 2019 ) uses the multi-view setting to tackle partially observable Markov decision processes with more than one observation model . For classification tasks , Federici et al . ( 2020 ) uses MIB by maximizing the mutual information between the representations of the two views while at the same time eliminating the label-irrelevant information identified by multi-view observations . Fischer ( 2020 ) describes a variant of the Conditional Entropy Bottleneck ( CEB ) which is mathematically equivalent to MIB . However , MIB/CEB can not be directly used in RL settings due to the sequential nature of decision making problems . PI-SAC ( Lee et al. , 2020b ) uses a contrastive version of CEB to model Predictive Information ( Bialek & Tishby , 1999 ) which is the mutual information between the past and the future to solve RL problems . However , this approach does not scale to long sequential data in RL and in practice only models short-term Predictive Information . Task-relevant information in RL is relevant because they influence not only current control decision and reward but also states and rewards well into the future . Our work , DRIBO , learns robust representations with a predictive model to maximize the mutual information between sequences of representations and observations , while eliminating task-irrelevant information based on the information bottleneck principle . Learning a predictive model also adopts richer learning signals than those provided by individual observation and reward alone . Philosophically and technically , our approach is different from PI-SAC which does not quantify task-irrelevant information from multi-view observations and can not capture long-term dependencies . Another line of work , IDAAC ( Raileanu & Fergus , 2021 ) , leverages an adversarial framework so that the learned representations yield features that are instance-independent and invariant to task-irrelevant changes . 3 PRELIMINARIES . We denote a Markov decision process ( MDP ) asM , with state s , action a , and reward r. S and A stand for the corresponding random variables . We denote a policy onM as π . The agent ’ s goal is to learn a policy π that maximizes the cumulative rewards . We define S⊆Rd as the state-representation space . The visual observations are o∈O , where we denote multi-view observations from the viewpoint i as o ( i ) . O stands for the random variable of the observation . We introduce a multi-view trajectory τM= [ s1 , o ( i ) 1 , a1 , . . . , sT , o ( i ) T , aT ] where T is the length . Knowing that the trajectory density is defined over joint observations , states , and actions , we write : pπ ( τ M ) =π ( aT |sT ) P ( i ) obs ( o ( i ) T |sT ) P ( sT |sT−1 , aT−1 ) · · ·π ( a1|s1 ) P ( i ) obs ( o ( i ) 1 |s1 ) P0 ( s1 ) ( 1 ) with P0 being the initial state distribution , P being the transition model and P ( i ) obs being the unknown observation model for view i. DRL agents learn from visual observations by treating consecutive observations as states to implicitly capture the predictive property . However , rich details in observations can easily distract the agent . An ideal representation should contain no task-irrelevant information and satisfy some underlying MDP which determines the distribution of the multi-view trajectory in Eq . ( 1 ) . Thus , instead of mapping a single-step observation to a representation , we consider learning a predictive model that correlates sequential observations and representations . Let a∗1 : T be the optimal action sequence for some o1 : T which is obtained by executing the action sequence a1 : T . We assume that o1 : T contains enough information to obtain a∗1 : T which maximizes the cumulative rewards . With this assumption , we define task-relevant information if it is necessary for deriving a∗1 : T . By contrast , task-irrelevant information does not contribute to the choice of a∗1 : T . We first consider sufficient representations that are discriminative enough to obtain A ∗ at each timestep . This property can be quantified by the amount of mutual information between O1 : T and A∗1 : T and mutual information between S1 : T and A ∗ 1 : T . Definition 1 . Representations S1 : T of O1 : T are sufficient for RL iff I ( O1 : T ; A∗1 : T ) =I ( S1 : T ; A∗1 : T ) . RL agents that have access to a sufficient representation St at timestep t must be able to generate A∗t as if it has access to the original observations . This can be better understood by subdividing I ( O1 : T ; S1 : T ) into two components using the chain rule of mutual information : I ( O1 : T ; S1 : T ) = I ( S1 : T ; O1 : T |A∗1 : T ) + I ( S1 : T ; A∗1 : T ) ( 2 ) Conditional mutual information I ( S1 : T ; O1 : T |A∗1 : T ) quantifies the information in S1 : T that is taskirrelevant . I ( S1 : T ; A∗1 : T ) quantifies task-relevant information that is accessible from S1 : T . The last term is independent of the representation as long as St is sufficient for A∗t ( see Definition 1 ) . Thus , a representation contains minimal task-irrelevant information whenever I ( O1 : T ; S1 : T |A∗1 : T ) is minimized . Maximizing I ( O1 : T ; S1 : T ) learns a sufficient representation . With the information bottleneck principle ( Tishby et al. , 2000 ) , we can construct an objective to maximize I ( O1 : T ; S1 : T ) while minimizing I ( S1 : T ; O1 : T |A∗1 : T ) to compress away task-irrelevant information . However , estimating the mutual information between long sequences is difficult due to the high dimensionality of the problem . In addition , the minimization of I ( S1 : T ; O1 : T |A∗1 : T ) can only be done directly in supervised settings whereA∗1 : T are observed . One option is to use MIB which can compress away task-irrelevant information in the representations in unsupervised settings ( Federici et al. , 2020 ) . The problem , however , is that MIB in its original form only considers a single observation and its representation and thus does not guarantee that the learned representations retain the important temporal structure of RL . In the next section , we describe how we extend MIB to RL settings .
This paper aims to learn robust representation from the replay buffer for reinforcement learning. The key idea is to leverage the concept of mutual information and the InfoNCE tool to compute the mutual information as a regularizer (a.k.a. DRIBO loss). The authors conducted experiments on some standard benchmarks (DeepMind Visual Control Suite and ProcGen).
SP:d0409cf6d032a169c8b9ce918a49a7ba5e838ba6
DRIBO: Robust Deep Reinforcement Learning via Multi-View Information Bottleneck
1 INTRODUCTION . Deep reinforcement learning ( DRL ) methods have been shown to be successful in learning highquality controllers directly from raw images in an end-to-end fashion ( Mnih et al. , 2015 ; Levine et al. , 2016 ; Bojarski et al. , 2016 ) . However , it has been observed that DRL agents perform poorly in environments different from those where the agents were trained on , even when these environments contain semantically equivalent information relevant to the control task ( Farebrother et al. , 2018 ; Cobbe et al. , 2019 ; Zhang et al. , 2018b ; a ; Yu et al. , 2019 ) . By contrast , humans routinely adapt to new , unseen environments . For example , while visual scenes can be drastically different when driving in different cities , human drivers can quickly adjust to driving in a new city which they have never visited . We argue that this ability to adapt stems from the fact that driving skills are invariant to many visual details that are actually not relevant to driving . Conversely , DRL agents without this ability are hindered from understanding the temporal structure of task-relevant dynamics without being distracted by task-irrelevant visual details ( Jonschkowski & Brock , 2015 ; Zhang et al. , 2021 ; Agarwal et al. , 2021 ; Lee et al. , 2020b ) . Viewing from a representation learning perspective , a desired representation for RL should facilitate the prediction of future states ( beyond expected rewards ) on potential actions and discard excessive , task-irrelevant information from visual observations . An RL agent that learns from such representations has the advantage of learning an optimal policy more easily upon the prediction and being more robust to visual changes . In addition , the resulting policy is more likely to generalize to unseen environments if the task-relevant information in the new environment remains similar to that in the training environments . Prior works ( Hafner et al. , 2019 ; Lee et al. , 2020a ) that encode images into a low-dimensional latent space for RL typically rely on a reconstruction loss to learn representations that are sufficient to reconstruct the input images and predict ahead in the latent space While these approaches can learn representations that retain information in the visual observations , they do nothing to discard the irrelevant information . We tackle this problem by considering state representations for RL that are robust under the multi-view setting ( Li et al. , 2018 ; Federici et al. , 2020 ; Fischer , 2020 ) , where each view is assumed to provide the same amount of task-relevant information while all the information not shared by them is deemed task-irrelevant . Data augmentation can be easily leveraged to generate such multi-view observations without requiring additional new data . Data augmentation in RL has delivered promising results for visual control tasks ( Laskin et al. , 2020b ; Lange et al. , 2012 ; Laskin et al. , 2020a ) . However , these methods rarely exploit the sequential aspect of RL which requires an ideal representation to be predictive of future states given actions . In fact , the sequential nature of RL provides an additional temporal dimension for identifying task-irrelevant information when it is independent of actions . Instead of learning representations from each visual observation ( Laskin et al. , 2020a ) , we propose to learn a predictive model that captures the temporal evolution of representations from a sequence of observations and actions . Concretely , we introduce a new multi-view information bottleneck ( MIB ) objective that maximizes the mutual information between sequences of observations and representations while reducing the task-irrelevant information identified from the multi-view observations . We incorporate this MIB objective into RL by using it as an auxiliary learning objective . We illustrate our approach in Figure 1 . Our contributions are summarized below . • We propose DRIBO , a novel technique that learns robust representations in RL by identifying and discarding task-irrelevant information in the representations based on MIB . • We leverage the sequential nature of RL to learn representations better suited for RL with a non-reconstruction-based , DRIBO loss that maximizes the mutual information between sequences of observations and representations while disregarding task-irrelevant information . • Empirically , we show that our approach can ( i ) lead to better robustness against task-irrelevant distractors on the DeepMind Control Suite and ( ii ) significantly improve generalization on the Procgen benchmarks compared to current state-of-the-arts . 2 RELATED WORK . Reconstruction-based Representation Learning . Early works first trained autoencoders to learn representations to reconstruct raw observations . Then , the RL agent was trained from the learned representations ( Lange & Riedmiller , 2010 ; Lange et al. , 2012 ) . However , there is no guarantee that the agent will capture useful information for control . To address this problem , learning encoder and dynamics jointly has been proved effective in learning task-oriented and predictive representations ( Wahlström et al. , 2015 ; Watter et al. , 2015 ) . More recently , Hafner et al . ( 2019 ; 2020 ; 2021 ) and Lee et al . ( 2020a ) learn a latent dynamics model and train RL agents with predictive latent representations . However , these approaches suffer from the problem of embedding all details into representations even when they are task-irrelevant . The reason is that improving reconstruction quality from representations to visual observations forces the representations to retain more details . Despite success on many benchmarks , task-irrelevant visual changes can affect performance significantly ( Zhang et al. , 2018a ) . Experimentally , we show that our non-reconstructive approach , DRIBO , is substantially more robust against visual changes than prior works . We also compare DRIBO with another non-reconstructive method , DBC ( Zhang et al. , 2021 ) , which uses bisimulation metrics to learn representations in RL that contain only task-relevant information . Contrastive Representations Learning . Contrastive representation learning methods train an encoder that obeys similarity constraints in a dataset typically organized by similar and dissimilar pairs . The similar examples are typically obtained from nearby image patches ( Oord et al. , 2018 ; Hénaff et al. , 2020 ) or through data augmentation ( Chen et al. , 2020 ) . A scoring function that lower-bounds mutual information is one of the typical objects to be maximized ( Belghazi et al. , 2018 ; Oord et al. , 2018 ; Hjelm et al. , 2019 ; Poole et al. , 2019 ) . A number of works have applied the above ideas to RL settings to extract predictive signals . EMI ( Kim et al. , 2019 ) applies a Jensen-Shannon divergence-based lower bound on mutual information across subsequent frames as an exploration bonus . DRIML ( Mazoure et al. , 2020 ) uses an auxiliary contrastive objective to maximize concordance between representations to increase predictive properties of the representations conditioned on actions . CURL ( Laskin et al. , 2020a ) incorporates contrastive learning into RL algorithms to maximize similarity between augmented versions of the same observation . However , solely maximizing the lower-bound of mutual information retains all the information including those that are task-irrelevant ( Federici et al. , 2020 ; Fischer , 2020 ) . Multi-View Information Bottleneck ( MIB ) . MVRL ( Li et al. , 2019 ) uses the multi-view setting to tackle partially observable Markov decision processes with more than one observation model . For classification tasks , Federici et al . ( 2020 ) uses MIB by maximizing the mutual information between the representations of the two views while at the same time eliminating the label-irrelevant information identified by multi-view observations . Fischer ( 2020 ) describes a variant of the Conditional Entropy Bottleneck ( CEB ) which is mathematically equivalent to MIB . However , MIB/CEB can not be directly used in RL settings due to the sequential nature of decision making problems . PI-SAC ( Lee et al. , 2020b ) uses a contrastive version of CEB to model Predictive Information ( Bialek & Tishby , 1999 ) which is the mutual information between the past and the future to solve RL problems . However , this approach does not scale to long sequential data in RL and in practice only models short-term Predictive Information . Task-relevant information in RL is relevant because they influence not only current control decision and reward but also states and rewards well into the future . Our work , DRIBO , learns robust representations with a predictive model to maximize the mutual information between sequences of representations and observations , while eliminating task-irrelevant information based on the information bottleneck principle . Learning a predictive model also adopts richer learning signals than those provided by individual observation and reward alone . Philosophically and technically , our approach is different from PI-SAC which does not quantify task-irrelevant information from multi-view observations and can not capture long-term dependencies . Another line of work , IDAAC ( Raileanu & Fergus , 2021 ) , leverages an adversarial framework so that the learned representations yield features that are instance-independent and invariant to task-irrelevant changes . 3 PRELIMINARIES . We denote a Markov decision process ( MDP ) asM , with state s , action a , and reward r. S and A stand for the corresponding random variables . We denote a policy onM as π . The agent ’ s goal is to learn a policy π that maximizes the cumulative rewards . We define S⊆Rd as the state-representation space . The visual observations are o∈O , where we denote multi-view observations from the viewpoint i as o ( i ) . O stands for the random variable of the observation . We introduce a multi-view trajectory τM= [ s1 , o ( i ) 1 , a1 , . . . , sT , o ( i ) T , aT ] where T is the length . Knowing that the trajectory density is defined over joint observations , states , and actions , we write : pπ ( τ M ) =π ( aT |sT ) P ( i ) obs ( o ( i ) T |sT ) P ( sT |sT−1 , aT−1 ) · · ·π ( a1|s1 ) P ( i ) obs ( o ( i ) 1 |s1 ) P0 ( s1 ) ( 1 ) with P0 being the initial state distribution , P being the transition model and P ( i ) obs being the unknown observation model for view i. DRL agents learn from visual observations by treating consecutive observations as states to implicitly capture the predictive property . However , rich details in observations can easily distract the agent . An ideal representation should contain no task-irrelevant information and satisfy some underlying MDP which determines the distribution of the multi-view trajectory in Eq . ( 1 ) . Thus , instead of mapping a single-step observation to a representation , we consider learning a predictive model that correlates sequential observations and representations . Let a∗1 : T be the optimal action sequence for some o1 : T which is obtained by executing the action sequence a1 : T . We assume that o1 : T contains enough information to obtain a∗1 : T which maximizes the cumulative rewards . With this assumption , we define task-relevant information if it is necessary for deriving a∗1 : T . By contrast , task-irrelevant information does not contribute to the choice of a∗1 : T . We first consider sufficient representations that are discriminative enough to obtain A ∗ at each timestep . This property can be quantified by the amount of mutual information between O1 : T and A∗1 : T and mutual information between S1 : T and A ∗ 1 : T . Definition 1 . Representations S1 : T of O1 : T are sufficient for RL iff I ( O1 : T ; A∗1 : T ) =I ( S1 : T ; A∗1 : T ) . RL agents that have access to a sufficient representation St at timestep t must be able to generate A∗t as if it has access to the original observations . This can be better understood by subdividing I ( O1 : T ; S1 : T ) into two components using the chain rule of mutual information : I ( O1 : T ; S1 : T ) = I ( S1 : T ; O1 : T |A∗1 : T ) + I ( S1 : T ; A∗1 : T ) ( 2 ) Conditional mutual information I ( S1 : T ; O1 : T |A∗1 : T ) quantifies the information in S1 : T that is taskirrelevant . I ( S1 : T ; A∗1 : T ) quantifies task-relevant information that is accessible from S1 : T . The last term is independent of the representation as long as St is sufficient for A∗t ( see Definition 1 ) . Thus , a representation contains minimal task-irrelevant information whenever I ( O1 : T ; S1 : T |A∗1 : T ) is minimized . Maximizing I ( O1 : T ; S1 : T ) learns a sufficient representation . With the information bottleneck principle ( Tishby et al. , 2000 ) , we can construct an objective to maximize I ( O1 : T ; S1 : T ) while minimizing I ( S1 : T ; O1 : T |A∗1 : T ) to compress away task-irrelevant information . However , estimating the mutual information between long sequences is difficult due to the high dimensionality of the problem . In addition , the minimization of I ( S1 : T ; O1 : T |A∗1 : T ) can only be done directly in supervised settings whereA∗1 : T are observed . One option is to use MIB which can compress away task-irrelevant information in the representations in unsupervised settings ( Federici et al. , 2020 ) . The problem , however , is that MIB in its original form only considers a single observation and its representation and thus does not guarantee that the learned representations retain the important temporal structure of RL . In the next section , we describe how we extend MIB to RL settings .
This paper studies the problem of pixel-based control with reinforcement learning. The authors categorize observation changes into task-relevant and task-irrelevant changes. They define task-irrelevant changes as those do not have casual relations with actions, and introduce a conditional prior to compress task-irrelevant information, such that agent can focus on task-relevant information. The authors evaluated the proposed DRIBO method on pixel-based control tasks (DM Control) with natural video background and the procgen suite.
SP:d0409cf6d032a169c8b9ce918a49a7ba5e838ba6
Convergence Analysis and Implicit Regularization of Feedback Alignment for Deep Linear Networks
1 INTRODUCTION . In order to train a Machine Learning ( ML ) architecture in the context of supervised learning , it is a consolidated practice to resort to the Gradient Descent ( GD ) algorithm and its variants ( e.g . stochastic GD ) and to calculate the gradient of the loss function via backpropagation ( Rumelhart et al. , 1986 ) . However , one of its limitations is the so-called weight transport problem ( Grossberg , 1987 ) : the update of each neuron during the learning phase relies on the downstream weights ( which are therefore `` transported '' along the backward pass ) . This implies that 1 ) the synaptic weights are the same , up to transposition , for both the forward ( inference ) and backward ( learning ) pass and 2 ) each neuron has a precise knowledge of all of its forward synapses . It is known that such a model does not accurately reflect the behaviour of a human brain , thus it is biologically implausible ( Crick , 1989 ) . Feedback Alignment ( FA ) , originally proposed by Lillicrap ( Lillicrap et al. , 2016 ) , has been an attempt to mitigate this discrepancy between the neuroscience side and the engineering side of AI and to tackle the weight transport problem in a systematic way . The simple , yet powerful idea is to replace the transposed weight matrices in the backpropagation algorithm with arbitrary , fixed matrices : via this strategy , each neuron during training receives a random projection of the error vector . In order to illustrate the algorithm and for the purpose of our study , let us consider a fully-connected L-layer neural network ( NN ) : given the input , x = h0 ∈ Rd , the predicted label ŷ ∈ Ro is computed as a ` = W ` h ` −1 , h ` = σ ( a ` ) , ` ∈ { 1 , . . . , L } : = [ L ] , ( 1 ) σ being a ( potentially ) nonlinear function applied entry-wise to the vector a ` , and finally ŷ = f ( aL ) for some output nonlinear function f . We consider a regression task with loss function L being the standard Mean Square Error ( MSE ) . The backpropagation strategy for GD prescribes the following updates for each layer in the network : given a step size η > 0 and the error vector e = δaL = ∂L∂ŷ = ŷ − y where y is the true label , we have δWL = −ηeh > L−1 , δW ` = −ηδa ` h > ` −1 and δa ` = ( W > ` +1δa ` +1 ) σ′ ( a ` ) , ` ∈ [ L−1 ] ( GD ) where denotes the Hadamard product . The FA recipe prescribes the following : Feedback Alignment : in ( GD ) use δa ` = ( M ` δa ` +1 ) σ′ ( a ` ) , ` ∈ [ L− 1 ] . ( 2 ) where { M ` } are a collection of arbitrarily chosen matrices , which do not evolve during training . Related and previous work . Inspired by Lillicrap et al . ( 2016 ) and shortly after its publication , Nøkland ( 2016 ) proposed two new algorithms called Direct and Inverse FA . In particular , Direct FA reduces to the FA algorithm in the case of a 2-layer NN or multi-layer linear NN ; the difference between these two algorithms in the general multi-layer nonlinear NN resides in injecting the error vector directly into the update of each hidden layer of the network : δa ` = ( M ` e ) σ′ ( a ` ) , ` ∈ [ 1 , L − 1 ] . Such a modification of the FA algorithm can be interpreted as a noisy version of layer-wise training ( Gilmer et al. , 2017 ) . Since its first formulation , there has been an extensive numerical analysis on testing whether FA and Direct FA algorithms can be successfully applied to ML problems , in particular in the presence of complex datasets and deep architectures ( Bartunov et al. , 2018 ; Moskovitz et al. , 2018 ; Launay et al. , 2019 ) . We mention the recent survey paper Launay et al . ( 2020 ) where the focus is on Direct FA and it is shown that the algorithm performs well in modern deep architectures ( Transformers and Graph NN , among others ) applied to problems like neural view synthesis or natural language processing . Furthermore , more on the applied ( biologically-inspired ) side , there have been recent pushes in furthering the idea of FA : spike-train level direct feedback alignment ( Lee et al. , 2020 ) , memory-efficient direct feedback alignment ( Chu et al. , 2020 ) and direct random target projection ( Frenkel et al. , 2021 ) to mention a few examples . On the other hand , rigorous theoretical results are scarce . Preliminary asymptotic results can be found in the original papers by Lillicrap et al . ( 2016 ) and Nøkland ( 2016 ) . More recently , Refinetti et al . ( 2020 ) presented the derivation of a system of differential equations that governs the Direct FA dynamics for a 2-layer non-linear NN in the regime where the input dimension goes to infinity . There is no explicit formula for the solution of the system , but via a careful local analysis it is possible to identify two separate phases of learning ( alignment and memorization ) and a `` degeneracy breaking '' effect : at the end of the FA training , the selected solution maximizes the overlap between the second weight matrix W2 and the FA matrix M . Such an `` alignment '' dynamics is also evident in our analysis ( Section 2 ) . Convergence guarantees for deep networks are still missing from the literature and one of the goals of this paper is indeed to provide rigorous proofs of convergence , together with convergence rates . Our analysis is in a similar vein as some recent works on implicit regularization in linear neural networks Saxe et al . ( 2018 ) ; Gidel et al . ( 2019 ) ; Arora et al . ( 2018 ) . Even though our setting is very similar , our analysis is different : because of the feedback alignment matrices , the autonomous differential equation obtained significantly differ and lead to different dynamics . Moreover our focus is slightly different from Saxe et al . ( 2018 ) ; Gidel et al . ( 2019 ) ; Arora et al . ( 2018 ) which are fully dedicated to implicit regularization of GD while we also aim at proving the convergence of FA . Our contributions . We aim to provide a theoretical understanding of how and when FA works . We focus on two aspects : 1 ) proving convergence of the algorithm and 2 ) analyzing implicit regularization phenomena . We will extensively study the case of deep linear NNs . Despite being sometimes regarded as too simplistic , the study of linear networks is a crucial starting point for a systematic analysis of the FA algorithm : it will allow us to rigorously analyze a tractable model and it will give us insights and intuition on the general nonlinear setting ( Section 7 ) . Our main results are the following . • We prove convergence of the FA continuous dynamics , with rates , for L-layer NNs with L ≥ 2 ( Sections 2 and 3 ) . Such results hold for any input dimension and number of neurons : the network is not necessarily overparametrized . • We prove that , for certain initialization schemes , the continuous FA dynamics sequentially learn the solutions of a reduced-rank regression problem , but in a backward fashion : smaller components first , dominant components later ( Section 4 ) . Additionally , we provide guidelines for an initialization scheme that avoids such phenomena . • Finally ( Section 5 ) , we analyze the corresponding discrete FA dynamics and we prove convergence to the true labels with linear convergence rates . We assumed some conditions on the data and on the model in order to render the exposition and the reading more clear . However , some of the `` strong '' assumptions that will appear in the paper can be easily relaxed ( see Section 2 ) . 2 WARM-UP : SHALLOW NETWORKS . In this section , we consider a 2-layer linear NN with vector output ŷ = W2W1x ∈ Ro and input vector x ∈ Rd such that ( x , y ) ∼ D for some distribution D. Define Σxx : = E [ xx > ] ∈ Rd×d , that we assume to be positive definite , and Σxy : = E [ yx > ] ∈ Ro×d , then the following result holds : Proposition 1 . For any distribution D , the FA dynamics that dictates the learning process is Ẇ1 = M ( Σxy −W2W1Σxx ) , Ẇ2 = ( Σxy −W2W1Σxx ) W > 1 , ( 3 ) where the dot refers to the time derivative . Note that this result particularly holds for empirical distributions corresponding to finite datasets . In this work , we will assume that the two matrices Σxx , Σxy can be simultaneously decomposed as Σxx = V ΛxxV > and Σxy = UΛxyV > , where the latter corresponds to the singular value decomposition ( SVD ) of Σxy . This assumption holds in many situations , as discussed in details by Gidel et al . ( 2019 ) . Moreover , a perturbation analysis similar as the one done in Gidel et al . ( 2019 , Theorem 1 ) could be performed in the general case in order to handle the non-commutative case . Next , we introduce the change of variablesW1 = RW̃1V > andW2 = UW̃2R > , for some arbitrary left-orthogonal matrixR , and we choose the FA matrixM to be decomposable in a similar fashion : M = RDU > , for some matrixD with positive diagonal entriesDii > 0 and zero entries otherwise . In particular , this implies that M is full rank , therefore guaranteeing convergence to a global minimum of the dynamics . The equations for the FA flow will then become ˙̃W1 = D ( Λxy − W̃2W̃1Λxx ) ˙̃W2 = ( Λxy − W̃2W̃1Λxx ) W̃ > 1 . ( 4 ) Moreover , by the change of variableW ′1 : = W̃1Λ −1/2 xx , W ′2 : = Λ −1/2 xx W̃2 , D′ : = DΛ −1/2 xx where Λ 1/2 xx is the coordinate-wise square root of Λxx,1 we get after some simple calculations that Ẇ ′1 = D ′ ( Λ1/2xx ΛxyΛ −1/2 xx −W ′2W ′1 ) , Ẇ ′2 = ( Λ1/2xx ΛxyΛ −1/2 xx −W ′2W ′1 ) W ′1 > . ( 5 ) Therefore , by considering Λ′xy : = Λ 1/2 xx ΛxyΛ −1/2 xx , we may equivalently assume Σxx = Id ( isotropic features ) , without any loss of generality . It is now crucial to observe that ifW ′1 ∈ Rh×d , W ′2 ∈ Ro×h are diagonal matrices , then the dynamics decouples into k independent equations with k = min { d , h , o } . In particular , let θi1 = ( W ′1 ) ii and θi2 = ( W ′ 2 ) ii and assume that at time t = 0 the matricesW ′ 1 ( 0 ) andW ′ 2 ( 0 ) are diagonal . Then , for each i = 1 , . . . , k we obtain the following scalar system : θ̇i1 = d i ( λi − θi2θi1 ) θ̇i2 = ( λi − θi2θi1 ) θi1 , ( 6 ) where λi = ( Λxy ) ii and di = Dii . Note that for i > k one could define diagonal coefficients for the matricesW ′1 orW ′ 2 , but their derivative will be 0 , thus non-trivial dynamics only occur for i ∈ [ k ] .
This paper theoretically analyzes the Feedback Alignment (FA, Eqn 2) algorithm in the optimization of deep linear networks. * Under the assumption that the data matrices, FA matrices and initial weight matrices can be diagonalized simultaneously, the optimization can be divided into several one-dimensional problems, and the paper proves the convergence of both continuous and discrete dynamics. * After the diagonalization, each eigenvalue corresponds to a one-dimensional dynamics. The authors construct two types of initialization to show that the convergence for the larger eigenvalues can be either faster (implicit regularization) or slower (implicit anti-regularization) than the smaller eigenvalues. * Numerical comparison between FA and GD with 2- and 3-layer linear networks and random initialization. FA converges faster than GD and shares similar implicit regularization behavior.
SP:ccdbf06acb19e0daf05d6413fab38247db43537b
Convergence Analysis and Implicit Regularization of Feedback Alignment for Deep Linear Networks
1 INTRODUCTION . In order to train a Machine Learning ( ML ) architecture in the context of supervised learning , it is a consolidated practice to resort to the Gradient Descent ( GD ) algorithm and its variants ( e.g . stochastic GD ) and to calculate the gradient of the loss function via backpropagation ( Rumelhart et al. , 1986 ) . However , one of its limitations is the so-called weight transport problem ( Grossberg , 1987 ) : the update of each neuron during the learning phase relies on the downstream weights ( which are therefore `` transported '' along the backward pass ) . This implies that 1 ) the synaptic weights are the same , up to transposition , for both the forward ( inference ) and backward ( learning ) pass and 2 ) each neuron has a precise knowledge of all of its forward synapses . It is known that such a model does not accurately reflect the behaviour of a human brain , thus it is biologically implausible ( Crick , 1989 ) . Feedback Alignment ( FA ) , originally proposed by Lillicrap ( Lillicrap et al. , 2016 ) , has been an attempt to mitigate this discrepancy between the neuroscience side and the engineering side of AI and to tackle the weight transport problem in a systematic way . The simple , yet powerful idea is to replace the transposed weight matrices in the backpropagation algorithm with arbitrary , fixed matrices : via this strategy , each neuron during training receives a random projection of the error vector . In order to illustrate the algorithm and for the purpose of our study , let us consider a fully-connected L-layer neural network ( NN ) : given the input , x = h0 ∈ Rd , the predicted label ŷ ∈ Ro is computed as a ` = W ` h ` −1 , h ` = σ ( a ` ) , ` ∈ { 1 , . . . , L } : = [ L ] , ( 1 ) σ being a ( potentially ) nonlinear function applied entry-wise to the vector a ` , and finally ŷ = f ( aL ) for some output nonlinear function f . We consider a regression task with loss function L being the standard Mean Square Error ( MSE ) . The backpropagation strategy for GD prescribes the following updates for each layer in the network : given a step size η > 0 and the error vector e = δaL = ∂L∂ŷ = ŷ − y where y is the true label , we have δWL = −ηeh > L−1 , δW ` = −ηδa ` h > ` −1 and δa ` = ( W > ` +1δa ` +1 ) σ′ ( a ` ) , ` ∈ [ L−1 ] ( GD ) where denotes the Hadamard product . The FA recipe prescribes the following : Feedback Alignment : in ( GD ) use δa ` = ( M ` δa ` +1 ) σ′ ( a ` ) , ` ∈ [ L− 1 ] . ( 2 ) where { M ` } are a collection of arbitrarily chosen matrices , which do not evolve during training . Related and previous work . Inspired by Lillicrap et al . ( 2016 ) and shortly after its publication , Nøkland ( 2016 ) proposed two new algorithms called Direct and Inverse FA . In particular , Direct FA reduces to the FA algorithm in the case of a 2-layer NN or multi-layer linear NN ; the difference between these two algorithms in the general multi-layer nonlinear NN resides in injecting the error vector directly into the update of each hidden layer of the network : δa ` = ( M ` e ) σ′ ( a ` ) , ` ∈ [ 1 , L − 1 ] . Such a modification of the FA algorithm can be interpreted as a noisy version of layer-wise training ( Gilmer et al. , 2017 ) . Since its first formulation , there has been an extensive numerical analysis on testing whether FA and Direct FA algorithms can be successfully applied to ML problems , in particular in the presence of complex datasets and deep architectures ( Bartunov et al. , 2018 ; Moskovitz et al. , 2018 ; Launay et al. , 2019 ) . We mention the recent survey paper Launay et al . ( 2020 ) where the focus is on Direct FA and it is shown that the algorithm performs well in modern deep architectures ( Transformers and Graph NN , among others ) applied to problems like neural view synthesis or natural language processing . Furthermore , more on the applied ( biologically-inspired ) side , there have been recent pushes in furthering the idea of FA : spike-train level direct feedback alignment ( Lee et al. , 2020 ) , memory-efficient direct feedback alignment ( Chu et al. , 2020 ) and direct random target projection ( Frenkel et al. , 2021 ) to mention a few examples . On the other hand , rigorous theoretical results are scarce . Preliminary asymptotic results can be found in the original papers by Lillicrap et al . ( 2016 ) and Nøkland ( 2016 ) . More recently , Refinetti et al . ( 2020 ) presented the derivation of a system of differential equations that governs the Direct FA dynamics for a 2-layer non-linear NN in the regime where the input dimension goes to infinity . There is no explicit formula for the solution of the system , but via a careful local analysis it is possible to identify two separate phases of learning ( alignment and memorization ) and a `` degeneracy breaking '' effect : at the end of the FA training , the selected solution maximizes the overlap between the second weight matrix W2 and the FA matrix M . Such an `` alignment '' dynamics is also evident in our analysis ( Section 2 ) . Convergence guarantees for deep networks are still missing from the literature and one of the goals of this paper is indeed to provide rigorous proofs of convergence , together with convergence rates . Our analysis is in a similar vein as some recent works on implicit regularization in linear neural networks Saxe et al . ( 2018 ) ; Gidel et al . ( 2019 ) ; Arora et al . ( 2018 ) . Even though our setting is very similar , our analysis is different : because of the feedback alignment matrices , the autonomous differential equation obtained significantly differ and lead to different dynamics . Moreover our focus is slightly different from Saxe et al . ( 2018 ) ; Gidel et al . ( 2019 ) ; Arora et al . ( 2018 ) which are fully dedicated to implicit regularization of GD while we also aim at proving the convergence of FA . Our contributions . We aim to provide a theoretical understanding of how and when FA works . We focus on two aspects : 1 ) proving convergence of the algorithm and 2 ) analyzing implicit regularization phenomena . We will extensively study the case of deep linear NNs . Despite being sometimes regarded as too simplistic , the study of linear networks is a crucial starting point for a systematic analysis of the FA algorithm : it will allow us to rigorously analyze a tractable model and it will give us insights and intuition on the general nonlinear setting ( Section 7 ) . Our main results are the following . • We prove convergence of the FA continuous dynamics , with rates , for L-layer NNs with L ≥ 2 ( Sections 2 and 3 ) . Such results hold for any input dimension and number of neurons : the network is not necessarily overparametrized . • We prove that , for certain initialization schemes , the continuous FA dynamics sequentially learn the solutions of a reduced-rank regression problem , but in a backward fashion : smaller components first , dominant components later ( Section 4 ) . Additionally , we provide guidelines for an initialization scheme that avoids such phenomena . • Finally ( Section 5 ) , we analyze the corresponding discrete FA dynamics and we prove convergence to the true labels with linear convergence rates . We assumed some conditions on the data and on the model in order to render the exposition and the reading more clear . However , some of the `` strong '' assumptions that will appear in the paper can be easily relaxed ( see Section 2 ) . 2 WARM-UP : SHALLOW NETWORKS . In this section , we consider a 2-layer linear NN with vector output ŷ = W2W1x ∈ Ro and input vector x ∈ Rd such that ( x , y ) ∼ D for some distribution D. Define Σxx : = E [ xx > ] ∈ Rd×d , that we assume to be positive definite , and Σxy : = E [ yx > ] ∈ Ro×d , then the following result holds : Proposition 1 . For any distribution D , the FA dynamics that dictates the learning process is Ẇ1 = M ( Σxy −W2W1Σxx ) , Ẇ2 = ( Σxy −W2W1Σxx ) W > 1 , ( 3 ) where the dot refers to the time derivative . Note that this result particularly holds for empirical distributions corresponding to finite datasets . In this work , we will assume that the two matrices Σxx , Σxy can be simultaneously decomposed as Σxx = V ΛxxV > and Σxy = UΛxyV > , where the latter corresponds to the singular value decomposition ( SVD ) of Σxy . This assumption holds in many situations , as discussed in details by Gidel et al . ( 2019 ) . Moreover , a perturbation analysis similar as the one done in Gidel et al . ( 2019 , Theorem 1 ) could be performed in the general case in order to handle the non-commutative case . Next , we introduce the change of variablesW1 = RW̃1V > andW2 = UW̃2R > , for some arbitrary left-orthogonal matrixR , and we choose the FA matrixM to be decomposable in a similar fashion : M = RDU > , for some matrixD with positive diagonal entriesDii > 0 and zero entries otherwise . In particular , this implies that M is full rank , therefore guaranteeing convergence to a global minimum of the dynamics . The equations for the FA flow will then become ˙̃W1 = D ( Λxy − W̃2W̃1Λxx ) ˙̃W2 = ( Λxy − W̃2W̃1Λxx ) W̃ > 1 . ( 4 ) Moreover , by the change of variableW ′1 : = W̃1Λ −1/2 xx , W ′2 : = Λ −1/2 xx W̃2 , D′ : = DΛ −1/2 xx where Λ 1/2 xx is the coordinate-wise square root of Λxx,1 we get after some simple calculations that Ẇ ′1 = D ′ ( Λ1/2xx ΛxyΛ −1/2 xx −W ′2W ′1 ) , Ẇ ′2 = ( Λ1/2xx ΛxyΛ −1/2 xx −W ′2W ′1 ) W ′1 > . ( 5 ) Therefore , by considering Λ′xy : = Λ 1/2 xx ΛxyΛ −1/2 xx , we may equivalently assume Σxx = Id ( isotropic features ) , without any loss of generality . It is now crucial to observe that ifW ′1 ∈ Rh×d , W ′2 ∈ Ro×h are diagonal matrices , then the dynamics decouples into k independent equations with k = min { d , h , o } . In particular , let θi1 = ( W ′1 ) ii and θi2 = ( W ′ 2 ) ii and assume that at time t = 0 the matricesW ′ 1 ( 0 ) andW ′ 2 ( 0 ) are diagonal . Then , for each i = 1 , . . . , k we obtain the following scalar system : θ̇i1 = d i ( λi − θi2θi1 ) θ̇i2 = ( λi − θi2θi1 ) θi1 , ( 6 ) where λi = ( Λxy ) ii and di = Dii . Note that for i > k one could define diagonal coefficients for the matricesW ′1 orW ′ 2 , but their derivative will be 0 , thus non-trivial dynamics only occur for i ∈ [ k ] .
The authors study feedback alignment (FA, Lillicrap '14), an alternative algorithm to the standard backpropagation algorithm to train neural networks. The key idea is to replace the weight matrices of the network with fixed, random "feedback matrices" when computing the weight updates while training the network. A precise understanding how such a learning rule can lead to learning remains an open question, and has recently attracted some interest (see related works) Here, the authors study the dynamics of learning with FA in (deep) linear neural networks. The dynamics of linear neural networks trained with backpropagation has been studied extensively, thus providing an ideal test bed for this study. The authors derive a set of continuous-time equations governing the dynamics of FA for linear networks, discussing in detail their assumptions etc. They use these equations to discover an interesting implicit bias of FA: for certain initialisations, features of the data are learnt in the *inverse* order of importance, quantified by the singular value associated with each mode of the data. For other initialisations, features are learnt in the order of importance, as expected. The sensitivity of this bias to the initialisation doesn't appear in backprop. Finally, the authors also study linear auto-encoders trained with FA, and find that not FA does not only recover (a rotation of) the eigenvectors, but that it also speeds up training significantly. They also study the discrete-step dynamics of FA.
SP:ccdbf06acb19e0daf05d6413fab38247db43537b
Convergence Analysis and Implicit Regularization of Feedback Alignment for Deep Linear Networks
1 INTRODUCTION . In order to train a Machine Learning ( ML ) architecture in the context of supervised learning , it is a consolidated practice to resort to the Gradient Descent ( GD ) algorithm and its variants ( e.g . stochastic GD ) and to calculate the gradient of the loss function via backpropagation ( Rumelhart et al. , 1986 ) . However , one of its limitations is the so-called weight transport problem ( Grossberg , 1987 ) : the update of each neuron during the learning phase relies on the downstream weights ( which are therefore `` transported '' along the backward pass ) . This implies that 1 ) the synaptic weights are the same , up to transposition , for both the forward ( inference ) and backward ( learning ) pass and 2 ) each neuron has a precise knowledge of all of its forward synapses . It is known that such a model does not accurately reflect the behaviour of a human brain , thus it is biologically implausible ( Crick , 1989 ) . Feedback Alignment ( FA ) , originally proposed by Lillicrap ( Lillicrap et al. , 2016 ) , has been an attempt to mitigate this discrepancy between the neuroscience side and the engineering side of AI and to tackle the weight transport problem in a systematic way . The simple , yet powerful idea is to replace the transposed weight matrices in the backpropagation algorithm with arbitrary , fixed matrices : via this strategy , each neuron during training receives a random projection of the error vector . In order to illustrate the algorithm and for the purpose of our study , let us consider a fully-connected L-layer neural network ( NN ) : given the input , x = h0 ∈ Rd , the predicted label ŷ ∈ Ro is computed as a ` = W ` h ` −1 , h ` = σ ( a ` ) , ` ∈ { 1 , . . . , L } : = [ L ] , ( 1 ) σ being a ( potentially ) nonlinear function applied entry-wise to the vector a ` , and finally ŷ = f ( aL ) for some output nonlinear function f . We consider a regression task with loss function L being the standard Mean Square Error ( MSE ) . The backpropagation strategy for GD prescribes the following updates for each layer in the network : given a step size η > 0 and the error vector e = δaL = ∂L∂ŷ = ŷ − y where y is the true label , we have δWL = −ηeh > L−1 , δW ` = −ηδa ` h > ` −1 and δa ` = ( W > ` +1δa ` +1 ) σ′ ( a ` ) , ` ∈ [ L−1 ] ( GD ) where denotes the Hadamard product . The FA recipe prescribes the following : Feedback Alignment : in ( GD ) use δa ` = ( M ` δa ` +1 ) σ′ ( a ` ) , ` ∈ [ L− 1 ] . ( 2 ) where { M ` } are a collection of arbitrarily chosen matrices , which do not evolve during training . Related and previous work . Inspired by Lillicrap et al . ( 2016 ) and shortly after its publication , Nøkland ( 2016 ) proposed two new algorithms called Direct and Inverse FA . In particular , Direct FA reduces to the FA algorithm in the case of a 2-layer NN or multi-layer linear NN ; the difference between these two algorithms in the general multi-layer nonlinear NN resides in injecting the error vector directly into the update of each hidden layer of the network : δa ` = ( M ` e ) σ′ ( a ` ) , ` ∈ [ 1 , L − 1 ] . Such a modification of the FA algorithm can be interpreted as a noisy version of layer-wise training ( Gilmer et al. , 2017 ) . Since its first formulation , there has been an extensive numerical analysis on testing whether FA and Direct FA algorithms can be successfully applied to ML problems , in particular in the presence of complex datasets and deep architectures ( Bartunov et al. , 2018 ; Moskovitz et al. , 2018 ; Launay et al. , 2019 ) . We mention the recent survey paper Launay et al . ( 2020 ) where the focus is on Direct FA and it is shown that the algorithm performs well in modern deep architectures ( Transformers and Graph NN , among others ) applied to problems like neural view synthesis or natural language processing . Furthermore , more on the applied ( biologically-inspired ) side , there have been recent pushes in furthering the idea of FA : spike-train level direct feedback alignment ( Lee et al. , 2020 ) , memory-efficient direct feedback alignment ( Chu et al. , 2020 ) and direct random target projection ( Frenkel et al. , 2021 ) to mention a few examples . On the other hand , rigorous theoretical results are scarce . Preliminary asymptotic results can be found in the original papers by Lillicrap et al . ( 2016 ) and Nøkland ( 2016 ) . More recently , Refinetti et al . ( 2020 ) presented the derivation of a system of differential equations that governs the Direct FA dynamics for a 2-layer non-linear NN in the regime where the input dimension goes to infinity . There is no explicit formula for the solution of the system , but via a careful local analysis it is possible to identify two separate phases of learning ( alignment and memorization ) and a `` degeneracy breaking '' effect : at the end of the FA training , the selected solution maximizes the overlap between the second weight matrix W2 and the FA matrix M . Such an `` alignment '' dynamics is also evident in our analysis ( Section 2 ) . Convergence guarantees for deep networks are still missing from the literature and one of the goals of this paper is indeed to provide rigorous proofs of convergence , together with convergence rates . Our analysis is in a similar vein as some recent works on implicit regularization in linear neural networks Saxe et al . ( 2018 ) ; Gidel et al . ( 2019 ) ; Arora et al . ( 2018 ) . Even though our setting is very similar , our analysis is different : because of the feedback alignment matrices , the autonomous differential equation obtained significantly differ and lead to different dynamics . Moreover our focus is slightly different from Saxe et al . ( 2018 ) ; Gidel et al . ( 2019 ) ; Arora et al . ( 2018 ) which are fully dedicated to implicit regularization of GD while we also aim at proving the convergence of FA . Our contributions . We aim to provide a theoretical understanding of how and when FA works . We focus on two aspects : 1 ) proving convergence of the algorithm and 2 ) analyzing implicit regularization phenomena . We will extensively study the case of deep linear NNs . Despite being sometimes regarded as too simplistic , the study of linear networks is a crucial starting point for a systematic analysis of the FA algorithm : it will allow us to rigorously analyze a tractable model and it will give us insights and intuition on the general nonlinear setting ( Section 7 ) . Our main results are the following . • We prove convergence of the FA continuous dynamics , with rates , for L-layer NNs with L ≥ 2 ( Sections 2 and 3 ) . Such results hold for any input dimension and number of neurons : the network is not necessarily overparametrized . • We prove that , for certain initialization schemes , the continuous FA dynamics sequentially learn the solutions of a reduced-rank regression problem , but in a backward fashion : smaller components first , dominant components later ( Section 4 ) . Additionally , we provide guidelines for an initialization scheme that avoids such phenomena . • Finally ( Section 5 ) , we analyze the corresponding discrete FA dynamics and we prove convergence to the true labels with linear convergence rates . We assumed some conditions on the data and on the model in order to render the exposition and the reading more clear . However , some of the `` strong '' assumptions that will appear in the paper can be easily relaxed ( see Section 2 ) . 2 WARM-UP : SHALLOW NETWORKS . In this section , we consider a 2-layer linear NN with vector output ŷ = W2W1x ∈ Ro and input vector x ∈ Rd such that ( x , y ) ∼ D for some distribution D. Define Σxx : = E [ xx > ] ∈ Rd×d , that we assume to be positive definite , and Σxy : = E [ yx > ] ∈ Ro×d , then the following result holds : Proposition 1 . For any distribution D , the FA dynamics that dictates the learning process is Ẇ1 = M ( Σxy −W2W1Σxx ) , Ẇ2 = ( Σxy −W2W1Σxx ) W > 1 , ( 3 ) where the dot refers to the time derivative . Note that this result particularly holds for empirical distributions corresponding to finite datasets . In this work , we will assume that the two matrices Σxx , Σxy can be simultaneously decomposed as Σxx = V ΛxxV > and Σxy = UΛxyV > , where the latter corresponds to the singular value decomposition ( SVD ) of Σxy . This assumption holds in many situations , as discussed in details by Gidel et al . ( 2019 ) . Moreover , a perturbation analysis similar as the one done in Gidel et al . ( 2019 , Theorem 1 ) could be performed in the general case in order to handle the non-commutative case . Next , we introduce the change of variablesW1 = RW̃1V > andW2 = UW̃2R > , for some arbitrary left-orthogonal matrixR , and we choose the FA matrixM to be decomposable in a similar fashion : M = RDU > , for some matrixD with positive diagonal entriesDii > 0 and zero entries otherwise . In particular , this implies that M is full rank , therefore guaranteeing convergence to a global minimum of the dynamics . The equations for the FA flow will then become ˙̃W1 = D ( Λxy − W̃2W̃1Λxx ) ˙̃W2 = ( Λxy − W̃2W̃1Λxx ) W̃ > 1 . ( 4 ) Moreover , by the change of variableW ′1 : = W̃1Λ −1/2 xx , W ′2 : = Λ −1/2 xx W̃2 , D′ : = DΛ −1/2 xx where Λ 1/2 xx is the coordinate-wise square root of Λxx,1 we get after some simple calculations that Ẇ ′1 = D ′ ( Λ1/2xx ΛxyΛ −1/2 xx −W ′2W ′1 ) , Ẇ ′2 = ( Λ1/2xx ΛxyΛ −1/2 xx −W ′2W ′1 ) W ′1 > . ( 5 ) Therefore , by considering Λ′xy : = Λ 1/2 xx ΛxyΛ −1/2 xx , we may equivalently assume Σxx = Id ( isotropic features ) , without any loss of generality . It is now crucial to observe that ifW ′1 ∈ Rh×d , W ′2 ∈ Ro×h are diagonal matrices , then the dynamics decouples into k independent equations with k = min { d , h , o } . In particular , let θi1 = ( W ′1 ) ii and θi2 = ( W ′ 2 ) ii and assume that at time t = 0 the matricesW ′ 1 ( 0 ) andW ′ 2 ( 0 ) are diagonal . Then , for each i = 1 , . . . , k we obtain the following scalar system : θ̇i1 = d i ( λi − θi2θi1 ) θ̇i2 = ( λi − θi2θi1 ) θi1 , ( 6 ) where λi = ( Λxy ) ii and di = Dii . Note that for i > k one could define diagonal coefficients for the matricesW ′1 orW ′ 2 , but their derivative will be 0 , thus non-trivial dynamics only occur for i ∈ [ k ] .
This paper studies the Feedback Alignment (FA) algorithm on deep linear networks. In continuous time, FA algorithm is an alternative to Gradient Flow (GF) In particular, to compute the time derivative of the weights, FA algorithm starts with the gradient of the weights at each layer, and replace the part that depends on the weights of succeeding layers by a fixed matrix. The FA algorithm on deep linear networks under spectral initialization is studied regarding both convergence and implicit bias, and the analysis are provided for both continuous-time and discrete-time FA algorithm.
SP:ccdbf06acb19e0daf05d6413fab38247db43537b
Disentanglement Analysis with Partial Information Decomposition
1 INTRODUCTION . Disentanglement is a guiding principle for designing a learned representation separable into parts that individually capture the underlying factors of variation . The concept is originally concerned as an inductive bias towards obtaining representations aligned with the underlying factors of variation in data ( Bengio et al. , 2013 ) and has been applied to controlling otherwise unstructured representations of data from several domains , e.g. , images ( Karras et al. , 2019 ; Esser et al. , 2019 ) , text ( Hu et al. , 2017 ) , and audio ( Hsu et al. , 2019 ) to name just a few . While the concept is appealing , defining disentanglement is not clear . After Higgins et al . ( 2017 ) , generative learning methods with regularized total correlation have been proposed ( Kim & Mnih , 2018 ; Chen et al. , 2018 ) ; however , it is still not clear if independence of latent variables is essential for better disentanglement ( Higgins et al. , 2018 ) . Furthermore , it is not obvious to measure disentanglement given true generative factors . Towards understanding disentanglement , it is crucial to define disentanglement metrics , for which several attempts have been made ( Higgins et al. , 2017 ; Kim & Mnih , 2018 ; Chen et al. , 2018 ; Eastwood & Williams , 2018 ; Do & Tran , 2020 ; Zaidi et al. , 2020 ) ; however , there are still problems to be solved . Current disentanglement metrics may fail to detect entanglement involving more than two variables . In these metrics , one first measures how each variable explains one generative factor and then compares or contrasts them among variables . With such a procedure , we may overlook multiple variables conveying information of one generative factor . For example , let z = ( z1 , z2 ) be a representation consisting of two vectors , where each variable in z1 disentangles a distinct generative factor and z2 is a rotation of z1 not axis-aligned with the factors . Since any dimension of z2 alone may convey little information of one generative factor , these metrics do not detect that multiple variables encode one generative factor redundantly . Although this is a simple example , this kind of information sharing may arise in learned representations as well , if not the variables are linearly correlated . In this work , we present a disentanglement analysis framework aware of interactions among multiple variables . Our key idea is to decompose the information of representation into entangled and disentangled components using Partial Information Decomposition ( PID ) , which is a framework in modern information theory to analyze information sharing among multiple random variables ( Williams & Beer , 2010 ) . As illustrated in Figure 1 , the mutual information I ( u ; v1 , v2 ) = E [ log p ( u , v1 , v2 ) p ( u ) p ( v1 , v2 ) ] between a random variable u and a pair of random variables ( v1 , v2 ) is decomposed into four nonnegative terms : unique information U ( u ; v1 \ v2 ) and U ( u ; v2 \ v1 ) 1 , redundant information R ( u ; v1 , v2 ) , and complementary ( or synergistic ) information C ( u ; v1 , v2 ) . While these partial information terms have no agreed-upon concrete definitions yet ( Bertschinger et al. , 2014 ; Finn & Lizier , 2018 ; Lizier et al. , 2018 ; Finn & Lizier , 2020 ; Sigtermans , 2020 ) , we can derive universal lower and upper bounds of the partial information terms only with well-defined mutual information terms . We apply the PID framework to representations learned from data by letting u be a generative factor and v1 , v2 be one and the remaining latent variables , respectively . The unique information of a latent variable intuitively corresponds to the amount of disentangled information , while the redundant and complementary information correspond to different types of entangled information . We can quantify disentanglement and multiple types of entanglement through the framework , which enriches our understanding on disentangled representations . Our contributions are summarized as follows . • PID-based disentanglement analysis framework : We propose a disentanglement analysis framework that captures interactions among multiple variables with PID . With this framework , one can distinguish two different types of entanglement , namely redundancy and synergy , which provide insights on how a representation entangles generative factors . • Tractable bounds of partial information terms : We derive lower and upper bounds of partial information terms . We formulate a disentanglement metric , called UNIBOUND , using the lower bound of unique information . We design entanglement attacks , which inject entanglement to a given disentangled representation , and confirm through experiments using them that UNIBOUND effectively captures entanglement involving multiple variables . • Detailed analyses of learned representations : We analyze representations obtained by variational autoencoders ( VAEs ) . We observe that UNIBOUND sometimes disagrees with other metrics , which indicates multi-variable interactions may dominate learned representations . We also observe that different types of entanglement arise in models learned with different methods . This observation provides us an insight that we may require distinct approaches to remove them for disentangled representation learning . PROBLEM FORMULATION AND NOTATIONS Let x be a random variable representing a data point , drawn uniformly from a dataset D. Assume that the true generative factors y = ( y1 , . . . , yK ) > are available for each data point ; in other words , we can access the subset D ( y ) ⊂ D of the data points with any fixed generative factors y . Let z = ( z1 , . . . , zL ) > be a latent representation consisting of L random variables . An inference model is provided as the conditional distribution p ( z|x ) . Our goal is to evaluate how well the latent variables z disentangle each generative factor in y . The inference model can integrate out the input as p ( ·|y ) = Ep ( x|y ) [ p ( ·|x ) ] = 1|D ( y ) | ∑ x∈D ( y ) p ( ·|x ) ; therefore , we only use y and z in most of our discussions . 1Note that this \ is not a set difference operator . It is just a common notation used in the PID literature to emphasize the unique information is not symmetric and resembles the set difference as depicted in Fig.1 . We denote the mutual information between random variables u and v by I ( u ; v ) = E [ log p ( u , v ) p ( u ) p ( v ) ] , the entropy of u by H ( u ) = −E [ log p ( u ) ] , and the conditional entropy of u given v by H ( u|v ) = −E [ log p ( u|v ) ] . We denote a vector of zeros by 0 , a vector of ones by 1 , and an identity matrix by I . We denote by N ( µ , Σ ) the Gaussian distribution with mean µ and covariance Σ and denote its density function by N ( · ; µ , Σ ) . 2 RELATED WORK . The importance of representing data with multiple variables conveying distinct information has been recognized at least since the ’ 80s ( Barlow , 1989 ; Barlow et al. , 1989 ; Schmidhuber , 1992 ) . The minimum entropy coding principle ( Watanabe , 1981 ) , which aims at representing data by random variables z with the sum of minimum marginal entropies ∑ ` H ( z ` ) , is found to be useful for unsupervised learning to remove the inherent redundancy in the sensory stimuli . The resulting representation minimizes the total correlation and is called factorial coding . Recent advancements in disentangled representation learning based on VAEs ( Kingma & Welling , 2014 ) are guided by the same principle as minimum entropy coding ( Kim & Mnih , 2018 ; Chen et al. , 2018 ; Gao et al. , 2019 ) . Understanding better representations , which is tackled from the coding side as above , is also approached from the generative perspective . It is often expected that data are generated from generative factors through a process that entangles them into high dimensional sensory space ( DiCarlo & Cox , 2007 ) . As generative factors are useful as the basis of downstream learning tasks , obtaining disentangled representations from data is a hot topic of representation learning ( Bengio et al. , 2013 ) . Towards learning disentangled representations , it is arguably important to quantitatively measure disentanglement . In that regard , Higgins et al . ( 2017 ) established a standard evaluation procedure using controlled datasets with balanced and fully-annotated ground-truth factors . A variety of metrics have then been proposed on the basis of the procedure . Among them , Higgins et al . ( 2017 ) and Kim & Mnih ( 2018 ) propose metrics based on the deviation of each latent variable conditioned by a generative factor . In contrast , Mutual Information Gap ( MIG ) ( Chen et al. , 2018 ) and its variants ( Do & Tran , 2020 ; Zaidi et al. , 2020 ) are based on mutual information between a latent variable and a generative factor . We extend the latter direction , considering multi-variable interactions . Barlow ( 1989 ) discussed redundancy by comparing the population and the individual variables by their entropies , i.e. , total correlation . It is though less trivial to measure redundancy as an information quantity . The PID framework ( Williams & Beer , 2010 ) provides an approach to understanding redundancy among multiple random variables as a constituent of mutual information . The framework provides some desirable relationships between decomposed information terms , while it leaves some degrees of freedom to determine all of them , for which several definitions have been proposed ( Williams & Beer , 2010 ; Bertschinger et al. , 2014 ; Finn & Lizier , 2018 ; 2020 ; Sigtermans , 2020 ) . The PID framework has been applied to machine learning models . For example , Tax et al . ( 2017 ) measured the PID terms for restricted Boltzmann machines using the definition of Williams & Beer ( 2010 ) . Yu et al . ( 2021 ) took an alternative route , similar to our approach , where they measured linear combinations of PID terms by corresponding linear combinations of mutual information terms . These work aims at analyzing the learning dynamics of models in supervised settings . In contrast , we use the PID framework for analyzing disentanglement in unsupervised representation learning . 3 PARTIAL INFORMATION DECOMPOSITION FOR DISENTANGLEMENT . In this section , we analyze the current metrics and introduce our framework . In Section 3.1 , we introduce PID of the system we concern . In Section 3.2 , we investigate the current metrics in terms of multi-variable interactions . In Section 3.3 and 3.4 , we construct our disentanglement metric with bounds for PID terms . We provide a method of computing the bounds in Section 3.5 . 3.1 PARTIAL INFORMATION DECOMPOSITION . We tackle the problem of evaluating disentanglement of a latent representation z relative to the true generative factors y from an information-theoretic perspective . Let us consider evaluating how one generative factor yk is captured by the latent representation z . The information of yk captured by z is measured using mutual information I ( yk ; z ) = H ( z ) −H ( z|yk ) . In a desirably disentangled representation , we expect one of the latent variables z ` to exclusively capture the information of the factor yk . To evaluate a given representation , we are interested in understanding how the information is distributed between a latent variable z ` and the remaining representation z\ ` = ( z ` ′ ) ` ′ 6= ` . This is best described by the PID framework , where the mutual information is decomposed into the following four terms . I ( yk ; z ) = R ( yk ; z ` , z\ ` ) + U ( yk ; z ` \ z\ ` ) + U ( yk ; z\ ` \ z ` ) + C ( yk ; z ` , z\ ` ) . ( 1 ) Here , the decomposed terms represent the following non-negative quantities . • Redundant informationR ( yk ; z ` , z\ ` ) is the information of yk held by both z ` and z\ ` . • Unique information U ( yk ; z ` \ z\ ` ) is the information of yk held by z ` and not held by z\ ` . The opposite term U ( yk ; z\ ` \ z ` ) is also defined by exchanging the roles of z ` and z\ ` . • Complementary information ( or synergistic information ) C ( yk ; z ` , z\ ` ) is the information of yk held by z = ( z ` , z\ ` ) that is not held by either z ` or z\ ` alone . The following identities , combined with Eq.1 , partially characterize each term . I ( yk ; z ` ) = R ( yk ; z ` , z\ ` ) + U ( yk ; z ` \ z\ ` ) , I ( yk ; z\ ` ) = R ( yk ; z ` , z\ ` ) + U ( yk ; z\ ` \ z ` ) . ( 2 ) The decomposition of this system is illustrated in Figure 2a . We expect disentangled representations to concentrate the information of yk to a single latent variable z ` , and to let the other variables z\ ` not convey the information in either unique , redundant , or synergistic ways . This is understood in terms of PID as maximizing the unique information U ( yk ; z ` \ z\ ` ) while minimizing the other parts of the decomposition . The above formulation is incomplete as one degree of freedom remains to determine the four terms with the three equalities . Instead of stepping into searching for suitable definitions of these terms , we build discussions applicable to any such definitions that fulfill the above incomplete requirements2 .
The paper proposes a novel disentanglement metric 'Unibound'. To construct the metric the method uses partial information decomposition, which decomposes the the mutual information between the latent variables and the labels into a sum of other information terms with specific roles: - Redundant information - Unique information - Complementary information Each of these terms are precisely defined and an intuitive explanation os given. The proposed UnibBund metric is defined similarly to MIG based on the above terms. The main difference is that UnibBund uses a better composition than MIG, that: - better captures our intuitive notion of disentanglement - handles adversarial representation attacks better
SP:bb6518fbc06695f3535e06a740b1e0f4ee72d318
Disentanglement Analysis with Partial Information Decomposition
1 INTRODUCTION . Disentanglement is a guiding principle for designing a learned representation separable into parts that individually capture the underlying factors of variation . The concept is originally concerned as an inductive bias towards obtaining representations aligned with the underlying factors of variation in data ( Bengio et al. , 2013 ) and has been applied to controlling otherwise unstructured representations of data from several domains , e.g. , images ( Karras et al. , 2019 ; Esser et al. , 2019 ) , text ( Hu et al. , 2017 ) , and audio ( Hsu et al. , 2019 ) to name just a few . While the concept is appealing , defining disentanglement is not clear . After Higgins et al . ( 2017 ) , generative learning methods with regularized total correlation have been proposed ( Kim & Mnih , 2018 ; Chen et al. , 2018 ) ; however , it is still not clear if independence of latent variables is essential for better disentanglement ( Higgins et al. , 2018 ) . Furthermore , it is not obvious to measure disentanglement given true generative factors . Towards understanding disentanglement , it is crucial to define disentanglement metrics , for which several attempts have been made ( Higgins et al. , 2017 ; Kim & Mnih , 2018 ; Chen et al. , 2018 ; Eastwood & Williams , 2018 ; Do & Tran , 2020 ; Zaidi et al. , 2020 ) ; however , there are still problems to be solved . Current disentanglement metrics may fail to detect entanglement involving more than two variables . In these metrics , one first measures how each variable explains one generative factor and then compares or contrasts them among variables . With such a procedure , we may overlook multiple variables conveying information of one generative factor . For example , let z = ( z1 , z2 ) be a representation consisting of two vectors , where each variable in z1 disentangles a distinct generative factor and z2 is a rotation of z1 not axis-aligned with the factors . Since any dimension of z2 alone may convey little information of one generative factor , these metrics do not detect that multiple variables encode one generative factor redundantly . Although this is a simple example , this kind of information sharing may arise in learned representations as well , if not the variables are linearly correlated . In this work , we present a disentanglement analysis framework aware of interactions among multiple variables . Our key idea is to decompose the information of representation into entangled and disentangled components using Partial Information Decomposition ( PID ) , which is a framework in modern information theory to analyze information sharing among multiple random variables ( Williams & Beer , 2010 ) . As illustrated in Figure 1 , the mutual information I ( u ; v1 , v2 ) = E [ log p ( u , v1 , v2 ) p ( u ) p ( v1 , v2 ) ] between a random variable u and a pair of random variables ( v1 , v2 ) is decomposed into four nonnegative terms : unique information U ( u ; v1 \ v2 ) and U ( u ; v2 \ v1 ) 1 , redundant information R ( u ; v1 , v2 ) , and complementary ( or synergistic ) information C ( u ; v1 , v2 ) . While these partial information terms have no agreed-upon concrete definitions yet ( Bertschinger et al. , 2014 ; Finn & Lizier , 2018 ; Lizier et al. , 2018 ; Finn & Lizier , 2020 ; Sigtermans , 2020 ) , we can derive universal lower and upper bounds of the partial information terms only with well-defined mutual information terms . We apply the PID framework to representations learned from data by letting u be a generative factor and v1 , v2 be one and the remaining latent variables , respectively . The unique information of a latent variable intuitively corresponds to the amount of disentangled information , while the redundant and complementary information correspond to different types of entangled information . We can quantify disentanglement and multiple types of entanglement through the framework , which enriches our understanding on disentangled representations . Our contributions are summarized as follows . • PID-based disentanglement analysis framework : We propose a disentanglement analysis framework that captures interactions among multiple variables with PID . With this framework , one can distinguish two different types of entanglement , namely redundancy and synergy , which provide insights on how a representation entangles generative factors . • Tractable bounds of partial information terms : We derive lower and upper bounds of partial information terms . We formulate a disentanglement metric , called UNIBOUND , using the lower bound of unique information . We design entanglement attacks , which inject entanglement to a given disentangled representation , and confirm through experiments using them that UNIBOUND effectively captures entanglement involving multiple variables . • Detailed analyses of learned representations : We analyze representations obtained by variational autoencoders ( VAEs ) . We observe that UNIBOUND sometimes disagrees with other metrics , which indicates multi-variable interactions may dominate learned representations . We also observe that different types of entanglement arise in models learned with different methods . This observation provides us an insight that we may require distinct approaches to remove them for disentangled representation learning . PROBLEM FORMULATION AND NOTATIONS Let x be a random variable representing a data point , drawn uniformly from a dataset D. Assume that the true generative factors y = ( y1 , . . . , yK ) > are available for each data point ; in other words , we can access the subset D ( y ) ⊂ D of the data points with any fixed generative factors y . Let z = ( z1 , . . . , zL ) > be a latent representation consisting of L random variables . An inference model is provided as the conditional distribution p ( z|x ) . Our goal is to evaluate how well the latent variables z disentangle each generative factor in y . The inference model can integrate out the input as p ( ·|y ) = Ep ( x|y ) [ p ( ·|x ) ] = 1|D ( y ) | ∑ x∈D ( y ) p ( ·|x ) ; therefore , we only use y and z in most of our discussions . 1Note that this \ is not a set difference operator . It is just a common notation used in the PID literature to emphasize the unique information is not symmetric and resembles the set difference as depicted in Fig.1 . We denote the mutual information between random variables u and v by I ( u ; v ) = E [ log p ( u , v ) p ( u ) p ( v ) ] , the entropy of u by H ( u ) = −E [ log p ( u ) ] , and the conditional entropy of u given v by H ( u|v ) = −E [ log p ( u|v ) ] . We denote a vector of zeros by 0 , a vector of ones by 1 , and an identity matrix by I . We denote by N ( µ , Σ ) the Gaussian distribution with mean µ and covariance Σ and denote its density function by N ( · ; µ , Σ ) . 2 RELATED WORK . The importance of representing data with multiple variables conveying distinct information has been recognized at least since the ’ 80s ( Barlow , 1989 ; Barlow et al. , 1989 ; Schmidhuber , 1992 ) . The minimum entropy coding principle ( Watanabe , 1981 ) , which aims at representing data by random variables z with the sum of minimum marginal entropies ∑ ` H ( z ` ) , is found to be useful for unsupervised learning to remove the inherent redundancy in the sensory stimuli . The resulting representation minimizes the total correlation and is called factorial coding . Recent advancements in disentangled representation learning based on VAEs ( Kingma & Welling , 2014 ) are guided by the same principle as minimum entropy coding ( Kim & Mnih , 2018 ; Chen et al. , 2018 ; Gao et al. , 2019 ) . Understanding better representations , which is tackled from the coding side as above , is also approached from the generative perspective . It is often expected that data are generated from generative factors through a process that entangles them into high dimensional sensory space ( DiCarlo & Cox , 2007 ) . As generative factors are useful as the basis of downstream learning tasks , obtaining disentangled representations from data is a hot topic of representation learning ( Bengio et al. , 2013 ) . Towards learning disentangled representations , it is arguably important to quantitatively measure disentanglement . In that regard , Higgins et al . ( 2017 ) established a standard evaluation procedure using controlled datasets with balanced and fully-annotated ground-truth factors . A variety of metrics have then been proposed on the basis of the procedure . Among them , Higgins et al . ( 2017 ) and Kim & Mnih ( 2018 ) propose metrics based on the deviation of each latent variable conditioned by a generative factor . In contrast , Mutual Information Gap ( MIG ) ( Chen et al. , 2018 ) and its variants ( Do & Tran , 2020 ; Zaidi et al. , 2020 ) are based on mutual information between a latent variable and a generative factor . We extend the latter direction , considering multi-variable interactions . Barlow ( 1989 ) discussed redundancy by comparing the population and the individual variables by their entropies , i.e. , total correlation . It is though less trivial to measure redundancy as an information quantity . The PID framework ( Williams & Beer , 2010 ) provides an approach to understanding redundancy among multiple random variables as a constituent of mutual information . The framework provides some desirable relationships between decomposed information terms , while it leaves some degrees of freedom to determine all of them , for which several definitions have been proposed ( Williams & Beer , 2010 ; Bertschinger et al. , 2014 ; Finn & Lizier , 2018 ; 2020 ; Sigtermans , 2020 ) . The PID framework has been applied to machine learning models . For example , Tax et al . ( 2017 ) measured the PID terms for restricted Boltzmann machines using the definition of Williams & Beer ( 2010 ) . Yu et al . ( 2021 ) took an alternative route , similar to our approach , where they measured linear combinations of PID terms by corresponding linear combinations of mutual information terms . These work aims at analyzing the learning dynamics of models in supervised settings . In contrast , we use the PID framework for analyzing disentanglement in unsupervised representation learning . 3 PARTIAL INFORMATION DECOMPOSITION FOR DISENTANGLEMENT . In this section , we analyze the current metrics and introduce our framework . In Section 3.1 , we introduce PID of the system we concern . In Section 3.2 , we investigate the current metrics in terms of multi-variable interactions . In Section 3.3 and 3.4 , we construct our disentanglement metric with bounds for PID terms . We provide a method of computing the bounds in Section 3.5 . 3.1 PARTIAL INFORMATION DECOMPOSITION . We tackle the problem of evaluating disentanglement of a latent representation z relative to the true generative factors y from an information-theoretic perspective . Let us consider evaluating how one generative factor yk is captured by the latent representation z . The information of yk captured by z is measured using mutual information I ( yk ; z ) = H ( z ) −H ( z|yk ) . In a desirably disentangled representation , we expect one of the latent variables z ` to exclusively capture the information of the factor yk . To evaluate a given representation , we are interested in understanding how the information is distributed between a latent variable z ` and the remaining representation z\ ` = ( z ` ′ ) ` ′ 6= ` . This is best described by the PID framework , where the mutual information is decomposed into the following four terms . I ( yk ; z ) = R ( yk ; z ` , z\ ` ) + U ( yk ; z ` \ z\ ` ) + U ( yk ; z\ ` \ z ` ) + C ( yk ; z ` , z\ ` ) . ( 1 ) Here , the decomposed terms represent the following non-negative quantities . • Redundant informationR ( yk ; z ` , z\ ` ) is the information of yk held by both z ` and z\ ` . • Unique information U ( yk ; z ` \ z\ ` ) is the information of yk held by z ` and not held by z\ ` . The opposite term U ( yk ; z\ ` \ z ` ) is also defined by exchanging the roles of z ` and z\ ` . • Complementary information ( or synergistic information ) C ( yk ; z ` , z\ ` ) is the information of yk held by z = ( z ` , z\ ` ) that is not held by either z ` or z\ ` alone . The following identities , combined with Eq.1 , partially characterize each term . I ( yk ; z ` ) = R ( yk ; z ` , z\ ` ) + U ( yk ; z ` \ z\ ` ) , I ( yk ; z\ ` ) = R ( yk ; z ` , z\ ` ) + U ( yk ; z\ ` \ z ` ) . ( 2 ) The decomposition of this system is illustrated in Figure 2a . We expect disentangled representations to concentrate the information of yk to a single latent variable z ` , and to let the other variables z\ ` not convey the information in either unique , redundant , or synergistic ways . This is understood in terms of PID as maximizing the unique information U ( yk ; z ` \ z\ ` ) while minimizing the other parts of the decomposition . The above formulation is incomplete as one degree of freedom remains to determine the four terms with the three equalities . Instead of stepping into searching for suitable definitions of these terms , we build discussions applicable to any such definitions that fulfill the above incomplete requirements2 .
The authors leveraged partial information decomposition (PID) for analyzing multi-variable interactions in latent representations. The PID framework shows that (i) the mutual information between a latent variable and a generative factor can be divided into unique, redundant, and synergistic information terms, and (ii) the uniqueness term corresponds to the degree of disentanglement. The authors also introduced a disentanglement metric by modifying MIG and conducted experiments with VAE-based models on two datasets.
SP:bb6518fbc06695f3535e06a740b1e0f4ee72d318
Disentanglement Analysis with Partial Information Decomposition
1 INTRODUCTION . Disentanglement is a guiding principle for designing a learned representation separable into parts that individually capture the underlying factors of variation . The concept is originally concerned as an inductive bias towards obtaining representations aligned with the underlying factors of variation in data ( Bengio et al. , 2013 ) and has been applied to controlling otherwise unstructured representations of data from several domains , e.g. , images ( Karras et al. , 2019 ; Esser et al. , 2019 ) , text ( Hu et al. , 2017 ) , and audio ( Hsu et al. , 2019 ) to name just a few . While the concept is appealing , defining disentanglement is not clear . After Higgins et al . ( 2017 ) , generative learning methods with regularized total correlation have been proposed ( Kim & Mnih , 2018 ; Chen et al. , 2018 ) ; however , it is still not clear if independence of latent variables is essential for better disentanglement ( Higgins et al. , 2018 ) . Furthermore , it is not obvious to measure disentanglement given true generative factors . Towards understanding disentanglement , it is crucial to define disentanglement metrics , for which several attempts have been made ( Higgins et al. , 2017 ; Kim & Mnih , 2018 ; Chen et al. , 2018 ; Eastwood & Williams , 2018 ; Do & Tran , 2020 ; Zaidi et al. , 2020 ) ; however , there are still problems to be solved . Current disentanglement metrics may fail to detect entanglement involving more than two variables . In these metrics , one first measures how each variable explains one generative factor and then compares or contrasts them among variables . With such a procedure , we may overlook multiple variables conveying information of one generative factor . For example , let z = ( z1 , z2 ) be a representation consisting of two vectors , where each variable in z1 disentangles a distinct generative factor and z2 is a rotation of z1 not axis-aligned with the factors . Since any dimension of z2 alone may convey little information of one generative factor , these metrics do not detect that multiple variables encode one generative factor redundantly . Although this is a simple example , this kind of information sharing may arise in learned representations as well , if not the variables are linearly correlated . In this work , we present a disentanglement analysis framework aware of interactions among multiple variables . Our key idea is to decompose the information of representation into entangled and disentangled components using Partial Information Decomposition ( PID ) , which is a framework in modern information theory to analyze information sharing among multiple random variables ( Williams & Beer , 2010 ) . As illustrated in Figure 1 , the mutual information I ( u ; v1 , v2 ) = E [ log p ( u , v1 , v2 ) p ( u ) p ( v1 , v2 ) ] between a random variable u and a pair of random variables ( v1 , v2 ) is decomposed into four nonnegative terms : unique information U ( u ; v1 \ v2 ) and U ( u ; v2 \ v1 ) 1 , redundant information R ( u ; v1 , v2 ) , and complementary ( or synergistic ) information C ( u ; v1 , v2 ) . While these partial information terms have no agreed-upon concrete definitions yet ( Bertschinger et al. , 2014 ; Finn & Lizier , 2018 ; Lizier et al. , 2018 ; Finn & Lizier , 2020 ; Sigtermans , 2020 ) , we can derive universal lower and upper bounds of the partial information terms only with well-defined mutual information terms . We apply the PID framework to representations learned from data by letting u be a generative factor and v1 , v2 be one and the remaining latent variables , respectively . The unique information of a latent variable intuitively corresponds to the amount of disentangled information , while the redundant and complementary information correspond to different types of entangled information . We can quantify disentanglement and multiple types of entanglement through the framework , which enriches our understanding on disentangled representations . Our contributions are summarized as follows . • PID-based disentanglement analysis framework : We propose a disentanglement analysis framework that captures interactions among multiple variables with PID . With this framework , one can distinguish two different types of entanglement , namely redundancy and synergy , which provide insights on how a representation entangles generative factors . • Tractable bounds of partial information terms : We derive lower and upper bounds of partial information terms . We formulate a disentanglement metric , called UNIBOUND , using the lower bound of unique information . We design entanglement attacks , which inject entanglement to a given disentangled representation , and confirm through experiments using them that UNIBOUND effectively captures entanglement involving multiple variables . • Detailed analyses of learned representations : We analyze representations obtained by variational autoencoders ( VAEs ) . We observe that UNIBOUND sometimes disagrees with other metrics , which indicates multi-variable interactions may dominate learned representations . We also observe that different types of entanglement arise in models learned with different methods . This observation provides us an insight that we may require distinct approaches to remove them for disentangled representation learning . PROBLEM FORMULATION AND NOTATIONS Let x be a random variable representing a data point , drawn uniformly from a dataset D. Assume that the true generative factors y = ( y1 , . . . , yK ) > are available for each data point ; in other words , we can access the subset D ( y ) ⊂ D of the data points with any fixed generative factors y . Let z = ( z1 , . . . , zL ) > be a latent representation consisting of L random variables . An inference model is provided as the conditional distribution p ( z|x ) . Our goal is to evaluate how well the latent variables z disentangle each generative factor in y . The inference model can integrate out the input as p ( ·|y ) = Ep ( x|y ) [ p ( ·|x ) ] = 1|D ( y ) | ∑ x∈D ( y ) p ( ·|x ) ; therefore , we only use y and z in most of our discussions . 1Note that this \ is not a set difference operator . It is just a common notation used in the PID literature to emphasize the unique information is not symmetric and resembles the set difference as depicted in Fig.1 . We denote the mutual information between random variables u and v by I ( u ; v ) = E [ log p ( u , v ) p ( u ) p ( v ) ] , the entropy of u by H ( u ) = −E [ log p ( u ) ] , and the conditional entropy of u given v by H ( u|v ) = −E [ log p ( u|v ) ] . We denote a vector of zeros by 0 , a vector of ones by 1 , and an identity matrix by I . We denote by N ( µ , Σ ) the Gaussian distribution with mean µ and covariance Σ and denote its density function by N ( · ; µ , Σ ) . 2 RELATED WORK . The importance of representing data with multiple variables conveying distinct information has been recognized at least since the ’ 80s ( Barlow , 1989 ; Barlow et al. , 1989 ; Schmidhuber , 1992 ) . The minimum entropy coding principle ( Watanabe , 1981 ) , which aims at representing data by random variables z with the sum of minimum marginal entropies ∑ ` H ( z ` ) , is found to be useful for unsupervised learning to remove the inherent redundancy in the sensory stimuli . The resulting representation minimizes the total correlation and is called factorial coding . Recent advancements in disentangled representation learning based on VAEs ( Kingma & Welling , 2014 ) are guided by the same principle as minimum entropy coding ( Kim & Mnih , 2018 ; Chen et al. , 2018 ; Gao et al. , 2019 ) . Understanding better representations , which is tackled from the coding side as above , is also approached from the generative perspective . It is often expected that data are generated from generative factors through a process that entangles them into high dimensional sensory space ( DiCarlo & Cox , 2007 ) . As generative factors are useful as the basis of downstream learning tasks , obtaining disentangled representations from data is a hot topic of representation learning ( Bengio et al. , 2013 ) . Towards learning disentangled representations , it is arguably important to quantitatively measure disentanglement . In that regard , Higgins et al . ( 2017 ) established a standard evaluation procedure using controlled datasets with balanced and fully-annotated ground-truth factors . A variety of metrics have then been proposed on the basis of the procedure . Among them , Higgins et al . ( 2017 ) and Kim & Mnih ( 2018 ) propose metrics based on the deviation of each latent variable conditioned by a generative factor . In contrast , Mutual Information Gap ( MIG ) ( Chen et al. , 2018 ) and its variants ( Do & Tran , 2020 ; Zaidi et al. , 2020 ) are based on mutual information between a latent variable and a generative factor . We extend the latter direction , considering multi-variable interactions . Barlow ( 1989 ) discussed redundancy by comparing the population and the individual variables by their entropies , i.e. , total correlation . It is though less trivial to measure redundancy as an information quantity . The PID framework ( Williams & Beer , 2010 ) provides an approach to understanding redundancy among multiple random variables as a constituent of mutual information . The framework provides some desirable relationships between decomposed information terms , while it leaves some degrees of freedom to determine all of them , for which several definitions have been proposed ( Williams & Beer , 2010 ; Bertschinger et al. , 2014 ; Finn & Lizier , 2018 ; 2020 ; Sigtermans , 2020 ) . The PID framework has been applied to machine learning models . For example , Tax et al . ( 2017 ) measured the PID terms for restricted Boltzmann machines using the definition of Williams & Beer ( 2010 ) . Yu et al . ( 2021 ) took an alternative route , similar to our approach , where they measured linear combinations of PID terms by corresponding linear combinations of mutual information terms . These work aims at analyzing the learning dynamics of models in supervised settings . In contrast , we use the PID framework for analyzing disentanglement in unsupervised representation learning . 3 PARTIAL INFORMATION DECOMPOSITION FOR DISENTANGLEMENT . In this section , we analyze the current metrics and introduce our framework . In Section 3.1 , we introduce PID of the system we concern . In Section 3.2 , we investigate the current metrics in terms of multi-variable interactions . In Section 3.3 and 3.4 , we construct our disentanglement metric with bounds for PID terms . We provide a method of computing the bounds in Section 3.5 . 3.1 PARTIAL INFORMATION DECOMPOSITION . We tackle the problem of evaluating disentanglement of a latent representation z relative to the true generative factors y from an information-theoretic perspective . Let us consider evaluating how one generative factor yk is captured by the latent representation z . The information of yk captured by z is measured using mutual information I ( yk ; z ) = H ( z ) −H ( z|yk ) . In a desirably disentangled representation , we expect one of the latent variables z ` to exclusively capture the information of the factor yk . To evaluate a given representation , we are interested in understanding how the information is distributed between a latent variable z ` and the remaining representation z\ ` = ( z ` ′ ) ` ′ 6= ` . This is best described by the PID framework , where the mutual information is decomposed into the following four terms . I ( yk ; z ) = R ( yk ; z ` , z\ ` ) + U ( yk ; z ` \ z\ ` ) + U ( yk ; z\ ` \ z ` ) + C ( yk ; z ` , z\ ` ) . ( 1 ) Here , the decomposed terms represent the following non-negative quantities . • Redundant informationR ( yk ; z ` , z\ ` ) is the information of yk held by both z ` and z\ ` . • Unique information U ( yk ; z ` \ z\ ` ) is the information of yk held by z ` and not held by z\ ` . The opposite term U ( yk ; z\ ` \ z ` ) is also defined by exchanging the roles of z ` and z\ ` . • Complementary information ( or synergistic information ) C ( yk ; z ` , z\ ` ) is the information of yk held by z = ( z ` , z\ ` ) that is not held by either z ` or z\ ` alone . The following identities , combined with Eq.1 , partially characterize each term . I ( yk ; z ` ) = R ( yk ; z ` , z\ ` ) + U ( yk ; z ` \ z\ ` ) , I ( yk ; z\ ` ) = R ( yk ; z ` , z\ ` ) + U ( yk ; z\ ` \ z ` ) . ( 2 ) The decomposition of this system is illustrated in Figure 2a . We expect disentangled representations to concentrate the information of yk to a single latent variable z ` , and to let the other variables z\ ` not convey the information in either unique , redundant , or synergistic ways . This is understood in terms of PID as maximizing the unique information U ( yk ; z ` \ z\ ` ) while minimizing the other parts of the decomposition . The above formulation is incomplete as one degree of freedom remains to determine the four terms with the three equalities . Instead of stepping into searching for suitable definitions of these terms , we build discussions applicable to any such definitions that fulfill the above incomplete requirements2 .
The paper proposes an information theoretic approach to analyze the disentanglement. Using Partial Information Decomposition (PID) framework, the authors attempt to characterize the interaction among latent factors, correlation/disentanglement, for more than two latent variables. They generalize the existing mutual information gap (MIG) metric for multiple latent variables, by decomposing mutual information term into unique, redundant, and complementary information. The authors discussed that the pairwise correlation analysis endorses a portion of the redundant information as a measure of disentanglement, which should have been considered as entanglement. Additionally, they derive bounds for the partial information terms and demonstrate the limitations of existing disentanglement measures, i.e., BetaVAE, FactorVAE, and MIG in quantifying multivariate correlation in the latent space. The authors also designed two entanglement attacks to assess the disentanglement measures under injected correlation to the latent representation. The authors used two datasets, dSprites and 3dshapes to empirically substantiate their findings.
SP:bb6518fbc06695f3535e06a740b1e0f4ee72d318
Antonymy-Synonymy Discrimination through the Repelling Parasiamese Neural Network
Antonymic and synonymic pairs may both occur nearby in word embeddings spaces because they have similar distributional information . Different methods have been used in order to distinguish them , making the antonymy-synonymy discrimination a popular NLP task . In this work , we propose the repelling parasiamese neural network , a model which considers a siamese network for synonymy and a parasiamese network for antonymy , both sharing the same base network . Relying in the antagonism between synonymy and antonymy , the model attempts to repel siamese and parasiamese outputs making use of the contrastive loss functions . We experimentally show that the repelling parasiamese network achieves state-of-the-art results on this task . 1 INTRODUCTION . Semantic opposition is a binary relation of central importance in the cognitive baggage of human languages . It establishes that one term contradicts the other , that both can not be satisfied simultaneously . In the context of lexical semantics , it corresponds to antonyms ( e.g . light and dark ) , whose recognition is essential for natural language usage . For instance , this capability is crucial for text entailment and paraphrasing , which are basic abilities for different NLP tasks . Most of modern NLP is using word embeddings ( i.e . vectors for word meanings built from word contexts and subword information ) . These word representations have the potential to cluster words according to their distributional information on a corpus . However , since antonyms tend to occur in similar contexts , word embeddings may have close vectors in the space . Faced to this problem , different approaches have been proposed to re-encode the word embeddings in a supervised learning setup for the antonymy-synonymy discrimination task ( Mrkšić et al. , 2017 ; Etcheverry & Wonsever , 2019 ; Samenko et al. , 2020 ; Xie & Zeng , 2021 ) . In this work , we deepen in the parasiamese network as an antitransitive relationship learning approach , and we propose the repelling parasiamese neural network : a model that simultaneously opposes the siamese and parasiamese outputs ( of a same base network ) . We present two independent alternatives to do so : ( 1 ) pair and ( 2 ) triplet based approaches . We experimentally evaluate different alternatives and we introduce a formulation to enforce symmetry through the network structure . We carry out our experiments in three datasets : the publicly available antonymy-synonymy dataset introduced by Nguyen et al . ( 2016 ) , a here introduced dataset confeccionated from Samuel Fallow ’ s antonym ’ s dictionary ( accessed through the Gutenberg project ) and in a version of the Nguyen et al . ( 2016 ) ’ s dataset splitted without lexical intersection between train , validation and test introduced by Xie & Zeng ( 2021 ) . We show that the repelling parasiamese neural network achieves better performance than its predecessor , the ( non-repelling ) parasiamese network , and the best performing models found in the literature . 2 SOME PRELIMINARIES . Before getting into the repelling parasiamese neural network , let ’ s introduce some preliminary concepts concerning antitransitivity , metric learning for antonymy and the parasiamese network . 2.1 ANTONYMY AND ANTITRANSITIVITY . Antonymy can be considered as an antitransitive relationship1 . If two lexical units are antonyms of a third ( e.g . huge and enormous being opposite of small ) then they will not oppose each other ; in fact , they will often present semantic similarity ( Edmundson , 1967 ) . In table 1 we sample antonyms for some words from Fallow ’ s dictionary . Supporting the claimed antonymy antitransitivity , it can be seen that the words on each antonymy list ( i.e . common antonyms of a word ) do not oppose between them , and many cases of similarity can be detected ( e.g . savage and wild ) . 2.2 A METRIC FOR ANTONYMS . Siamese networks are among the best performing approaches for text semantic similarity tasks ( Tran et al. , 2020 ; Ranasinghe et al. , 2019 ; Mueller & Thyagarajan , 2016 ) . The properties that similarity relations tend to have , such as reflexivity , symmetry and transitivity ; are suitable for metrics and particularly for siamese networks . To clarify , suppose a metric d , reflexivity and symmetry arise directly from the metric definition , precisely from d ( x , x ) = 0 and d ( x , y ) = d ( y , x ) . Concerning transitivity , it is related to triangular inequity . The triangular inequity establishes that for any triplet ( x , y , z ) of words : d ( a , c ) ≤ d ( a , b ) + d ( b , c ) ( 1 ) So , given two pairs of related words ( a , b ) and ( b , c ) , then due to the triangular inequity , d ( a , c ) is bounded by the sum of d ( a , b ) and d ( b , c ) , which are expected to be low values since ( a , b ) and ( b , c ) are related . This makes the pair ( a , b ) to tend to be related as well , and therefore , the relation transitivity . If instead of a metric for similarity we consider a metric for opposition , e.g . antonyms , the aforementioned regarding triangular inequity is a drawback . The metric function will not be suitable for the antitransitivity of the opposition relation , tending to return low values ( i.e . treat them as related ) for the unrelated pair of words in the anti-transitive triangles . In other words , for each pair of words with a common antonym ( e.g . short and brief as antonyms of long ) , the metric will tend to wrongly treat them as antonyms as well . In conclusion , the triangular inequity is beneficial for transitivity but it is problematic for antitransitivity . In the following section we describe the parasiamese network , a siamese-like neural network that does not satisfy triangular inequity and is suitable for learning antitransitive relations . 2.3 THE PARASIAMESE NETWORK . The parasiamese network ( Etcheverry & Wonsever , 2019 ) was introduced as inspired by the siamese network , being better suited for the learning of antitransitive relations . Just like the siamese network , it consists of a model that consumes two vectors and returns a non-negative value ; and it relies on a base neural network that is applied more than once , sharing its weights , to compute the output . The parasiamese network differs from the siamese formulation in the fact that the base network is applied once to one input and twice to the other , instead of once to each input , as in the siamese network . The double application of the base network in the parasiamese network , imposes that the base network must have the same dimension for its input and output . The output of the parasiamese network is the distance between both branches ( see Figure 1 ) . 1We remind that a binary relation R is called antitransitive iff ∀a , b , c ( a R b ∧ b R c→ a 6R c ) Let Fθ : Rn → Rn be a neural network with trainable parameters θ . Then , the parasiamese network with base network Fθ is defined by ΦFθ ( x , y ) = ||Fθ ( x ) − Fθ ( Fθ ( y ) ) ||2 , ( 2 ) where ||.||2 is the Euclidean norm . The model is trained through the contrastive loss function . Concretely , ΦFθ is trained through mini-batch stochastic gradient descent on : L = ∑ ( x , y ) ∈P [ ΦFθ ( x , y ) − µp ] + + ∑ ( x′ , y′ ) ∈N [ µn − ΦFθ ( x′ , y′ ) ] + , ( 3 ) where P and N are , respectively , the positive and negative pairs in the dataset ; and µp and µn are the positive and negative thresholds , respectively . The [ . ] + notation corresponds to the ReLU function . The training attempts to pull closer than µp the related elements and push away unrelated pairs further than µn . This definition , unlike the siamese network , does not enforce transitivity even when the parasiamese output of the two related pairs in the antitransitive triangle are strictly zero . Moreover , the relation given by ΦFθ and a threshold µ ( i.e . RΦFθ , µ = { ( a , b ) : ΦFθ ( a , b ) ≤ µ } ) is benefited concerning antitransitivity if ΦFθ ( w , w ) > µ , which is consistent with the fact that antitransitive relations are necessarily antireflexive2 . In addition , the unrelated pair in the anti-transitive triangles will present a low value for the siamese formulation using the same base network . If ( a , b , c ) is an antitransitive triangle with unrelated pair ( a , c ) , then : ||Fθ ( a ) − Fθ ( c ) ||2 = ||Fθ ( a ) − Fθ ( c ) + Fθ ( Fθ ( b ) ) − Fθ ( Fθ ( b ) ) ||2 ≤ ||Fθ ( a ) − Fθ ( Fθ ( b ) ) ||2 + ||Fθ ( c ) − Fθ ( Fθ ( b ) ) ||2 and the parasiamese formulations of ( a , b ) and ( c , b ) are expected to output low values since they are both related . A possible interpretation for the parasiamese definition is thinking the base network F as an opposition transformation . So , if we consider two opposite terms a and b ( i.e . a ∼ ¬b ) , it is expected that opposition remains when both terms are negated ( i.e . ¬a ∼ ¬¬b ) , which brings the parasiamese formulation : F ( a ) ∼ F ( F ( b ) ) . 2To support this claim we rely in ΦFθ ( a , c ) ≤ ΦFθ ( a , b ) + ΦFθ ( b , b ) + ΦFθ ( b , c ) . 3 THE REPELLING PARASIAMESE NETWORK . The repelling parasiamese network is based on contrasting the siamese and parasiamese networks in a differentiable formulation ( Figure 2 ) . By doing this , we consistently observe a performance improvement in comparison to its predecessor ( i.e . the parasiamese network without repelling its siamese counterpart ) . The siamese counterpart of a parasiamese network may reflect the similitude-like relation that emerges from being opposed to the same elements through the antitransitive relation . Recalling the case of lexical semantics , the siamese formulation that comes from a parasiamese network that models antonymy , may be suitable to model synonymy , since the words that share antonyms may tend to be synonyms . Hence , given the antagonism between antonymy and synonymy , it seems suitable that both outputs should not be simultaneously low for the same outputs . Let a , b , c be three inputs with the pairs a , b and b , c being related and therefore returning low parasiamese outputs . Then , as commented in the previous section , the output for the siamese formulation of the same base network for the pair a , c will present a low value . Simultaneously , its parasiamese output is expected to be greater than the acceptance threshold , because of the antitransitivity . This suggests contrariness between siamese and parasiamese formulations in the unrelated pairs of antitransitive triangles . Moreover , if a pair ( a , b ) presents low siamese and parasiamese outputs , it would implies a reflexive pair within the antitransitive relation , since : ΦFθ ( a , a ) = ||Fθ ( a ) − Fθ ( Fθ ( a ) ) ||2 = ||Fθ ( a ) − Fθ ( Fθ ( a ) ) + Fθ ( b ) − Fθ ( b ) ||2 ≤ ||Fθ ( a ) − Fθ ( b ) ||2 + ||Fθ ( a ) − Fθ ( Fθ ( b ) ) ||2 which is inconsistent with antitransitivity . So , it may be suitable to contrast the parasiamese and siamese outputs ( using a same base network ) when one of them returns a low value . To describe the repelling parasiamese network let introduce the following notation : • Parasiamese left and right branches : We will refer as left and right branches of the parasiamese network to the transformations applied to the left and right parts of the relationship ( that correspond to the left and right terms of the distance in equation 2 ) , and we will write them as αθα : Rn → Rn and βθβ : Rn → Rn , respectively . So , in the non-repelling proposal αθ ( x ) = Fθ ( x ) and βθ ( x ) = Fθ ( Fθ ( x ) ) . • Parasiamese output function : We will use the notation Φαθα , βθβ for to the binary function that given the left and right branches , αθα and βθβ , returns the distance between them , i.e . Φαθα , βθβ ( x1 , x2 ) = ||αθα ( x1 ) − βθβ ( x2 ) || 2 2 . Notice that Φαθα , αθα ( x1 , x2 ) corresponds to the siamese network formulation .
The paper presents the new approach for distinguishing antonyms and synonyms. This task could be interesting for further applications such as paraphrasing and text entailment. The authors present proposed the repelling parasiamese neural network. The model with several setups was tested on three datasets of antonyms and synonyms pairs showing the improvement over the baselines.
SP:21f8baffec06ccc418aac8c7836ba82a8b0c85cf
Antonymy-Synonymy Discrimination through the Repelling Parasiamese Neural Network
Antonymic and synonymic pairs may both occur nearby in word embeddings spaces because they have similar distributional information . Different methods have been used in order to distinguish them , making the antonymy-synonymy discrimination a popular NLP task . In this work , we propose the repelling parasiamese neural network , a model which considers a siamese network for synonymy and a parasiamese network for antonymy , both sharing the same base network . Relying in the antagonism between synonymy and antonymy , the model attempts to repel siamese and parasiamese outputs making use of the contrastive loss functions . We experimentally show that the repelling parasiamese network achieves state-of-the-art results on this task . 1 INTRODUCTION . Semantic opposition is a binary relation of central importance in the cognitive baggage of human languages . It establishes that one term contradicts the other , that both can not be satisfied simultaneously . In the context of lexical semantics , it corresponds to antonyms ( e.g . light and dark ) , whose recognition is essential for natural language usage . For instance , this capability is crucial for text entailment and paraphrasing , which are basic abilities for different NLP tasks . Most of modern NLP is using word embeddings ( i.e . vectors for word meanings built from word contexts and subword information ) . These word representations have the potential to cluster words according to their distributional information on a corpus . However , since antonyms tend to occur in similar contexts , word embeddings may have close vectors in the space . Faced to this problem , different approaches have been proposed to re-encode the word embeddings in a supervised learning setup for the antonymy-synonymy discrimination task ( Mrkšić et al. , 2017 ; Etcheverry & Wonsever , 2019 ; Samenko et al. , 2020 ; Xie & Zeng , 2021 ) . In this work , we deepen in the parasiamese network as an antitransitive relationship learning approach , and we propose the repelling parasiamese neural network : a model that simultaneously opposes the siamese and parasiamese outputs ( of a same base network ) . We present two independent alternatives to do so : ( 1 ) pair and ( 2 ) triplet based approaches . We experimentally evaluate different alternatives and we introduce a formulation to enforce symmetry through the network structure . We carry out our experiments in three datasets : the publicly available antonymy-synonymy dataset introduced by Nguyen et al . ( 2016 ) , a here introduced dataset confeccionated from Samuel Fallow ’ s antonym ’ s dictionary ( accessed through the Gutenberg project ) and in a version of the Nguyen et al . ( 2016 ) ’ s dataset splitted without lexical intersection between train , validation and test introduced by Xie & Zeng ( 2021 ) . We show that the repelling parasiamese neural network achieves better performance than its predecessor , the ( non-repelling ) parasiamese network , and the best performing models found in the literature . 2 SOME PRELIMINARIES . Before getting into the repelling parasiamese neural network , let ’ s introduce some preliminary concepts concerning antitransitivity , metric learning for antonymy and the parasiamese network . 2.1 ANTONYMY AND ANTITRANSITIVITY . Antonymy can be considered as an antitransitive relationship1 . If two lexical units are antonyms of a third ( e.g . huge and enormous being opposite of small ) then they will not oppose each other ; in fact , they will often present semantic similarity ( Edmundson , 1967 ) . In table 1 we sample antonyms for some words from Fallow ’ s dictionary . Supporting the claimed antonymy antitransitivity , it can be seen that the words on each antonymy list ( i.e . common antonyms of a word ) do not oppose between them , and many cases of similarity can be detected ( e.g . savage and wild ) . 2.2 A METRIC FOR ANTONYMS . Siamese networks are among the best performing approaches for text semantic similarity tasks ( Tran et al. , 2020 ; Ranasinghe et al. , 2019 ; Mueller & Thyagarajan , 2016 ) . The properties that similarity relations tend to have , such as reflexivity , symmetry and transitivity ; are suitable for metrics and particularly for siamese networks . To clarify , suppose a metric d , reflexivity and symmetry arise directly from the metric definition , precisely from d ( x , x ) = 0 and d ( x , y ) = d ( y , x ) . Concerning transitivity , it is related to triangular inequity . The triangular inequity establishes that for any triplet ( x , y , z ) of words : d ( a , c ) ≤ d ( a , b ) + d ( b , c ) ( 1 ) So , given two pairs of related words ( a , b ) and ( b , c ) , then due to the triangular inequity , d ( a , c ) is bounded by the sum of d ( a , b ) and d ( b , c ) , which are expected to be low values since ( a , b ) and ( b , c ) are related . This makes the pair ( a , b ) to tend to be related as well , and therefore , the relation transitivity . If instead of a metric for similarity we consider a metric for opposition , e.g . antonyms , the aforementioned regarding triangular inequity is a drawback . The metric function will not be suitable for the antitransitivity of the opposition relation , tending to return low values ( i.e . treat them as related ) for the unrelated pair of words in the anti-transitive triangles . In other words , for each pair of words with a common antonym ( e.g . short and brief as antonyms of long ) , the metric will tend to wrongly treat them as antonyms as well . In conclusion , the triangular inequity is beneficial for transitivity but it is problematic for antitransitivity . In the following section we describe the parasiamese network , a siamese-like neural network that does not satisfy triangular inequity and is suitable for learning antitransitive relations . 2.3 THE PARASIAMESE NETWORK . The parasiamese network ( Etcheverry & Wonsever , 2019 ) was introduced as inspired by the siamese network , being better suited for the learning of antitransitive relations . Just like the siamese network , it consists of a model that consumes two vectors and returns a non-negative value ; and it relies on a base neural network that is applied more than once , sharing its weights , to compute the output . The parasiamese network differs from the siamese formulation in the fact that the base network is applied once to one input and twice to the other , instead of once to each input , as in the siamese network . The double application of the base network in the parasiamese network , imposes that the base network must have the same dimension for its input and output . The output of the parasiamese network is the distance between both branches ( see Figure 1 ) . 1We remind that a binary relation R is called antitransitive iff ∀a , b , c ( a R b ∧ b R c→ a 6R c ) Let Fθ : Rn → Rn be a neural network with trainable parameters θ . Then , the parasiamese network with base network Fθ is defined by ΦFθ ( x , y ) = ||Fθ ( x ) − Fθ ( Fθ ( y ) ) ||2 , ( 2 ) where ||.||2 is the Euclidean norm . The model is trained through the contrastive loss function . Concretely , ΦFθ is trained through mini-batch stochastic gradient descent on : L = ∑ ( x , y ) ∈P [ ΦFθ ( x , y ) − µp ] + + ∑ ( x′ , y′ ) ∈N [ µn − ΦFθ ( x′ , y′ ) ] + , ( 3 ) where P and N are , respectively , the positive and negative pairs in the dataset ; and µp and µn are the positive and negative thresholds , respectively . The [ . ] + notation corresponds to the ReLU function . The training attempts to pull closer than µp the related elements and push away unrelated pairs further than µn . This definition , unlike the siamese network , does not enforce transitivity even when the parasiamese output of the two related pairs in the antitransitive triangle are strictly zero . Moreover , the relation given by ΦFθ and a threshold µ ( i.e . RΦFθ , µ = { ( a , b ) : ΦFθ ( a , b ) ≤ µ } ) is benefited concerning antitransitivity if ΦFθ ( w , w ) > µ , which is consistent with the fact that antitransitive relations are necessarily antireflexive2 . In addition , the unrelated pair in the anti-transitive triangles will present a low value for the siamese formulation using the same base network . If ( a , b , c ) is an antitransitive triangle with unrelated pair ( a , c ) , then : ||Fθ ( a ) − Fθ ( c ) ||2 = ||Fθ ( a ) − Fθ ( c ) + Fθ ( Fθ ( b ) ) − Fθ ( Fθ ( b ) ) ||2 ≤ ||Fθ ( a ) − Fθ ( Fθ ( b ) ) ||2 + ||Fθ ( c ) − Fθ ( Fθ ( b ) ) ||2 and the parasiamese formulations of ( a , b ) and ( c , b ) are expected to output low values since they are both related . A possible interpretation for the parasiamese definition is thinking the base network F as an opposition transformation . So , if we consider two opposite terms a and b ( i.e . a ∼ ¬b ) , it is expected that opposition remains when both terms are negated ( i.e . ¬a ∼ ¬¬b ) , which brings the parasiamese formulation : F ( a ) ∼ F ( F ( b ) ) . 2To support this claim we rely in ΦFθ ( a , c ) ≤ ΦFθ ( a , b ) + ΦFθ ( b , b ) + ΦFθ ( b , c ) . 3 THE REPELLING PARASIAMESE NETWORK . The repelling parasiamese network is based on contrasting the siamese and parasiamese networks in a differentiable formulation ( Figure 2 ) . By doing this , we consistently observe a performance improvement in comparison to its predecessor ( i.e . the parasiamese network without repelling its siamese counterpart ) . The siamese counterpart of a parasiamese network may reflect the similitude-like relation that emerges from being opposed to the same elements through the antitransitive relation . Recalling the case of lexical semantics , the siamese formulation that comes from a parasiamese network that models antonymy , may be suitable to model synonymy , since the words that share antonyms may tend to be synonyms . Hence , given the antagonism between antonymy and synonymy , it seems suitable that both outputs should not be simultaneously low for the same outputs . Let a , b , c be three inputs with the pairs a , b and b , c being related and therefore returning low parasiamese outputs . Then , as commented in the previous section , the output for the siamese formulation of the same base network for the pair a , c will present a low value . Simultaneously , its parasiamese output is expected to be greater than the acceptance threshold , because of the antitransitivity . This suggests contrariness between siamese and parasiamese formulations in the unrelated pairs of antitransitive triangles . Moreover , if a pair ( a , b ) presents low siamese and parasiamese outputs , it would implies a reflexive pair within the antitransitive relation , since : ΦFθ ( a , a ) = ||Fθ ( a ) − Fθ ( Fθ ( a ) ) ||2 = ||Fθ ( a ) − Fθ ( Fθ ( a ) ) + Fθ ( b ) − Fθ ( b ) ||2 ≤ ||Fθ ( a ) − Fθ ( b ) ||2 + ||Fθ ( a ) − Fθ ( Fθ ( b ) ) ||2 which is inconsistent with antitransitivity . So , it may be suitable to contrast the parasiamese and siamese outputs ( using a same base network ) when one of them returns a low value . To describe the repelling parasiamese network let introduce the following notation : • Parasiamese left and right branches : We will refer as left and right branches of the parasiamese network to the transformations applied to the left and right parts of the relationship ( that correspond to the left and right terms of the distance in equation 2 ) , and we will write them as αθα : Rn → Rn and βθβ : Rn → Rn , respectively . So , in the non-repelling proposal αθ ( x ) = Fθ ( x ) and βθ ( x ) = Fθ ( Fθ ( x ) ) . • Parasiamese output function : We will use the notation Φαθα , βθβ for to the binary function that given the left and right branches , αθα and βθβ , returns the distance between them , i.e . Φαθα , βθβ ( x1 , x2 ) = ||αθα ( x1 ) − βθβ ( x2 ) || 2 2 . Notice that Φαθα , αθα ( x1 , x2 ) corresponds to the siamese network formulation .
This paper proposes a simple new architecture for the task of antonymy detection. The architecture is an extension of a previous architecture for the same task, known as the parasiamese network. The new architecture, called the repelling parasiamese network, essentially contains a copy of a siamese network and a parasiamese network tied together using a euclidean loss. Experimental results on several datasets demonstrate that this architecture can detect antonymy reliably and sometimes even beat the state of the art.
SP:21f8baffec06ccc418aac8c7836ba82a8b0c85cf
Antonymy-Synonymy Discrimination through the Repelling Parasiamese Neural Network
Antonymic and synonymic pairs may both occur nearby in word embeddings spaces because they have similar distributional information . Different methods have been used in order to distinguish them , making the antonymy-synonymy discrimination a popular NLP task . In this work , we propose the repelling parasiamese neural network , a model which considers a siamese network for synonymy and a parasiamese network for antonymy , both sharing the same base network . Relying in the antagonism between synonymy and antonymy , the model attempts to repel siamese and parasiamese outputs making use of the contrastive loss functions . We experimentally show that the repelling parasiamese network achieves state-of-the-art results on this task . 1 INTRODUCTION . Semantic opposition is a binary relation of central importance in the cognitive baggage of human languages . It establishes that one term contradicts the other , that both can not be satisfied simultaneously . In the context of lexical semantics , it corresponds to antonyms ( e.g . light and dark ) , whose recognition is essential for natural language usage . For instance , this capability is crucial for text entailment and paraphrasing , which are basic abilities for different NLP tasks . Most of modern NLP is using word embeddings ( i.e . vectors for word meanings built from word contexts and subword information ) . These word representations have the potential to cluster words according to their distributional information on a corpus . However , since antonyms tend to occur in similar contexts , word embeddings may have close vectors in the space . Faced to this problem , different approaches have been proposed to re-encode the word embeddings in a supervised learning setup for the antonymy-synonymy discrimination task ( Mrkšić et al. , 2017 ; Etcheverry & Wonsever , 2019 ; Samenko et al. , 2020 ; Xie & Zeng , 2021 ) . In this work , we deepen in the parasiamese network as an antitransitive relationship learning approach , and we propose the repelling parasiamese neural network : a model that simultaneously opposes the siamese and parasiamese outputs ( of a same base network ) . We present two independent alternatives to do so : ( 1 ) pair and ( 2 ) triplet based approaches . We experimentally evaluate different alternatives and we introduce a formulation to enforce symmetry through the network structure . We carry out our experiments in three datasets : the publicly available antonymy-synonymy dataset introduced by Nguyen et al . ( 2016 ) , a here introduced dataset confeccionated from Samuel Fallow ’ s antonym ’ s dictionary ( accessed through the Gutenberg project ) and in a version of the Nguyen et al . ( 2016 ) ’ s dataset splitted without lexical intersection between train , validation and test introduced by Xie & Zeng ( 2021 ) . We show that the repelling parasiamese neural network achieves better performance than its predecessor , the ( non-repelling ) parasiamese network , and the best performing models found in the literature . 2 SOME PRELIMINARIES . Before getting into the repelling parasiamese neural network , let ’ s introduce some preliminary concepts concerning antitransitivity , metric learning for antonymy and the parasiamese network . 2.1 ANTONYMY AND ANTITRANSITIVITY . Antonymy can be considered as an antitransitive relationship1 . If two lexical units are antonyms of a third ( e.g . huge and enormous being opposite of small ) then they will not oppose each other ; in fact , they will often present semantic similarity ( Edmundson , 1967 ) . In table 1 we sample antonyms for some words from Fallow ’ s dictionary . Supporting the claimed antonymy antitransitivity , it can be seen that the words on each antonymy list ( i.e . common antonyms of a word ) do not oppose between them , and many cases of similarity can be detected ( e.g . savage and wild ) . 2.2 A METRIC FOR ANTONYMS . Siamese networks are among the best performing approaches for text semantic similarity tasks ( Tran et al. , 2020 ; Ranasinghe et al. , 2019 ; Mueller & Thyagarajan , 2016 ) . The properties that similarity relations tend to have , such as reflexivity , symmetry and transitivity ; are suitable for metrics and particularly for siamese networks . To clarify , suppose a metric d , reflexivity and symmetry arise directly from the metric definition , precisely from d ( x , x ) = 0 and d ( x , y ) = d ( y , x ) . Concerning transitivity , it is related to triangular inequity . The triangular inequity establishes that for any triplet ( x , y , z ) of words : d ( a , c ) ≤ d ( a , b ) + d ( b , c ) ( 1 ) So , given two pairs of related words ( a , b ) and ( b , c ) , then due to the triangular inequity , d ( a , c ) is bounded by the sum of d ( a , b ) and d ( b , c ) , which are expected to be low values since ( a , b ) and ( b , c ) are related . This makes the pair ( a , b ) to tend to be related as well , and therefore , the relation transitivity . If instead of a metric for similarity we consider a metric for opposition , e.g . antonyms , the aforementioned regarding triangular inequity is a drawback . The metric function will not be suitable for the antitransitivity of the opposition relation , tending to return low values ( i.e . treat them as related ) for the unrelated pair of words in the anti-transitive triangles . In other words , for each pair of words with a common antonym ( e.g . short and brief as antonyms of long ) , the metric will tend to wrongly treat them as antonyms as well . In conclusion , the triangular inequity is beneficial for transitivity but it is problematic for antitransitivity . In the following section we describe the parasiamese network , a siamese-like neural network that does not satisfy triangular inequity and is suitable for learning antitransitive relations . 2.3 THE PARASIAMESE NETWORK . The parasiamese network ( Etcheverry & Wonsever , 2019 ) was introduced as inspired by the siamese network , being better suited for the learning of antitransitive relations . Just like the siamese network , it consists of a model that consumes two vectors and returns a non-negative value ; and it relies on a base neural network that is applied more than once , sharing its weights , to compute the output . The parasiamese network differs from the siamese formulation in the fact that the base network is applied once to one input and twice to the other , instead of once to each input , as in the siamese network . The double application of the base network in the parasiamese network , imposes that the base network must have the same dimension for its input and output . The output of the parasiamese network is the distance between both branches ( see Figure 1 ) . 1We remind that a binary relation R is called antitransitive iff ∀a , b , c ( a R b ∧ b R c→ a 6R c ) Let Fθ : Rn → Rn be a neural network with trainable parameters θ . Then , the parasiamese network with base network Fθ is defined by ΦFθ ( x , y ) = ||Fθ ( x ) − Fθ ( Fθ ( y ) ) ||2 , ( 2 ) where ||.||2 is the Euclidean norm . The model is trained through the contrastive loss function . Concretely , ΦFθ is trained through mini-batch stochastic gradient descent on : L = ∑ ( x , y ) ∈P [ ΦFθ ( x , y ) − µp ] + + ∑ ( x′ , y′ ) ∈N [ µn − ΦFθ ( x′ , y′ ) ] + , ( 3 ) where P and N are , respectively , the positive and negative pairs in the dataset ; and µp and µn are the positive and negative thresholds , respectively . The [ . ] + notation corresponds to the ReLU function . The training attempts to pull closer than µp the related elements and push away unrelated pairs further than µn . This definition , unlike the siamese network , does not enforce transitivity even when the parasiamese output of the two related pairs in the antitransitive triangle are strictly zero . Moreover , the relation given by ΦFθ and a threshold µ ( i.e . RΦFθ , µ = { ( a , b ) : ΦFθ ( a , b ) ≤ µ } ) is benefited concerning antitransitivity if ΦFθ ( w , w ) > µ , which is consistent with the fact that antitransitive relations are necessarily antireflexive2 . In addition , the unrelated pair in the anti-transitive triangles will present a low value for the siamese formulation using the same base network . If ( a , b , c ) is an antitransitive triangle with unrelated pair ( a , c ) , then : ||Fθ ( a ) − Fθ ( c ) ||2 = ||Fθ ( a ) − Fθ ( c ) + Fθ ( Fθ ( b ) ) − Fθ ( Fθ ( b ) ) ||2 ≤ ||Fθ ( a ) − Fθ ( Fθ ( b ) ) ||2 + ||Fθ ( c ) − Fθ ( Fθ ( b ) ) ||2 and the parasiamese formulations of ( a , b ) and ( c , b ) are expected to output low values since they are both related . A possible interpretation for the parasiamese definition is thinking the base network F as an opposition transformation . So , if we consider two opposite terms a and b ( i.e . a ∼ ¬b ) , it is expected that opposition remains when both terms are negated ( i.e . ¬a ∼ ¬¬b ) , which brings the parasiamese formulation : F ( a ) ∼ F ( F ( b ) ) . 2To support this claim we rely in ΦFθ ( a , c ) ≤ ΦFθ ( a , b ) + ΦFθ ( b , b ) + ΦFθ ( b , c ) . 3 THE REPELLING PARASIAMESE NETWORK . The repelling parasiamese network is based on contrasting the siamese and parasiamese networks in a differentiable formulation ( Figure 2 ) . By doing this , we consistently observe a performance improvement in comparison to its predecessor ( i.e . the parasiamese network without repelling its siamese counterpart ) . The siamese counterpart of a parasiamese network may reflect the similitude-like relation that emerges from being opposed to the same elements through the antitransitive relation . Recalling the case of lexical semantics , the siamese formulation that comes from a parasiamese network that models antonymy , may be suitable to model synonymy , since the words that share antonyms may tend to be synonyms . Hence , given the antagonism between antonymy and synonymy , it seems suitable that both outputs should not be simultaneously low for the same outputs . Let a , b , c be three inputs with the pairs a , b and b , c being related and therefore returning low parasiamese outputs . Then , as commented in the previous section , the output for the siamese formulation of the same base network for the pair a , c will present a low value . Simultaneously , its parasiamese output is expected to be greater than the acceptance threshold , because of the antitransitivity . This suggests contrariness between siamese and parasiamese formulations in the unrelated pairs of antitransitive triangles . Moreover , if a pair ( a , b ) presents low siamese and parasiamese outputs , it would implies a reflexive pair within the antitransitive relation , since : ΦFθ ( a , a ) = ||Fθ ( a ) − Fθ ( Fθ ( a ) ) ||2 = ||Fθ ( a ) − Fθ ( Fθ ( a ) ) + Fθ ( b ) − Fθ ( b ) ||2 ≤ ||Fθ ( a ) − Fθ ( b ) ||2 + ||Fθ ( a ) − Fθ ( Fθ ( b ) ) ||2 which is inconsistent with antitransitivity . So , it may be suitable to contrast the parasiamese and siamese outputs ( using a same base network ) when one of them returns a low value . To describe the repelling parasiamese network let introduce the following notation : • Parasiamese left and right branches : We will refer as left and right branches of the parasiamese network to the transformations applied to the left and right parts of the relationship ( that correspond to the left and right terms of the distance in equation 2 ) , and we will write them as αθα : Rn → Rn and βθβ : Rn → Rn , respectively . So , in the non-repelling proposal αθ ( x ) = Fθ ( x ) and βθ ( x ) = Fθ ( Fθ ( x ) ) . • Parasiamese output function : We will use the notation Φαθα , βθβ for to the binary function that given the left and right branches , αθα and βθβ , returns the distance between them , i.e . Φαθα , βθβ ( x1 , x2 ) = ||αθα ( x1 ) − βθβ ( x2 ) || 2 2 . Notice that Φαθα , αθα ( x1 , x2 ) corresponds to the siamese network formulation .
The task is a binary classification task. The system is given a pair of words that are either synonyms or antonyms. The task is to say which pairs are synonyms and which are antonyms. Table 3 reports results on two datasets: (1) Nguyen's and (2) Fallows's. The second dataset is a contribution. This paper points out the usefulness of https://www.gutenberg.org/ebooks/51155 The paper proposes a new model, REPELLING PARASIAMESE NEURAL NETWORK. Results in table 3 are impressive, especially on Fallows's The suggestion of using triplets is nice.
SP:21f8baffec06ccc418aac8c7836ba82a8b0c85cf
It Takes Two to Tango: Mixup for Deep Metric Learning
1 INTRODUCTION Classification is one of the most studied tasks in machine learning and deep learning . It is a common source of pre-trained models for transfer learning to other tasks ( Donahue et al. , 2014 ; Kolesnikov et al. , 2020 ) . It has been studied under different supervision settings ( Caron et al. , 2018 ; Sohn et al. , 2020 ) , knowledge transfer ( Hinton et al. , 2015 ) and data augmentation ( Cubuk et al. , 2018 ) , including the recent research on mixup ( Zhang et al. , 2018 ; Verma et al. , 2019 ) , where embeddings and labels are interpolated . Deep metric learning is about learning from pairwise interactions such that inference relies on instance embeddings , e.g . for nearest neighbor classification ( Oh Song et al. , ∗equal contribution 2016 ) , instance-level retrieval ( Gordo et al. , 2016 ) , few-shot learning ( Vinyals et al. , 2016 ) , face recognition ( Schroff et al. , 2015 ) and semantic textual similarity ( Reimers & Gurevych , 2019 ) . Following ( Xing et al. , 2003 ) , it is most often fully supervised by one class label per example , like classification . The two most studied problems are loss functions ( Musgrave et al. , 2020 ) and hard example mining ( Wu et al. , 2017 ; Robinson et al. , 2021 ) . Tuple-based losses with example weighting ( Wang et al. , 2019 ) can play the role of both . Unlike classification , classes ( and distributions ) at training and inference are different in metric learning . Thus , one might expect interpolation-based data augmentation like mixup to be even more important in metric learning than in classification . Yet , recent attempts are mostly limited to special cases of embedding interpolation and have trouble with label interpolation ( Ko & Gu , 2020 ) . This raises the question : what is a proper way to define and interpolate labels for metric learning ? In this work , we observe that metric learning is not different from classification , where examples are replaced by pairs of examples and class labels by “ positive ” or “ negative ” , according to whether class labels of individual examples are the same or not . The positive or negative label of an example , or a pair , is determined in relation to a given example which is called an anchor . Then , as shown in Figure 1 , a straightforward way is to use a binary ( two class ) label per pair and interpolate it linearly as in standard mixup . We call our method Metric Mix , or Metrix for short . To show that mixing examples improves representation learning , we quantitatively measure the properties of the test distributions using alignment and uniformity ( Wang & Isola , 2020 ) . Alignment measures the clustering quality and uniformity measures its distribution over the embedding space ; a well clustered and uniformly spread distribution indicates higher representation quality . We also introduce a new metric , utilization , to measure the extent to which a test example , seen as a query , lies near any of the training examples , clean or mixed . By quantitatively measuring these three metrics , we show that interpolation-based data augmentation like mixup is very important in metric learning , given the difference between distributions at training and inference . In summary , we make the following contributions : 1 . We define a generic way of representing and interpolating labels , which allows straightforward extension of any kind of mixup to deep metric learning for a large class of loss functions . We develop our method on a generic formulation that encapsulates these functions ( section 3 ) . 2 . We define the “ positivity ” of a mixed example and we study precisely how it increases as a function of the interpolation factor , both in theory and empirically ( subsection 3.6 ) . 3 . We systematically evaluate mixup for deep metric learning under different settings , including mixup at different representation levels ( input/manifold ) , mixup of different pairs of examples ( anchors/positives/negatives ) , loss functions and hard example mining ( subsection 4.2 ) . 4 . We introduce a new evaluation metric , utilization , validating that a representation more appropriate for test classes is implicitly learned during exploration of the embedding space in the presence of mixup ( subsection 4.3 ) . 5 . We improve the state of the art on four common metric learning benchmarks ( subsection 4.2 ) . 2 RELATED WORK . Metric learning Metric learning aims to learn a metric such that positive pairs of examples are nearby and negative ones are far away . In deep metric learning , we learn an explicit non-linear mapping from raw input to a low-dimensional embedding space ( Oh Song et al. , 2016 ) , where the Euclidean distance has the desired properties . Although learning can be unsupervised ( Hadsell et al. , 2006 ) , deep metric learning has mostly followed the supervised approach , where positive and negative pairs are defined as having the same or different class label , respectively ( Xing et al. , 2003 ) . Loss functions can be distinguished into pair-based and proxy-based ( Musgrave et al. , 2020 ) . Pairbased losses use pairs of examples ( Wu et al. , 2017 ; Hadsell et al. , 2006 ) , which can be defined over triplets ( Wang et al. , 2014 ; Schroff et al. , 2015 ; Weinberger & Saul , 2009 ; Hermans et al. , 2017 ) , quadruples ( Chen et al. , 2017 ) or tuples ( Sohn , 2016 ; Oh Song et al. , 2016 ; Wang et al. , 2019 ) . Proxy-based losses use one or more proxies per class , which are learnable parameters in the embedding space ( Movshovitz-Attias et al. , 2017 ; Qian et al. , 2019 ; Kim et al. , 2020c ; Teh et al. , 2020 ; Zhu et al. , 2020b ) . Pair-based losses capture data-to-data relations , but they are sensitive to noisy labels and outliers . They often involve terms where given constraints are satisfied , which produce zero gradients and do not contribute to training . This necessitates mining of hard examples that violate the constraints , like semi-hard ( Schroff et al. , 2015 ) and distance weighted ( Wu et al. , 2017 ) . By contrast , proxy-based losses use data-to-proxy relations , assuming proxies can capture the global structure of the embedding space . They involve less computations that are more likely to produce nonzero gradient , hence have less or no dependence on mining and converge faster . Mixup Input mixup ( Zhang et al. , 2018 ) linearly interpolates between two or more examples in the input space for data augmentation . Numerous variants take advantage of the structure of the input space to interpolate non-linearly , e.g . for images ( Yun et al. , 2019 ; Kim et al. , 2020a ; 2021 ; Hendrycks et al. , 2020 ; DeVries & Taylor , 2017 ; Qin et al. , 2020 ; Uddin et al. , 2021 ) . Manifold mixup ( Verma et al. , 2019 ) interpolates intermediate representations instead , where the structure is learned . This can be applied to or assisted by decoding back to the input space ( Berthelot et al. , 2018 ; Liu et al. , 2018 ; Beckham et al. , 2019 ; Zhu et al. , 2020a ; Venkataramanan et al. , 2021 ) . In both cases , corresponding labels are linearly interpolated too . Most studies are limited to cross-entropy loss for classification . Pairwise loss functions have been under-studied , as discussed below . Interpolation for pairwise loss functions As discussed in subsection 3.3 , interpolating target labels is not straightforward in pairwise loss functions . In deep metric learning , embedding expansion ( Ko & Gu , 2020 ) , HDML ( Zheng et al. , 2019 ) and symmetrical synthesis ( Gu & Ko , 2020 ) interpolate pairs of embeddings in a deterministic way within the same class , applying to pair-based losses , while proxy synthesis ( Gu et al. , 2021 ) interpolates between classes , applying to proxy-based losses . None performs label interpolation , which means that ( Gu et al. , 2021 ) risks synthesizing false negatives when the interpolation factor λ is close to 0 or 1 . In contrastive representation learning , MoCHi ( Kalantidis et al. , 2020 ) interpolates anchor with negative embeddings but not labels and chooses λ ∈ [ 0 , 0.5 ] to avoid false negatives . This resembles thresholding of λ at 0.5 in OptTransMix ( Zhu et al. , 2020a ) . Finally , i-mix ( Lee et al. , 2021 ) and MixCo ( Kim et al. , 2020b ) interpolate pairs of anchor embeddings as well as their ( virtual ) class labels linearly . There is only one positive , while all negatives are clean , so it can not take advantage of interpolation for relative weighting of positives/negatives per anchor ( Wang et al. , 2019 ) . By contrast , Metrix is developed for deep metric learning and applies to a large class of both pairbased and proxy-based losses . It can interpolate inputs , intermediate features or embeddings of anchors , ( multiple ) positives or negatives and the corresponding two-class ( positive/negative ) labels per anchor , such that relative weighting of positives/negatives depends on interpolation . 3 MIXUP FOR METRIC LEARNING . 3.1 PRELIMINARIES . Problem formulation We are given a training set X ⊂ X , where X is the input space . For each anchor a ∈ X , we are also given a set P ( a ) ⊂ X of positives and a set N ( a ) ⊂ X of negatives . The positives are typically examples that belong to the same class as the anchor , while negatives belong to a different class . The objective is to train the parameters θ of a model f : X → Rd that maps input examples to a d-dimensional embedding , such that positives are close to the anchor and negatives are far away in the embedding space . Given two examples x , x′ ∈ X , we denote by s ( x , x′ ) the similarity between x , x′ in the embedding space , typically a decreasing function of Euclidean distance . It is common to ` 2-normalize embeddings and define s ( x , x′ ) : = 〈f ( x ) , f ( x′ ) 〉 , which is the cosine similarity . To simplify notation , we drop the dependence of f , s on θ. Pair-based losses ( Hadsell et al. , 2006 ; Wang et al. , 2014 ; Oh Song et al. , 2016 ; Wang et al. , 2019 ) use both anchors and positives/negatives in X , as discussed above . Proxy-based losses define one or more learnable proxies ∈ Rd per class , and only use proxies as anchors ( Kim et al. , 2020c ) or as positives/negatives ( Movshovitz-Attias et al. , 2017 ; Qian et al. , 2019 ; Teh et al. , 2020 ) . To accommodate for uniform exposition , we extend the definition of similarity as s ( v , x ) : = 〈v , f ( x ) 〉 for v ∈ Rd , x ∈ X ( proxy anchors ) and s ( x , v ) : = 〈f ( x ) , v〉 for x ∈ X , v ∈ Rd ( proxy positives/negatives ) . Finally , to accommodate for mixed embeddings in subsection 3.5 , we define s ( v , v′ ) : = 〈v , v′〉 for v , v′ ∈ Rd . Thus , we define s : ( X ∪ Rd ) 2 → R over pairs of either inputs in X or embeddings in Rd . We discuss a few representative loss functions below , before deriving a generic form . Contrastive The contrastive loss ( Hadsell et al. , 2006 ) encourages positive examples to be pulled towards the anchor and negative examples to be pushed away by a margin m ∈ R. This loss is additive over positives and negatives , defined as : ` cont ( a ; θ ) : = ∑ p∈P ( a ) −s ( a , p ) + ∑ n∈N ( a ) [ s ( a , n ) −m ] + . ( 1 ) Multi-Similarity The multi-similarity loss ( Wang et al. , 2019 ) introduces relative weighting to encourage positives ( negatives ) that are farthest from ( closest to ) the anchor to be pulled towards ( pushed away from ) the anchor by a higher weight . This loss is not additive over positives and negatives : ` MS ( a ; θ ) : = 1 β log 1 + ∑ p∈P ( a ) e−β ( s ( a , p ) −m ) + 1 γ log 1 + ∑ n∈N ( a ) eγ ( s ( a , n ) −m ) . ( 2 ) Here , β , γ ∈ R are scaling factors for positives , negatives respectively . Proxy Anchor The proxy anchor loss ( Kim et al. , 2020c ) defines a learnable proxy in Rd for each class and only uses proxies as anchors . For a given anchor ( proxy ) a ∈ Rd , the loss has the same form as ( 2 ) , although similarity s is evaluated on Rd ×X .
The paper presents a technique for using mixup augmentation in deep metric learning training. Specifically, the dml loss function is represented in a general form so that mixup loss can be easily computed for different pairs. This loss is combined with regular dml loss for training the network. The method is evaluated on CUB200, CARS196, SOP and IN-SHOP datasets where it outperforms it's baselines and also achieves SOTA results.
SP:e57e92a5f8b3000b7687949bb6913a0ee7a5add7
It Takes Two to Tango: Mixup for Deep Metric Learning
1 INTRODUCTION Classification is one of the most studied tasks in machine learning and deep learning . It is a common source of pre-trained models for transfer learning to other tasks ( Donahue et al. , 2014 ; Kolesnikov et al. , 2020 ) . It has been studied under different supervision settings ( Caron et al. , 2018 ; Sohn et al. , 2020 ) , knowledge transfer ( Hinton et al. , 2015 ) and data augmentation ( Cubuk et al. , 2018 ) , including the recent research on mixup ( Zhang et al. , 2018 ; Verma et al. , 2019 ) , where embeddings and labels are interpolated . Deep metric learning is about learning from pairwise interactions such that inference relies on instance embeddings , e.g . for nearest neighbor classification ( Oh Song et al. , ∗equal contribution 2016 ) , instance-level retrieval ( Gordo et al. , 2016 ) , few-shot learning ( Vinyals et al. , 2016 ) , face recognition ( Schroff et al. , 2015 ) and semantic textual similarity ( Reimers & Gurevych , 2019 ) . Following ( Xing et al. , 2003 ) , it is most often fully supervised by one class label per example , like classification . The two most studied problems are loss functions ( Musgrave et al. , 2020 ) and hard example mining ( Wu et al. , 2017 ; Robinson et al. , 2021 ) . Tuple-based losses with example weighting ( Wang et al. , 2019 ) can play the role of both . Unlike classification , classes ( and distributions ) at training and inference are different in metric learning . Thus , one might expect interpolation-based data augmentation like mixup to be even more important in metric learning than in classification . Yet , recent attempts are mostly limited to special cases of embedding interpolation and have trouble with label interpolation ( Ko & Gu , 2020 ) . This raises the question : what is a proper way to define and interpolate labels for metric learning ? In this work , we observe that metric learning is not different from classification , where examples are replaced by pairs of examples and class labels by “ positive ” or “ negative ” , according to whether class labels of individual examples are the same or not . The positive or negative label of an example , or a pair , is determined in relation to a given example which is called an anchor . Then , as shown in Figure 1 , a straightforward way is to use a binary ( two class ) label per pair and interpolate it linearly as in standard mixup . We call our method Metric Mix , or Metrix for short . To show that mixing examples improves representation learning , we quantitatively measure the properties of the test distributions using alignment and uniformity ( Wang & Isola , 2020 ) . Alignment measures the clustering quality and uniformity measures its distribution over the embedding space ; a well clustered and uniformly spread distribution indicates higher representation quality . We also introduce a new metric , utilization , to measure the extent to which a test example , seen as a query , lies near any of the training examples , clean or mixed . By quantitatively measuring these three metrics , we show that interpolation-based data augmentation like mixup is very important in metric learning , given the difference between distributions at training and inference . In summary , we make the following contributions : 1 . We define a generic way of representing and interpolating labels , which allows straightforward extension of any kind of mixup to deep metric learning for a large class of loss functions . We develop our method on a generic formulation that encapsulates these functions ( section 3 ) . 2 . We define the “ positivity ” of a mixed example and we study precisely how it increases as a function of the interpolation factor , both in theory and empirically ( subsection 3.6 ) . 3 . We systematically evaluate mixup for deep metric learning under different settings , including mixup at different representation levels ( input/manifold ) , mixup of different pairs of examples ( anchors/positives/negatives ) , loss functions and hard example mining ( subsection 4.2 ) . 4 . We introduce a new evaluation metric , utilization , validating that a representation more appropriate for test classes is implicitly learned during exploration of the embedding space in the presence of mixup ( subsection 4.3 ) . 5 . We improve the state of the art on four common metric learning benchmarks ( subsection 4.2 ) . 2 RELATED WORK . Metric learning Metric learning aims to learn a metric such that positive pairs of examples are nearby and negative ones are far away . In deep metric learning , we learn an explicit non-linear mapping from raw input to a low-dimensional embedding space ( Oh Song et al. , 2016 ) , where the Euclidean distance has the desired properties . Although learning can be unsupervised ( Hadsell et al. , 2006 ) , deep metric learning has mostly followed the supervised approach , where positive and negative pairs are defined as having the same or different class label , respectively ( Xing et al. , 2003 ) . Loss functions can be distinguished into pair-based and proxy-based ( Musgrave et al. , 2020 ) . Pairbased losses use pairs of examples ( Wu et al. , 2017 ; Hadsell et al. , 2006 ) , which can be defined over triplets ( Wang et al. , 2014 ; Schroff et al. , 2015 ; Weinberger & Saul , 2009 ; Hermans et al. , 2017 ) , quadruples ( Chen et al. , 2017 ) or tuples ( Sohn , 2016 ; Oh Song et al. , 2016 ; Wang et al. , 2019 ) . Proxy-based losses use one or more proxies per class , which are learnable parameters in the embedding space ( Movshovitz-Attias et al. , 2017 ; Qian et al. , 2019 ; Kim et al. , 2020c ; Teh et al. , 2020 ; Zhu et al. , 2020b ) . Pair-based losses capture data-to-data relations , but they are sensitive to noisy labels and outliers . They often involve terms where given constraints are satisfied , which produce zero gradients and do not contribute to training . This necessitates mining of hard examples that violate the constraints , like semi-hard ( Schroff et al. , 2015 ) and distance weighted ( Wu et al. , 2017 ) . By contrast , proxy-based losses use data-to-proxy relations , assuming proxies can capture the global structure of the embedding space . They involve less computations that are more likely to produce nonzero gradient , hence have less or no dependence on mining and converge faster . Mixup Input mixup ( Zhang et al. , 2018 ) linearly interpolates between two or more examples in the input space for data augmentation . Numerous variants take advantage of the structure of the input space to interpolate non-linearly , e.g . for images ( Yun et al. , 2019 ; Kim et al. , 2020a ; 2021 ; Hendrycks et al. , 2020 ; DeVries & Taylor , 2017 ; Qin et al. , 2020 ; Uddin et al. , 2021 ) . Manifold mixup ( Verma et al. , 2019 ) interpolates intermediate representations instead , where the structure is learned . This can be applied to or assisted by decoding back to the input space ( Berthelot et al. , 2018 ; Liu et al. , 2018 ; Beckham et al. , 2019 ; Zhu et al. , 2020a ; Venkataramanan et al. , 2021 ) . In both cases , corresponding labels are linearly interpolated too . Most studies are limited to cross-entropy loss for classification . Pairwise loss functions have been under-studied , as discussed below . Interpolation for pairwise loss functions As discussed in subsection 3.3 , interpolating target labels is not straightforward in pairwise loss functions . In deep metric learning , embedding expansion ( Ko & Gu , 2020 ) , HDML ( Zheng et al. , 2019 ) and symmetrical synthesis ( Gu & Ko , 2020 ) interpolate pairs of embeddings in a deterministic way within the same class , applying to pair-based losses , while proxy synthesis ( Gu et al. , 2021 ) interpolates between classes , applying to proxy-based losses . None performs label interpolation , which means that ( Gu et al. , 2021 ) risks synthesizing false negatives when the interpolation factor λ is close to 0 or 1 . In contrastive representation learning , MoCHi ( Kalantidis et al. , 2020 ) interpolates anchor with negative embeddings but not labels and chooses λ ∈ [ 0 , 0.5 ] to avoid false negatives . This resembles thresholding of λ at 0.5 in OptTransMix ( Zhu et al. , 2020a ) . Finally , i-mix ( Lee et al. , 2021 ) and MixCo ( Kim et al. , 2020b ) interpolate pairs of anchor embeddings as well as their ( virtual ) class labels linearly . There is only one positive , while all negatives are clean , so it can not take advantage of interpolation for relative weighting of positives/negatives per anchor ( Wang et al. , 2019 ) . By contrast , Metrix is developed for deep metric learning and applies to a large class of both pairbased and proxy-based losses . It can interpolate inputs , intermediate features or embeddings of anchors , ( multiple ) positives or negatives and the corresponding two-class ( positive/negative ) labels per anchor , such that relative weighting of positives/negatives depends on interpolation . 3 MIXUP FOR METRIC LEARNING . 3.1 PRELIMINARIES . Problem formulation We are given a training set X ⊂ X , where X is the input space . For each anchor a ∈ X , we are also given a set P ( a ) ⊂ X of positives and a set N ( a ) ⊂ X of negatives . The positives are typically examples that belong to the same class as the anchor , while negatives belong to a different class . The objective is to train the parameters θ of a model f : X → Rd that maps input examples to a d-dimensional embedding , such that positives are close to the anchor and negatives are far away in the embedding space . Given two examples x , x′ ∈ X , we denote by s ( x , x′ ) the similarity between x , x′ in the embedding space , typically a decreasing function of Euclidean distance . It is common to ` 2-normalize embeddings and define s ( x , x′ ) : = 〈f ( x ) , f ( x′ ) 〉 , which is the cosine similarity . To simplify notation , we drop the dependence of f , s on θ. Pair-based losses ( Hadsell et al. , 2006 ; Wang et al. , 2014 ; Oh Song et al. , 2016 ; Wang et al. , 2019 ) use both anchors and positives/negatives in X , as discussed above . Proxy-based losses define one or more learnable proxies ∈ Rd per class , and only use proxies as anchors ( Kim et al. , 2020c ) or as positives/negatives ( Movshovitz-Attias et al. , 2017 ; Qian et al. , 2019 ; Teh et al. , 2020 ) . To accommodate for uniform exposition , we extend the definition of similarity as s ( v , x ) : = 〈v , f ( x ) 〉 for v ∈ Rd , x ∈ X ( proxy anchors ) and s ( x , v ) : = 〈f ( x ) , v〉 for x ∈ X , v ∈ Rd ( proxy positives/negatives ) . Finally , to accommodate for mixed embeddings in subsection 3.5 , we define s ( v , v′ ) : = 〈v , v′〉 for v , v′ ∈ Rd . Thus , we define s : ( X ∪ Rd ) 2 → R over pairs of either inputs in X or embeddings in Rd . We discuss a few representative loss functions below , before deriving a generic form . Contrastive The contrastive loss ( Hadsell et al. , 2006 ) encourages positive examples to be pulled towards the anchor and negative examples to be pushed away by a margin m ∈ R. This loss is additive over positives and negatives , defined as : ` cont ( a ; θ ) : = ∑ p∈P ( a ) −s ( a , p ) + ∑ n∈N ( a ) [ s ( a , n ) −m ] + . ( 1 ) Multi-Similarity The multi-similarity loss ( Wang et al. , 2019 ) introduces relative weighting to encourage positives ( negatives ) that are farthest from ( closest to ) the anchor to be pulled towards ( pushed away from ) the anchor by a higher weight . This loss is not additive over positives and negatives : ` MS ( a ; θ ) : = 1 β log 1 + ∑ p∈P ( a ) e−β ( s ( a , p ) −m ) + 1 γ log 1 + ∑ n∈N ( a ) eγ ( s ( a , n ) −m ) . ( 2 ) Here , β , γ ∈ R are scaling factors for positives , negatives respectively . Proxy Anchor The proxy anchor loss ( Kim et al. , 2020c ) defines a learnable proxy in Rd for each class and only uses proxies as anchors . For a given anchor ( proxy ) a ∈ Rd , the loss has the same form as ( 2 ) , although similarity s is evaluated on Rd ×X .
The paper deals with the problem of metrics learning. It proposes to extend Mixap data augmentation from calssification to metrics learning. This Mixap data augmentation approach interpolates two or more examples (either directly in the input or the corresponding embeddings - eq.4) and corresponding target labels at a time. This task is challenging because unlike classification, the loss functions used in metric learning are not additive over examples and hence the authors claim that the idea of interpolating target labels is not straightforward. The authors suggest a general formulation to accomodate mixup for many losses currenly used in metrics learning (see eqs. 3, 7, 9, 10 for generic formulation and eqs. 13, 14,15 for formulation of specific losses). The authors provie extensive experiments that show the effectiveness of their techqniue (Table 2) on 4 different dataset (Table 4)
SP:e57e92a5f8b3000b7687949bb6913a0ee7a5add7
It Takes Two to Tango: Mixup for Deep Metric Learning
1 INTRODUCTION Classification is one of the most studied tasks in machine learning and deep learning . It is a common source of pre-trained models for transfer learning to other tasks ( Donahue et al. , 2014 ; Kolesnikov et al. , 2020 ) . It has been studied under different supervision settings ( Caron et al. , 2018 ; Sohn et al. , 2020 ) , knowledge transfer ( Hinton et al. , 2015 ) and data augmentation ( Cubuk et al. , 2018 ) , including the recent research on mixup ( Zhang et al. , 2018 ; Verma et al. , 2019 ) , where embeddings and labels are interpolated . Deep metric learning is about learning from pairwise interactions such that inference relies on instance embeddings , e.g . for nearest neighbor classification ( Oh Song et al. , ∗equal contribution 2016 ) , instance-level retrieval ( Gordo et al. , 2016 ) , few-shot learning ( Vinyals et al. , 2016 ) , face recognition ( Schroff et al. , 2015 ) and semantic textual similarity ( Reimers & Gurevych , 2019 ) . Following ( Xing et al. , 2003 ) , it is most often fully supervised by one class label per example , like classification . The two most studied problems are loss functions ( Musgrave et al. , 2020 ) and hard example mining ( Wu et al. , 2017 ; Robinson et al. , 2021 ) . Tuple-based losses with example weighting ( Wang et al. , 2019 ) can play the role of both . Unlike classification , classes ( and distributions ) at training and inference are different in metric learning . Thus , one might expect interpolation-based data augmentation like mixup to be even more important in metric learning than in classification . Yet , recent attempts are mostly limited to special cases of embedding interpolation and have trouble with label interpolation ( Ko & Gu , 2020 ) . This raises the question : what is a proper way to define and interpolate labels for metric learning ? In this work , we observe that metric learning is not different from classification , where examples are replaced by pairs of examples and class labels by “ positive ” or “ negative ” , according to whether class labels of individual examples are the same or not . The positive or negative label of an example , or a pair , is determined in relation to a given example which is called an anchor . Then , as shown in Figure 1 , a straightforward way is to use a binary ( two class ) label per pair and interpolate it linearly as in standard mixup . We call our method Metric Mix , or Metrix for short . To show that mixing examples improves representation learning , we quantitatively measure the properties of the test distributions using alignment and uniformity ( Wang & Isola , 2020 ) . Alignment measures the clustering quality and uniformity measures its distribution over the embedding space ; a well clustered and uniformly spread distribution indicates higher representation quality . We also introduce a new metric , utilization , to measure the extent to which a test example , seen as a query , lies near any of the training examples , clean or mixed . By quantitatively measuring these three metrics , we show that interpolation-based data augmentation like mixup is very important in metric learning , given the difference between distributions at training and inference . In summary , we make the following contributions : 1 . We define a generic way of representing and interpolating labels , which allows straightforward extension of any kind of mixup to deep metric learning for a large class of loss functions . We develop our method on a generic formulation that encapsulates these functions ( section 3 ) . 2 . We define the “ positivity ” of a mixed example and we study precisely how it increases as a function of the interpolation factor , both in theory and empirically ( subsection 3.6 ) . 3 . We systematically evaluate mixup for deep metric learning under different settings , including mixup at different representation levels ( input/manifold ) , mixup of different pairs of examples ( anchors/positives/negatives ) , loss functions and hard example mining ( subsection 4.2 ) . 4 . We introduce a new evaluation metric , utilization , validating that a representation more appropriate for test classes is implicitly learned during exploration of the embedding space in the presence of mixup ( subsection 4.3 ) . 5 . We improve the state of the art on four common metric learning benchmarks ( subsection 4.2 ) . 2 RELATED WORK . Metric learning Metric learning aims to learn a metric such that positive pairs of examples are nearby and negative ones are far away . In deep metric learning , we learn an explicit non-linear mapping from raw input to a low-dimensional embedding space ( Oh Song et al. , 2016 ) , where the Euclidean distance has the desired properties . Although learning can be unsupervised ( Hadsell et al. , 2006 ) , deep metric learning has mostly followed the supervised approach , where positive and negative pairs are defined as having the same or different class label , respectively ( Xing et al. , 2003 ) . Loss functions can be distinguished into pair-based and proxy-based ( Musgrave et al. , 2020 ) . Pairbased losses use pairs of examples ( Wu et al. , 2017 ; Hadsell et al. , 2006 ) , which can be defined over triplets ( Wang et al. , 2014 ; Schroff et al. , 2015 ; Weinberger & Saul , 2009 ; Hermans et al. , 2017 ) , quadruples ( Chen et al. , 2017 ) or tuples ( Sohn , 2016 ; Oh Song et al. , 2016 ; Wang et al. , 2019 ) . Proxy-based losses use one or more proxies per class , which are learnable parameters in the embedding space ( Movshovitz-Attias et al. , 2017 ; Qian et al. , 2019 ; Kim et al. , 2020c ; Teh et al. , 2020 ; Zhu et al. , 2020b ) . Pair-based losses capture data-to-data relations , but they are sensitive to noisy labels and outliers . They often involve terms where given constraints are satisfied , which produce zero gradients and do not contribute to training . This necessitates mining of hard examples that violate the constraints , like semi-hard ( Schroff et al. , 2015 ) and distance weighted ( Wu et al. , 2017 ) . By contrast , proxy-based losses use data-to-proxy relations , assuming proxies can capture the global structure of the embedding space . They involve less computations that are more likely to produce nonzero gradient , hence have less or no dependence on mining and converge faster . Mixup Input mixup ( Zhang et al. , 2018 ) linearly interpolates between two or more examples in the input space for data augmentation . Numerous variants take advantage of the structure of the input space to interpolate non-linearly , e.g . for images ( Yun et al. , 2019 ; Kim et al. , 2020a ; 2021 ; Hendrycks et al. , 2020 ; DeVries & Taylor , 2017 ; Qin et al. , 2020 ; Uddin et al. , 2021 ) . Manifold mixup ( Verma et al. , 2019 ) interpolates intermediate representations instead , where the structure is learned . This can be applied to or assisted by decoding back to the input space ( Berthelot et al. , 2018 ; Liu et al. , 2018 ; Beckham et al. , 2019 ; Zhu et al. , 2020a ; Venkataramanan et al. , 2021 ) . In both cases , corresponding labels are linearly interpolated too . Most studies are limited to cross-entropy loss for classification . Pairwise loss functions have been under-studied , as discussed below . Interpolation for pairwise loss functions As discussed in subsection 3.3 , interpolating target labels is not straightforward in pairwise loss functions . In deep metric learning , embedding expansion ( Ko & Gu , 2020 ) , HDML ( Zheng et al. , 2019 ) and symmetrical synthesis ( Gu & Ko , 2020 ) interpolate pairs of embeddings in a deterministic way within the same class , applying to pair-based losses , while proxy synthesis ( Gu et al. , 2021 ) interpolates between classes , applying to proxy-based losses . None performs label interpolation , which means that ( Gu et al. , 2021 ) risks synthesizing false negatives when the interpolation factor λ is close to 0 or 1 . In contrastive representation learning , MoCHi ( Kalantidis et al. , 2020 ) interpolates anchor with negative embeddings but not labels and chooses λ ∈ [ 0 , 0.5 ] to avoid false negatives . This resembles thresholding of λ at 0.5 in OptTransMix ( Zhu et al. , 2020a ) . Finally , i-mix ( Lee et al. , 2021 ) and MixCo ( Kim et al. , 2020b ) interpolate pairs of anchor embeddings as well as their ( virtual ) class labels linearly . There is only one positive , while all negatives are clean , so it can not take advantage of interpolation for relative weighting of positives/negatives per anchor ( Wang et al. , 2019 ) . By contrast , Metrix is developed for deep metric learning and applies to a large class of both pairbased and proxy-based losses . It can interpolate inputs , intermediate features or embeddings of anchors , ( multiple ) positives or negatives and the corresponding two-class ( positive/negative ) labels per anchor , such that relative weighting of positives/negatives depends on interpolation . 3 MIXUP FOR METRIC LEARNING . 3.1 PRELIMINARIES . Problem formulation We are given a training set X ⊂ X , where X is the input space . For each anchor a ∈ X , we are also given a set P ( a ) ⊂ X of positives and a set N ( a ) ⊂ X of negatives . The positives are typically examples that belong to the same class as the anchor , while negatives belong to a different class . The objective is to train the parameters θ of a model f : X → Rd that maps input examples to a d-dimensional embedding , such that positives are close to the anchor and negatives are far away in the embedding space . Given two examples x , x′ ∈ X , we denote by s ( x , x′ ) the similarity between x , x′ in the embedding space , typically a decreasing function of Euclidean distance . It is common to ` 2-normalize embeddings and define s ( x , x′ ) : = 〈f ( x ) , f ( x′ ) 〉 , which is the cosine similarity . To simplify notation , we drop the dependence of f , s on θ. Pair-based losses ( Hadsell et al. , 2006 ; Wang et al. , 2014 ; Oh Song et al. , 2016 ; Wang et al. , 2019 ) use both anchors and positives/negatives in X , as discussed above . Proxy-based losses define one or more learnable proxies ∈ Rd per class , and only use proxies as anchors ( Kim et al. , 2020c ) or as positives/negatives ( Movshovitz-Attias et al. , 2017 ; Qian et al. , 2019 ; Teh et al. , 2020 ) . To accommodate for uniform exposition , we extend the definition of similarity as s ( v , x ) : = 〈v , f ( x ) 〉 for v ∈ Rd , x ∈ X ( proxy anchors ) and s ( x , v ) : = 〈f ( x ) , v〉 for x ∈ X , v ∈ Rd ( proxy positives/negatives ) . Finally , to accommodate for mixed embeddings in subsection 3.5 , we define s ( v , v′ ) : = 〈v , v′〉 for v , v′ ∈ Rd . Thus , we define s : ( X ∪ Rd ) 2 → R over pairs of either inputs in X or embeddings in Rd . We discuss a few representative loss functions below , before deriving a generic form . Contrastive The contrastive loss ( Hadsell et al. , 2006 ) encourages positive examples to be pulled towards the anchor and negative examples to be pushed away by a margin m ∈ R. This loss is additive over positives and negatives , defined as : ` cont ( a ; θ ) : = ∑ p∈P ( a ) −s ( a , p ) + ∑ n∈N ( a ) [ s ( a , n ) −m ] + . ( 1 ) Multi-Similarity The multi-similarity loss ( Wang et al. , 2019 ) introduces relative weighting to encourage positives ( negatives ) that are farthest from ( closest to ) the anchor to be pulled towards ( pushed away from ) the anchor by a higher weight . This loss is not additive over positives and negatives : ` MS ( a ; θ ) : = 1 β log 1 + ∑ p∈P ( a ) e−β ( s ( a , p ) −m ) + 1 γ log 1 + ∑ n∈N ( a ) eγ ( s ( a , n ) −m ) . ( 2 ) Here , β , γ ∈ R are scaling factors for positives , negatives respectively . Proxy Anchor The proxy anchor loss ( Kim et al. , 2020c ) defines a learnable proxy in Rd for each class and only uses proxies as anchors . For a given anchor ( proxy ) a ∈ Rd , the loss has the same form as ( 2 ) , although similarity s is evaluated on Rd ×X .
This work explores the way of mixing both examples and target labels for deep metric learning. It considers metric learning loss and data augmentation technique (e.g., mixup) together when handling two or more examples at a time. A generalized formulation of loss function was modified to accommodate for the mixup technique. Also, a new metric called utilization is introduced for evaluating representation improvements. Some theoretical analysis are provided. A number of experiments were conducted on four benchmarks to show the superiority of the proposed method.
SP:e57e92a5f8b3000b7687949bb6913a0ee7a5add7
Adversarially Robust Conformal Prediction
1 INTRODUCTION . Deep neural net classifiers have achieved tremendous accomplishments over the last several years . Nevertheless , the increased deployment of these algorithms in real-world applications , especially ones that can be life-threatening like autonomous driving , raises major concerns about their reliability ( Heaven , 2019 ) . To alleviate these issues , it is important to develop techniques that allow the users to assess the uncertainty in predictions obtained by complex classifiers , revealing their limitations . Conformal prediction ( Vovk et al. , 2005 ) is a simple yet powerful tool for generating prediction sets whose size reflects the prediction uncertainty . Specifically , suppose we are given n training examples { ( Xi , Yi ) } ni=1 with feature vector Xi ∈ Rd , discrete and unordered class label Yi∈ { 1 , 2 , . . . , L } = Y , and any learning algorithm that aims at predicting the unknown Yn+1 of a given test point Xn+1 . Under the assumption that the training and test examples are sampled exchangeably—e.g. , they may be drawn i.i.d.—from an unknown distribution PXY , conformal prediction algorithms construct a distribution-free prediction set C ( Xn+1 ) ⊆ Y guaranteed to contain the test label Yn+1 at any desired coverage probability 1− α ∈ ( 0 , 1 ) : P [ Yn+1 ∈ C ( Xn+1 ) ] ≥ 1− α . ( 1 ) For example , it is common to set the desired coverage level 1 − α to be 90 % or 95 % . Note that the coverage probability P [ Yn+1 ∈ C ( Xn+1 ) ] is marginal because it is taken over all the training examples { ( Xi , Yi ) } ni=1 and the test point Xn+1 . The key idea of conformal prediction is to fit a classifier on the training set and use this model to assign non-conformity scores for held-out data points . These scores reflect the prediction error of the underlying classifier , where , loosely speaking , a smaller prediction error would lead to the construction of smaller and more informative sets . However , the sets constructed by the vanilla conformal method may not have the right coverage when the training and test points violate the exchangeability assumption ( Cauchois et al. , 2020 ; Gibbs & Candès , 2021 ; Tibshirani et al. , 2019 ; Podkopaev & Ramdas , 2021 ; Guan & Tibshirani , 2019 ) , which is hardly satisfied by real data in practice as distribution shift happens frequently ( Koh et al. , 2021 ) . In particular , we consider the potential threat of adversarial attacks ( Goodfellow et al. , 2015 ; Szegedy et al. , 2014 ; Carlini & Wagner , 2017 ) —carefully crafted human-imperceptible noise perturbations that drives the fitted model to err at test ( inference ) time . Such noise perturbations can introduce a large and arbitrary distribution shift that is extremely hard to estimate . In this setting , the prediction sets constructed by the vanilla conformal approach are often invalid , i.e. , do not satisfy ( 1 ) , as illustrated in Figure 1 . Following that figure , while this method achieves the desired 90 % coverage when applied to clean test data , the empirical coverage obtained when applying the same method on adversarial test examples falls dramatically below 90 % , to about 30 % . Therefore , it is the main motivation of this work to construct prediction sets that are robust to adversarial attacks . We formalize this requirement as follows : P [ Yn+1 ∈ Cδ ( X̃n+1 ) ] ≥ 1− α , ( 2 ) where X̃n+1 = Xn+1 + is the test adversarial example , and ‖ ‖2 ≤ δ is a norm-bounded adversarial perturbation . Note that we use the notation Cδ to distinguish between the new setting from the exchangeability case for which δ = 0 . Crucially , we require ( 2 ) to hold in finite samples , for any PXY , any adversarial perturbation of magnitude bounded by δ , and regardless of the choice or accuracy of the underlying classifier . At the same time , we wish Cδ to be as small as possible . To realize ( 2 ) with the desired coverage , we propose to combine randomized smoothing ( Duchi et al. , 2012 ; Cohen et al. , 2019 ; Salman et al. , 2019 ) with the vanilla conformal prediction procedure , and hence we name our technique Randomly Smoothed Conformal Prediction ( RSCP ) . Randomized smoothing allows us to bound the Lipschitz constant of any non-conformity score function by convolving it with the Gaussian distribution function . Leveraging this bound , we show how to modify conformal prediction and rigorously construct prediction sets that account for the adversarial perturbation . Figure 1 illustrates that our proposed RSCP approach successfully attains the desired coverage level whereas the vanilla conformal method fails . Observe that RSCP constructs slightly larger prediction sets , reflecting the increased uncertainty induced by the adversarial noise . The contributions of this paper are two-fold : ( i ) We propose , for the first time , a new conformal prediction method that can account for the potential adversarial threats during inference time . Our RSCP method , described in Section 3 , is model-agnostic in that it can work with any classifier and non-conformity score , scalable since the smoothing can be done by Monte Carlo integration with many i.i.d . Gaussian noise realizations , and robust against any ` 2-norm bounded adversarial attack . ( ii ) We prove that the prediction sets constructed by RSCP are valid in the sense of ( 2 ) , and , in Section 5 , support this theoretical result with numerical experiments on CIFAR10 , CIFAR100 , and ImageNet data sets . 2 CONFORMAL PREDICTION . Since the focus of this paper is on how to adapt the vanilla conformal prediction method to the adversarial setting , in this section , we give background on conformal prediction . While we focus here on classification problems , the method of conformal prediction can also be applied to regression tasks . The vanilla conformal prediction can be divided into two categories : the split conformal prediction and the full conformal prediction . The first one involves data splitting while the second one constructs valid sets without splitting the data but at the cost of a significant increase in computational complexity at test time ( Papadopoulos et al. , 2002 ; Papadopoulos , 2008 ; Vovk et al. , 2005 ) . To avoid prohibitive computation complexity , in this paper we focus only on split conformal prediction . This method starts by splitting the training data into two disjoint subsets : a proper training set Itr ⊆ { 1 , . . . , n } and a calibration set Ical = { 1 , . . . , n } \ Itr . Then , a classifier f̂ ( x ) ∈ [ 0 , 1 ] L is fit to the proper training set , estimating the conditional class probabilities P [ Y = y | X = x ] for all y ∈ Y . In the case of deep net classifiers , which is the focus of this work , this may be the output of the softmax layer . Next , we compute a non-conformity score Si = S ( Xi , Yi ) ∈ R for each calibration point { ( Xi , Yi ) } i∈Ical . This score expresses how well the model prediction f̂ ( X ) is aligned with the true label Y , where a lower score implies better alignment . For example , the score from Vovk et al . ( 2005 ) ; Lei et al . ( 2013 ) is given by S ( x , y ) = 1− f̂ ( x ) y , ( 3 ) where f̂ ( x ) y ∈ [ 0 , 1 ] is the yth entry in the vector f̂ ( x ) . Another example is the score proposed by Romano et al . ( 2020b ) , which can be expressed as S ( x , y ) = ∑ y′∈Y f̂ ( x ) y′ I { f̂ ( x ) y′ > f̂ ( x ) y } + f̂ ( x ) y · u , ( 4 ) where I is the indicator function and u is a random variable distributed uniformly over the segment [ 0 , 1 ] . We refer to the score from ( 3 ) as HPS as it was shown to construct homogeneous prediction sets . Analogously , we refer to ( 4 ) as APS since it tends to yield adaptive prediction sets that reflect better the underlying uncertainty across sub-populations ; see Romano et al . ( 2020b ) for more details . Given the desired coverage level 1−α , the prediction set for a new test point Xn+1 is formulated as C ( Xn+1 ) = { y ∈ Y : S ( Xn+1 , y ) ≤ Q1−α ( { Si } i∈Ical ) } , ( 5 ) where Q1−α ( { Si } i∈Ical ) : = the ( 1− α ) ( 1 + 1 1 + |Ical| ) th empirical quantile of { Si } i∈Ical ( 6 ) is the score positioned d ( n+ 1 ) ( 1− α ) e in the sorted array of calibration scores Si , i ∈ Ical . In plain words , in ( 5 ) we sweep over all possible labels y ∈ Y and include in C ( Xn+1 ) the ‘ guessed ’ labels y whose scores S ( Xn+1 , y ) are smaller than most of the calibration scores S ( Xi , Yi ) . Since the calibration and test points are drawn exchangeably from PXY and f̂ is fixed , the score S ( Xn+1 , y ) for the guess y = Yn+1 can fall anywhere in the sorted array of calibration scores with equal probability . This property guarantees that the prediction set ( 5 ) satisfies ( 1 ) ; see Vovk et al . ( 2005 ) . 3 RANDOMLY SMOOTHED CONFORMAL PREDICTION . In this section , we introduce our proposed RSCP framework for constructing prediction sets that are valid in the adversarial regime . Recall that an adversarial attack can lead to a significant distributional shift between the clean calibration points and the corrupted test example X̃n+1 = Xn+1 + , thus violating the fundamental exchangeability assumption of the split conformal procedure . Focusing on the guess y = Yn+1 , an effective attack would result in a larger non-conformity score for the corrupted test point S ( X̃n+1 , y ) compared to that of the clean input S ( Xn+1 , y ) . Therefore , a naive comparison of S ( X̃n+1 , y ) to the same threshold Q1−α from ( 6 ) , which neglects the increased uncertainty caused by the adversarial perturbation , will result in a prediction set that may not achieve the desired coverage , as already illustrated in Figure 1 . To address this , we should compare the test score to an inflated threshold , larger than Q1−α , which rigorously accounts for the effect of the adversarial noise . This is the core idea behind our proposal described in detail below ; see Figure 2 . 3.1 ADVERSARIALLY ROBUST CALIBRATION . Suppose we are given a non-conformity score function S̃ for which we can bound by how much its value could be increased due to the adversarial noise ‖ ‖2 ≤ δ added toXn+1 . Formally , we require the score S̃ to satisfy the following relation : S̃ ( X̃n+1 , y ) ≤ S̃ ( Xn+1 , y ) +Mδ , ∀y ∈ Y , ( 7 ) where Mδ ≥ 0 is a constant that is a function of δ , such that Mδ1 ≥ Mδ2 for δ1 ≥ δ2 and Mδ = 0 for δ = 0 . In essence , we would like ( 7 ) to hold for the smallest possible Mδ . We denote this score function by S̃ to emphasize that it must satisfy ( 7 ) , distinguishing it from existing non-conformity scores S , e.g. , ( 3 ) – ( 4 ) ; see Section 3.2 for a concrete and very general framework for designing S̃ for which the constant Mδ can be easily derived . Importantly , Mδ serves as a bridge between the observed score S̃ ( X̃n+1 , y ) and the unobserved one S̃ ( Xn+1 , y ) for a fixed y ∈ Y . Leveraging this property , we propose to construct a prediction set robust to a norm-bounded adversarial attack by applying the following decision rule : Cδ ( X̃n+1 ) = { y ∈ Y : S̃ ( X̃n+1 , y ) ≤ Q1−α ( { S̃i } i∈Ical ) +Mδ } , ( 8 ) where S̃i = S̃ ( Xi , Yi ) . In contrast to the vanilla split conformal approach ( 5 ) , the prediction set defined above is generated by comparing the test score to an inflated threshold Q1−α + Mδ , as illustrated in Figure 2 . Notice that the level of inflation is affected by the magnitude of the adversarial perturbation as well as the robustness of S̃ , i.e. , the value of Mδ . A larger perturbation implies larger inflation , and a more robust score S̃ implies smaller inflation . The theorem below states that the constructed prediction set ( 8 ) is guaranteed to contain the unknown target label Yn+1 with a probability of at least 1 − α , for any distribution PXY , sample size n , score function S̃ that satisfies ( 7 ) , and adversarial perturbation of magnitude δ generated by any attack algorithm . The proof of this and all other results can be found in Section S1 of the Supplementary Material . Theorem 1 . Assume that the samples { ( Xi , Yi ) } n+1i=1 are drawn exchangeably from some unknown distribution PXY . Let X̃n+1 = Xn+1 + be a clean test example Xn+1 with an additive corruption of an ` 2-norm bounded adversarial noise ‖ ‖2 ≤ δ . Then , the prediction set Cδ ( X̃n+1 ) defined in ( 8 ) satisfies P [ Yn+1 ∈ Cδ ( X̃n+1 ) ] ≥ 1− α . Before presenting our framework to construct scores that rigorously satisfy ( 7 ) , we pause to prove a lower bound on the coverage that the vanilla split conformal could attain in the adversarial setting . Theorem 2 . Under the assumptions of Theorem 1 , the prediction set C ( X̃n+1 ) defined in ( 5 ) , applied with S̃ in place of S , satisfies P [ Yn+1 ∈ C ( X̃n+1 ) ] ≥ τ , where τ = max { τ ′ : Qτ ′ ( { S̃i } i∈Ical ) ≤ Q1−α ( { S̃i } i∈Ical ) −Mδ } . ( 9 ) Note that τ can be simply computed by running a grid search on the sorted array of calibration scores . It is important to observe that in contrast to Theorem 1 , which guarantees at least 1−α coverage for any user-specified level α , the worst coverage level τ of the vanilla split conformal is not controlled explicitly , i.e. , τ is known only after looking at the training and calibration data . Observe also that , by construction , τ ≤ 1 − α ( see Supplementary Section S1 ) and equality is met in a special case where δ = 0 , i.e. , no attack is performed . In this special case , Mδ = 0 by definition , and both Theorem 1 and 2 converge to the classic coverage guarantee of the vanilla conformal algorithm .
Quantifying predictive uncertainty is critical for various real-world applications of ML models. Post-hoc ``wrapper-style'' procedures for uncertainty quantification, which can be built on top of any black-box model and thus do not require modifications of training algorithms, are of great value due to a, typically, high number of engineering tweaks used during the model development stage. For example, (split) conformal prediction modifies an underlying point prediction model, which outputs the top-ranked label only, into a set-valued predictor that instead outputs a set of labels. Under the i.i.d. (or more generally, exchangeability) assumption, the resulting sets are provably valid (in terms of coverage) with guarantees being marginal over calibration and test data. Violation of the i.i.d. assumption invalidates the inference, and adaptations to some structured distribution shifts have been proposed recently in the literature. The current work focuses on a setting where adversarial examples might be present at the test stage. Vanilla conformal is based on considering a collection of candidate prediction sets, parameterized by a single parameter, which is tuned/calibrated using a held-out set for performing set-valued predictions on test data. The authors propose correction of vanilla conformal, which essentially boils down to inflating the threshold in a way that guarantees robustness against adversarial examples with bounded $\ell_2$-norm (using randomized smoothing), where inflation results in outputting larger the prediction sets.
SP:e0b6ddb99eda543e020506a29c8eb67f0d4b62bd
Adversarially Robust Conformal Prediction
1 INTRODUCTION . Deep neural net classifiers have achieved tremendous accomplishments over the last several years . Nevertheless , the increased deployment of these algorithms in real-world applications , especially ones that can be life-threatening like autonomous driving , raises major concerns about their reliability ( Heaven , 2019 ) . To alleviate these issues , it is important to develop techniques that allow the users to assess the uncertainty in predictions obtained by complex classifiers , revealing their limitations . Conformal prediction ( Vovk et al. , 2005 ) is a simple yet powerful tool for generating prediction sets whose size reflects the prediction uncertainty . Specifically , suppose we are given n training examples { ( Xi , Yi ) } ni=1 with feature vector Xi ∈ Rd , discrete and unordered class label Yi∈ { 1 , 2 , . . . , L } = Y , and any learning algorithm that aims at predicting the unknown Yn+1 of a given test point Xn+1 . Under the assumption that the training and test examples are sampled exchangeably—e.g. , they may be drawn i.i.d.—from an unknown distribution PXY , conformal prediction algorithms construct a distribution-free prediction set C ( Xn+1 ) ⊆ Y guaranteed to contain the test label Yn+1 at any desired coverage probability 1− α ∈ ( 0 , 1 ) : P [ Yn+1 ∈ C ( Xn+1 ) ] ≥ 1− α . ( 1 ) For example , it is common to set the desired coverage level 1 − α to be 90 % or 95 % . Note that the coverage probability P [ Yn+1 ∈ C ( Xn+1 ) ] is marginal because it is taken over all the training examples { ( Xi , Yi ) } ni=1 and the test point Xn+1 . The key idea of conformal prediction is to fit a classifier on the training set and use this model to assign non-conformity scores for held-out data points . These scores reflect the prediction error of the underlying classifier , where , loosely speaking , a smaller prediction error would lead to the construction of smaller and more informative sets . However , the sets constructed by the vanilla conformal method may not have the right coverage when the training and test points violate the exchangeability assumption ( Cauchois et al. , 2020 ; Gibbs & Candès , 2021 ; Tibshirani et al. , 2019 ; Podkopaev & Ramdas , 2021 ; Guan & Tibshirani , 2019 ) , which is hardly satisfied by real data in practice as distribution shift happens frequently ( Koh et al. , 2021 ) . In particular , we consider the potential threat of adversarial attacks ( Goodfellow et al. , 2015 ; Szegedy et al. , 2014 ; Carlini & Wagner , 2017 ) —carefully crafted human-imperceptible noise perturbations that drives the fitted model to err at test ( inference ) time . Such noise perturbations can introduce a large and arbitrary distribution shift that is extremely hard to estimate . In this setting , the prediction sets constructed by the vanilla conformal approach are often invalid , i.e. , do not satisfy ( 1 ) , as illustrated in Figure 1 . Following that figure , while this method achieves the desired 90 % coverage when applied to clean test data , the empirical coverage obtained when applying the same method on adversarial test examples falls dramatically below 90 % , to about 30 % . Therefore , it is the main motivation of this work to construct prediction sets that are robust to adversarial attacks . We formalize this requirement as follows : P [ Yn+1 ∈ Cδ ( X̃n+1 ) ] ≥ 1− α , ( 2 ) where X̃n+1 = Xn+1 + is the test adversarial example , and ‖ ‖2 ≤ δ is a norm-bounded adversarial perturbation . Note that we use the notation Cδ to distinguish between the new setting from the exchangeability case for which δ = 0 . Crucially , we require ( 2 ) to hold in finite samples , for any PXY , any adversarial perturbation of magnitude bounded by δ , and regardless of the choice or accuracy of the underlying classifier . At the same time , we wish Cδ to be as small as possible . To realize ( 2 ) with the desired coverage , we propose to combine randomized smoothing ( Duchi et al. , 2012 ; Cohen et al. , 2019 ; Salman et al. , 2019 ) with the vanilla conformal prediction procedure , and hence we name our technique Randomly Smoothed Conformal Prediction ( RSCP ) . Randomized smoothing allows us to bound the Lipschitz constant of any non-conformity score function by convolving it with the Gaussian distribution function . Leveraging this bound , we show how to modify conformal prediction and rigorously construct prediction sets that account for the adversarial perturbation . Figure 1 illustrates that our proposed RSCP approach successfully attains the desired coverage level whereas the vanilla conformal method fails . Observe that RSCP constructs slightly larger prediction sets , reflecting the increased uncertainty induced by the adversarial noise . The contributions of this paper are two-fold : ( i ) We propose , for the first time , a new conformal prediction method that can account for the potential adversarial threats during inference time . Our RSCP method , described in Section 3 , is model-agnostic in that it can work with any classifier and non-conformity score , scalable since the smoothing can be done by Monte Carlo integration with many i.i.d . Gaussian noise realizations , and robust against any ` 2-norm bounded adversarial attack . ( ii ) We prove that the prediction sets constructed by RSCP are valid in the sense of ( 2 ) , and , in Section 5 , support this theoretical result with numerical experiments on CIFAR10 , CIFAR100 , and ImageNet data sets . 2 CONFORMAL PREDICTION . Since the focus of this paper is on how to adapt the vanilla conformal prediction method to the adversarial setting , in this section , we give background on conformal prediction . While we focus here on classification problems , the method of conformal prediction can also be applied to regression tasks . The vanilla conformal prediction can be divided into two categories : the split conformal prediction and the full conformal prediction . The first one involves data splitting while the second one constructs valid sets without splitting the data but at the cost of a significant increase in computational complexity at test time ( Papadopoulos et al. , 2002 ; Papadopoulos , 2008 ; Vovk et al. , 2005 ) . To avoid prohibitive computation complexity , in this paper we focus only on split conformal prediction . This method starts by splitting the training data into two disjoint subsets : a proper training set Itr ⊆ { 1 , . . . , n } and a calibration set Ical = { 1 , . . . , n } \ Itr . Then , a classifier f̂ ( x ) ∈ [ 0 , 1 ] L is fit to the proper training set , estimating the conditional class probabilities P [ Y = y | X = x ] for all y ∈ Y . In the case of deep net classifiers , which is the focus of this work , this may be the output of the softmax layer . Next , we compute a non-conformity score Si = S ( Xi , Yi ) ∈ R for each calibration point { ( Xi , Yi ) } i∈Ical . This score expresses how well the model prediction f̂ ( X ) is aligned with the true label Y , where a lower score implies better alignment . For example , the score from Vovk et al . ( 2005 ) ; Lei et al . ( 2013 ) is given by S ( x , y ) = 1− f̂ ( x ) y , ( 3 ) where f̂ ( x ) y ∈ [ 0 , 1 ] is the yth entry in the vector f̂ ( x ) . Another example is the score proposed by Romano et al . ( 2020b ) , which can be expressed as S ( x , y ) = ∑ y′∈Y f̂ ( x ) y′ I { f̂ ( x ) y′ > f̂ ( x ) y } + f̂ ( x ) y · u , ( 4 ) where I is the indicator function and u is a random variable distributed uniformly over the segment [ 0 , 1 ] . We refer to the score from ( 3 ) as HPS as it was shown to construct homogeneous prediction sets . Analogously , we refer to ( 4 ) as APS since it tends to yield adaptive prediction sets that reflect better the underlying uncertainty across sub-populations ; see Romano et al . ( 2020b ) for more details . Given the desired coverage level 1−α , the prediction set for a new test point Xn+1 is formulated as C ( Xn+1 ) = { y ∈ Y : S ( Xn+1 , y ) ≤ Q1−α ( { Si } i∈Ical ) } , ( 5 ) where Q1−α ( { Si } i∈Ical ) : = the ( 1− α ) ( 1 + 1 1 + |Ical| ) th empirical quantile of { Si } i∈Ical ( 6 ) is the score positioned d ( n+ 1 ) ( 1− α ) e in the sorted array of calibration scores Si , i ∈ Ical . In plain words , in ( 5 ) we sweep over all possible labels y ∈ Y and include in C ( Xn+1 ) the ‘ guessed ’ labels y whose scores S ( Xn+1 , y ) are smaller than most of the calibration scores S ( Xi , Yi ) . Since the calibration and test points are drawn exchangeably from PXY and f̂ is fixed , the score S ( Xn+1 , y ) for the guess y = Yn+1 can fall anywhere in the sorted array of calibration scores with equal probability . This property guarantees that the prediction set ( 5 ) satisfies ( 1 ) ; see Vovk et al . ( 2005 ) . 3 RANDOMLY SMOOTHED CONFORMAL PREDICTION . In this section , we introduce our proposed RSCP framework for constructing prediction sets that are valid in the adversarial regime . Recall that an adversarial attack can lead to a significant distributional shift between the clean calibration points and the corrupted test example X̃n+1 = Xn+1 + , thus violating the fundamental exchangeability assumption of the split conformal procedure . Focusing on the guess y = Yn+1 , an effective attack would result in a larger non-conformity score for the corrupted test point S ( X̃n+1 , y ) compared to that of the clean input S ( Xn+1 , y ) . Therefore , a naive comparison of S ( X̃n+1 , y ) to the same threshold Q1−α from ( 6 ) , which neglects the increased uncertainty caused by the adversarial perturbation , will result in a prediction set that may not achieve the desired coverage , as already illustrated in Figure 1 . To address this , we should compare the test score to an inflated threshold , larger than Q1−α , which rigorously accounts for the effect of the adversarial noise . This is the core idea behind our proposal described in detail below ; see Figure 2 . 3.1 ADVERSARIALLY ROBUST CALIBRATION . Suppose we are given a non-conformity score function S̃ for which we can bound by how much its value could be increased due to the adversarial noise ‖ ‖2 ≤ δ added toXn+1 . Formally , we require the score S̃ to satisfy the following relation : S̃ ( X̃n+1 , y ) ≤ S̃ ( Xn+1 , y ) +Mδ , ∀y ∈ Y , ( 7 ) where Mδ ≥ 0 is a constant that is a function of δ , such that Mδ1 ≥ Mδ2 for δ1 ≥ δ2 and Mδ = 0 for δ = 0 . In essence , we would like ( 7 ) to hold for the smallest possible Mδ . We denote this score function by S̃ to emphasize that it must satisfy ( 7 ) , distinguishing it from existing non-conformity scores S , e.g. , ( 3 ) – ( 4 ) ; see Section 3.2 for a concrete and very general framework for designing S̃ for which the constant Mδ can be easily derived . Importantly , Mδ serves as a bridge between the observed score S̃ ( X̃n+1 , y ) and the unobserved one S̃ ( Xn+1 , y ) for a fixed y ∈ Y . Leveraging this property , we propose to construct a prediction set robust to a norm-bounded adversarial attack by applying the following decision rule : Cδ ( X̃n+1 ) = { y ∈ Y : S̃ ( X̃n+1 , y ) ≤ Q1−α ( { S̃i } i∈Ical ) +Mδ } , ( 8 ) where S̃i = S̃ ( Xi , Yi ) . In contrast to the vanilla split conformal approach ( 5 ) , the prediction set defined above is generated by comparing the test score to an inflated threshold Q1−α + Mδ , as illustrated in Figure 2 . Notice that the level of inflation is affected by the magnitude of the adversarial perturbation as well as the robustness of S̃ , i.e. , the value of Mδ . A larger perturbation implies larger inflation , and a more robust score S̃ implies smaller inflation . The theorem below states that the constructed prediction set ( 8 ) is guaranteed to contain the unknown target label Yn+1 with a probability of at least 1 − α , for any distribution PXY , sample size n , score function S̃ that satisfies ( 7 ) , and adversarial perturbation of magnitude δ generated by any attack algorithm . The proof of this and all other results can be found in Section S1 of the Supplementary Material . Theorem 1 . Assume that the samples { ( Xi , Yi ) } n+1i=1 are drawn exchangeably from some unknown distribution PXY . Let X̃n+1 = Xn+1 + be a clean test example Xn+1 with an additive corruption of an ` 2-norm bounded adversarial noise ‖ ‖2 ≤ δ . Then , the prediction set Cδ ( X̃n+1 ) defined in ( 8 ) satisfies P [ Yn+1 ∈ Cδ ( X̃n+1 ) ] ≥ 1− α . Before presenting our framework to construct scores that rigorously satisfy ( 7 ) , we pause to prove a lower bound on the coverage that the vanilla split conformal could attain in the adversarial setting . Theorem 2 . Under the assumptions of Theorem 1 , the prediction set C ( X̃n+1 ) defined in ( 5 ) , applied with S̃ in place of S , satisfies P [ Yn+1 ∈ C ( X̃n+1 ) ] ≥ τ , where τ = max { τ ′ : Qτ ′ ( { S̃i } i∈Ical ) ≤ Q1−α ( { S̃i } i∈Ical ) −Mδ } . ( 9 ) Note that τ can be simply computed by running a grid search on the sorted array of calibration scores . It is important to observe that in contrast to Theorem 1 , which guarantees at least 1−α coverage for any user-specified level α , the worst coverage level τ of the vanilla split conformal is not controlled explicitly , i.e. , τ is known only after looking at the training and calibration data . Observe also that , by construction , τ ≤ 1 − α ( see Supplementary Section S1 ) and equality is met in a special case where δ = 0 , i.e. , no attack is performed . In this special case , Mδ = 0 by definition , and both Theorem 1 and 2 converge to the classic coverage guarantee of the vanilla conformal algorithm .
This paper tackles the conformal prediction problem under adversarial perturbations, where the conventional exchangeability is violated. The proposed approach combines the non-conformity score with randomized smoothing and the standard conformal prediction. The proposed approach is evaluated over three different image benchmarks (i.e., CIFAR10, CIFAR100, and ImageNet) and demonstrated its efficacy by comparing the naive conformal prediction and the naive conformal prediction with the randomly smoothed non-conformity score.
SP:e0b6ddb99eda543e020506a29c8eb67f0d4b62bd
Adversarially Robust Conformal Prediction
1 INTRODUCTION . Deep neural net classifiers have achieved tremendous accomplishments over the last several years . Nevertheless , the increased deployment of these algorithms in real-world applications , especially ones that can be life-threatening like autonomous driving , raises major concerns about their reliability ( Heaven , 2019 ) . To alleviate these issues , it is important to develop techniques that allow the users to assess the uncertainty in predictions obtained by complex classifiers , revealing their limitations . Conformal prediction ( Vovk et al. , 2005 ) is a simple yet powerful tool for generating prediction sets whose size reflects the prediction uncertainty . Specifically , suppose we are given n training examples { ( Xi , Yi ) } ni=1 with feature vector Xi ∈ Rd , discrete and unordered class label Yi∈ { 1 , 2 , . . . , L } = Y , and any learning algorithm that aims at predicting the unknown Yn+1 of a given test point Xn+1 . Under the assumption that the training and test examples are sampled exchangeably—e.g. , they may be drawn i.i.d.—from an unknown distribution PXY , conformal prediction algorithms construct a distribution-free prediction set C ( Xn+1 ) ⊆ Y guaranteed to contain the test label Yn+1 at any desired coverage probability 1− α ∈ ( 0 , 1 ) : P [ Yn+1 ∈ C ( Xn+1 ) ] ≥ 1− α . ( 1 ) For example , it is common to set the desired coverage level 1 − α to be 90 % or 95 % . Note that the coverage probability P [ Yn+1 ∈ C ( Xn+1 ) ] is marginal because it is taken over all the training examples { ( Xi , Yi ) } ni=1 and the test point Xn+1 . The key idea of conformal prediction is to fit a classifier on the training set and use this model to assign non-conformity scores for held-out data points . These scores reflect the prediction error of the underlying classifier , where , loosely speaking , a smaller prediction error would lead to the construction of smaller and more informative sets . However , the sets constructed by the vanilla conformal method may not have the right coverage when the training and test points violate the exchangeability assumption ( Cauchois et al. , 2020 ; Gibbs & Candès , 2021 ; Tibshirani et al. , 2019 ; Podkopaev & Ramdas , 2021 ; Guan & Tibshirani , 2019 ) , which is hardly satisfied by real data in practice as distribution shift happens frequently ( Koh et al. , 2021 ) . In particular , we consider the potential threat of adversarial attacks ( Goodfellow et al. , 2015 ; Szegedy et al. , 2014 ; Carlini & Wagner , 2017 ) —carefully crafted human-imperceptible noise perturbations that drives the fitted model to err at test ( inference ) time . Such noise perturbations can introduce a large and arbitrary distribution shift that is extremely hard to estimate . In this setting , the prediction sets constructed by the vanilla conformal approach are often invalid , i.e. , do not satisfy ( 1 ) , as illustrated in Figure 1 . Following that figure , while this method achieves the desired 90 % coverage when applied to clean test data , the empirical coverage obtained when applying the same method on adversarial test examples falls dramatically below 90 % , to about 30 % . Therefore , it is the main motivation of this work to construct prediction sets that are robust to adversarial attacks . We formalize this requirement as follows : P [ Yn+1 ∈ Cδ ( X̃n+1 ) ] ≥ 1− α , ( 2 ) where X̃n+1 = Xn+1 + is the test adversarial example , and ‖ ‖2 ≤ δ is a norm-bounded adversarial perturbation . Note that we use the notation Cδ to distinguish between the new setting from the exchangeability case for which δ = 0 . Crucially , we require ( 2 ) to hold in finite samples , for any PXY , any adversarial perturbation of magnitude bounded by δ , and regardless of the choice or accuracy of the underlying classifier . At the same time , we wish Cδ to be as small as possible . To realize ( 2 ) with the desired coverage , we propose to combine randomized smoothing ( Duchi et al. , 2012 ; Cohen et al. , 2019 ; Salman et al. , 2019 ) with the vanilla conformal prediction procedure , and hence we name our technique Randomly Smoothed Conformal Prediction ( RSCP ) . Randomized smoothing allows us to bound the Lipschitz constant of any non-conformity score function by convolving it with the Gaussian distribution function . Leveraging this bound , we show how to modify conformal prediction and rigorously construct prediction sets that account for the adversarial perturbation . Figure 1 illustrates that our proposed RSCP approach successfully attains the desired coverage level whereas the vanilla conformal method fails . Observe that RSCP constructs slightly larger prediction sets , reflecting the increased uncertainty induced by the adversarial noise . The contributions of this paper are two-fold : ( i ) We propose , for the first time , a new conformal prediction method that can account for the potential adversarial threats during inference time . Our RSCP method , described in Section 3 , is model-agnostic in that it can work with any classifier and non-conformity score , scalable since the smoothing can be done by Monte Carlo integration with many i.i.d . Gaussian noise realizations , and robust against any ` 2-norm bounded adversarial attack . ( ii ) We prove that the prediction sets constructed by RSCP are valid in the sense of ( 2 ) , and , in Section 5 , support this theoretical result with numerical experiments on CIFAR10 , CIFAR100 , and ImageNet data sets . 2 CONFORMAL PREDICTION . Since the focus of this paper is on how to adapt the vanilla conformal prediction method to the adversarial setting , in this section , we give background on conformal prediction . While we focus here on classification problems , the method of conformal prediction can also be applied to regression tasks . The vanilla conformal prediction can be divided into two categories : the split conformal prediction and the full conformal prediction . The first one involves data splitting while the second one constructs valid sets without splitting the data but at the cost of a significant increase in computational complexity at test time ( Papadopoulos et al. , 2002 ; Papadopoulos , 2008 ; Vovk et al. , 2005 ) . To avoid prohibitive computation complexity , in this paper we focus only on split conformal prediction . This method starts by splitting the training data into two disjoint subsets : a proper training set Itr ⊆ { 1 , . . . , n } and a calibration set Ical = { 1 , . . . , n } \ Itr . Then , a classifier f̂ ( x ) ∈ [ 0 , 1 ] L is fit to the proper training set , estimating the conditional class probabilities P [ Y = y | X = x ] for all y ∈ Y . In the case of deep net classifiers , which is the focus of this work , this may be the output of the softmax layer . Next , we compute a non-conformity score Si = S ( Xi , Yi ) ∈ R for each calibration point { ( Xi , Yi ) } i∈Ical . This score expresses how well the model prediction f̂ ( X ) is aligned with the true label Y , where a lower score implies better alignment . For example , the score from Vovk et al . ( 2005 ) ; Lei et al . ( 2013 ) is given by S ( x , y ) = 1− f̂ ( x ) y , ( 3 ) where f̂ ( x ) y ∈ [ 0 , 1 ] is the yth entry in the vector f̂ ( x ) . Another example is the score proposed by Romano et al . ( 2020b ) , which can be expressed as S ( x , y ) = ∑ y′∈Y f̂ ( x ) y′ I { f̂ ( x ) y′ > f̂ ( x ) y } + f̂ ( x ) y · u , ( 4 ) where I is the indicator function and u is a random variable distributed uniformly over the segment [ 0 , 1 ] . We refer to the score from ( 3 ) as HPS as it was shown to construct homogeneous prediction sets . Analogously , we refer to ( 4 ) as APS since it tends to yield adaptive prediction sets that reflect better the underlying uncertainty across sub-populations ; see Romano et al . ( 2020b ) for more details . Given the desired coverage level 1−α , the prediction set for a new test point Xn+1 is formulated as C ( Xn+1 ) = { y ∈ Y : S ( Xn+1 , y ) ≤ Q1−α ( { Si } i∈Ical ) } , ( 5 ) where Q1−α ( { Si } i∈Ical ) : = the ( 1− α ) ( 1 + 1 1 + |Ical| ) th empirical quantile of { Si } i∈Ical ( 6 ) is the score positioned d ( n+ 1 ) ( 1− α ) e in the sorted array of calibration scores Si , i ∈ Ical . In plain words , in ( 5 ) we sweep over all possible labels y ∈ Y and include in C ( Xn+1 ) the ‘ guessed ’ labels y whose scores S ( Xn+1 , y ) are smaller than most of the calibration scores S ( Xi , Yi ) . Since the calibration and test points are drawn exchangeably from PXY and f̂ is fixed , the score S ( Xn+1 , y ) for the guess y = Yn+1 can fall anywhere in the sorted array of calibration scores with equal probability . This property guarantees that the prediction set ( 5 ) satisfies ( 1 ) ; see Vovk et al . ( 2005 ) . 3 RANDOMLY SMOOTHED CONFORMAL PREDICTION . In this section , we introduce our proposed RSCP framework for constructing prediction sets that are valid in the adversarial regime . Recall that an adversarial attack can lead to a significant distributional shift between the clean calibration points and the corrupted test example X̃n+1 = Xn+1 + , thus violating the fundamental exchangeability assumption of the split conformal procedure . Focusing on the guess y = Yn+1 , an effective attack would result in a larger non-conformity score for the corrupted test point S ( X̃n+1 , y ) compared to that of the clean input S ( Xn+1 , y ) . Therefore , a naive comparison of S ( X̃n+1 , y ) to the same threshold Q1−α from ( 6 ) , which neglects the increased uncertainty caused by the adversarial perturbation , will result in a prediction set that may not achieve the desired coverage , as already illustrated in Figure 1 . To address this , we should compare the test score to an inflated threshold , larger than Q1−α , which rigorously accounts for the effect of the adversarial noise . This is the core idea behind our proposal described in detail below ; see Figure 2 . 3.1 ADVERSARIALLY ROBUST CALIBRATION . Suppose we are given a non-conformity score function S̃ for which we can bound by how much its value could be increased due to the adversarial noise ‖ ‖2 ≤ δ added toXn+1 . Formally , we require the score S̃ to satisfy the following relation : S̃ ( X̃n+1 , y ) ≤ S̃ ( Xn+1 , y ) +Mδ , ∀y ∈ Y , ( 7 ) where Mδ ≥ 0 is a constant that is a function of δ , such that Mδ1 ≥ Mδ2 for δ1 ≥ δ2 and Mδ = 0 for δ = 0 . In essence , we would like ( 7 ) to hold for the smallest possible Mδ . We denote this score function by S̃ to emphasize that it must satisfy ( 7 ) , distinguishing it from existing non-conformity scores S , e.g. , ( 3 ) – ( 4 ) ; see Section 3.2 for a concrete and very general framework for designing S̃ for which the constant Mδ can be easily derived . Importantly , Mδ serves as a bridge between the observed score S̃ ( X̃n+1 , y ) and the unobserved one S̃ ( Xn+1 , y ) for a fixed y ∈ Y . Leveraging this property , we propose to construct a prediction set robust to a norm-bounded adversarial attack by applying the following decision rule : Cδ ( X̃n+1 ) = { y ∈ Y : S̃ ( X̃n+1 , y ) ≤ Q1−α ( { S̃i } i∈Ical ) +Mδ } , ( 8 ) where S̃i = S̃ ( Xi , Yi ) . In contrast to the vanilla split conformal approach ( 5 ) , the prediction set defined above is generated by comparing the test score to an inflated threshold Q1−α + Mδ , as illustrated in Figure 2 . Notice that the level of inflation is affected by the magnitude of the adversarial perturbation as well as the robustness of S̃ , i.e. , the value of Mδ . A larger perturbation implies larger inflation , and a more robust score S̃ implies smaller inflation . The theorem below states that the constructed prediction set ( 8 ) is guaranteed to contain the unknown target label Yn+1 with a probability of at least 1 − α , for any distribution PXY , sample size n , score function S̃ that satisfies ( 7 ) , and adversarial perturbation of magnitude δ generated by any attack algorithm . The proof of this and all other results can be found in Section S1 of the Supplementary Material . Theorem 1 . Assume that the samples { ( Xi , Yi ) } n+1i=1 are drawn exchangeably from some unknown distribution PXY . Let X̃n+1 = Xn+1 + be a clean test example Xn+1 with an additive corruption of an ` 2-norm bounded adversarial noise ‖ ‖2 ≤ δ . Then , the prediction set Cδ ( X̃n+1 ) defined in ( 8 ) satisfies P [ Yn+1 ∈ Cδ ( X̃n+1 ) ] ≥ 1− α . Before presenting our framework to construct scores that rigorously satisfy ( 7 ) , we pause to prove a lower bound on the coverage that the vanilla split conformal could attain in the adversarial setting . Theorem 2 . Under the assumptions of Theorem 1 , the prediction set C ( X̃n+1 ) defined in ( 5 ) , applied with S̃ in place of S , satisfies P [ Yn+1 ∈ C ( X̃n+1 ) ] ≥ τ , where τ = max { τ ′ : Qτ ′ ( { S̃i } i∈Ical ) ≤ Q1−α ( { S̃i } i∈Ical ) −Mδ } . ( 9 ) Note that τ can be simply computed by running a grid search on the sorted array of calibration scores . It is important to observe that in contrast to Theorem 1 , which guarantees at least 1−α coverage for any user-specified level α , the worst coverage level τ of the vanilla split conformal is not controlled explicitly , i.e. , τ is known only after looking at the training and calibration data . Observe also that , by construction , τ ≤ 1 − α ( see Supplementary Section S1 ) and equality is met in a special case where δ = 0 , i.e. , no attack is performed . In this special case , Mδ = 0 by definition , and both Theorem 1 and 2 converge to the classic coverage guarantee of the vanilla conformal algorithm .
This paper proposes a generic method to construct conformal prediction sets in an adversarial setting. Since standard conformal prediction method assumes an i.i.d. assumption for training and testing input, its generated prediction sets for adversarial examples will not satisfy the coverage guarantee. Build upon on randomized smoothing, the paper then proposes a new non-conformity score and raise the threshold to account for the adversarial transformations. It then proves that the prediction sets constructed by the proposed method satisfy the coverage guarantee for worst-case scenarios. Empirical evaluations are also performed on benchmark datasets, which justify the effectiveness of their method.
SP:e0b6ddb99eda543e020506a29c8eb67f0d4b62bd
A Unified Contrastive Energy-based Model for Understanding the Generative Ability of Adversarial Training
1 INTRODUCTION . Adversarial Training ( AT ) is one of the most effective approaches developed so far to improve the robustness of deep neural networks ( DNNs ) ( Madry et al. , 2018 ) . AT solves a minimax optimization problem , with the inner maximization generating adversarial examples by maximizing the classification loss , and the outer minimization finding model parameters by minimizing the loss on adversarial examples generated from the inner maximization . Recently , researchers have noticed that such robust classifiers obtained by AT are able to extract features that are perceptually aligned with humans ( Engstrom et al. , 2019 ) . Furthermore , they are able to synthesize realistic images on par with stateof-the-art generative models ( Santurkar et al. , 2019 ) . Nevertheless , it is still a mystery why AT is able to learn more semantically meaningful features and turn classifiers into generators . Besides , AT needs the labeled data { ( xi , yi ) } for training while canonical deep generative models do not , e.g. , VAE ( Kingma & Welling , 2014 ) and GAN ( Goodfellow et al. , 2015 ) only require { xi } . Thus , it is worth exploring if it is possible to train a robust model without labeled data . Several recent works ( Jiang et al. , 2020 ; Kim et al. , 2020 ; Ho & Vasconcelos , 2020 ) have proposed unsupervised AT by adversarially attacking the InfoNCE loss ( Oord et al. , 2018 ) ( a widely used objective in unsupervised contrastive learning ) , which indeed improves the robustness of contrastive encoders . However , a depth investigation and understanding for unsupervised AT is still missing . To address the above issues , in this work , we propose a unified probabilistic framework , Contrastive Energy-based Models ( CEM ) , that provides a principled understanding on the robustness and the generative ability of different training paradigms . Specifically , we make the following contributions : • Demystifying adversarial training and sampling . We firstly propose a probabilistic interpretation for AT , that is , it is inherently a ( biased ) maximum likelihood training of the corresponding energy-based model , which explains the generative ability of robust models learned by AT . Inspired by this , we propose some novel sampling algorithms with better sample quality than previous methods . • A unified probabilistic framework . Based on the understanding above , we propose Contrastive Energy-based Model ( CEM ) that incorporates both supervised and unsupervised learning paradigms . Our CEM provides a unified probabilistic understanding of previous standard and adversarial training methods in both supervised and unsupervised learning . • Principled unsupervised adversarial training and sampling . Specifically , under our proposed CEM framework , we establish the equivalence between the importance sampling of CEM and the InfoNCE loss of contrastive learning , which enables us to design principled adversarial sampling for unsupervised learning . Notably , we show that the sampling methods derived from our framework achieve state-of-the-art sample quality ( 9.61 Inception score ) with unsupervised robust models , which is comparable to both the supervised counterparts and other state-of-the-art generative models . 2 RELATED WORK . Robust generative models . Researchers recently notice that features extracted by robust classifiers are perceptually aligned with humans , while standard classifiers are not ( Engstrom et al. , 2019 ; Kaur et al. , 2019 ) . Furthermore , Santurkar et al . ( 2019 ) show that we can also generate images of high quality with robust classifiers by iteratively updating from a randomly sampled noise . They show the sample quality of robust classifiers is comparable to state-of-the-art generative models like BigGAN ( Brock et al. , 2018 ) . Contrastive learning . Oord et al . ( 2018 ) firstly propose unsupervised contrastive learning by maximizing a tractable lower bound on mutual information ( MI ) , i.e. , the negative InfoNCE loss . However , later works find that the lower bounds degrade a lot with a large MI , and the success of these methods can not be attributed to the properties of MI alone ( Poole et al. , 2019 ; Tschannen et al. , 2020 ) . Our work provides an alternative understanding of unsupervised contrastive learning as importance sampling of an energy-based model , which also enables us to characterize the limitations of existing methods from a new perspective . In fact , contrastive learning can also be seen as a general learning framework beyond the unsupervised scenarios . For example , SupContrast ( Khosla et al. , 2020 ) extends contrastive learning to supervised scenarios . Our work further bridges supervised , unsupervised and adversarial contrastive learning with a unified probabilistic framework . 3 CEM : A UNIFIED PROBABILISTIC FRAMEWORK . Inspired by previous work that bridges discriminative models with energy-based models ( Grathwohl et al. , 2019 ) , in this work , we propose a unified framework , called Contrastive Energy-based Model ( CEM ) , that incorporates both supervised and unsupervised scenarios . Our proposed CEM is a special kind of Energy-based Models ( EBMs ) that models the joint distribution pθ ( u , v ) over two variables ( u , v ) with a similarity function fθ ( u , v ) defined in a contrastive form , pθ ( u , v ) = exp ( fθ ( u , v ) ) Z ( θ ) , ( 1 ) where Z ( θ ) = ∫ exp ( fθ ( u , v ) ) dudv is the corresponding partition function . In other words , in CEM , a pair of samples ( u , v ) has higher probability if they are more alike . In particular , it can be instantiated into the two following variants under different learning scenarios . Parametric CEM . In the supervised scenario , we specify the Parametric CEM ( P-CEM ) that models the joint distribution pθ ( x , y ) of data x and label y in the following form , pθ ( x , y ) = exp ( fθ ( x , y ) ) Z ( θ ) = exp ( gθ ( x ) > wy ) Z ( θ ) , ( 2 ) where gθ : Rn → Rm denotes the encoder , g ( x ) ∈ Rm is the representation of x , and wk ∈ Rm refers to the parametric cluster center of the k-th class . Denote the linear classification weight as W = [ w1 , · · · , wK ] and the logit vector as h ( x ) = g ( x ) > W , we can see the equivalence between P-CEM and JEM ( Grathwohl et al. , 2019 ) as fθ ( x , y ) = gθ ( x ) > wy = hθ ( x ) [ y ] . ( 3 ) Non-Parametric CEM . In the unsupervised scenario , we do not have access to labels , thus we instead model the joint distribution between data x and representation z as pθ ( x , z ) = exp ( fθ ( x , z ) ) Z ( θ ) = exp ( gθ ( x ) > z ) Z ( θ ) , ( 4 ) and the corresponding likelihood gradient is ∇θEpd ( x , z ) log pθ ( x , z ) = Epd ( x , z ) ∇θfθ ( x , z ) −Epθ ( x̂ , ẑ ) ∇θfθ ( x̂ , ẑ ) . ( 5 ) In contrastive to P-CEM that incorporates parametric cluster centers , the joint distribution of NPCEM ( Non-Parametric CEM ) is directly defined based on the similarity between instances . We define the joint data distribution pd ( x , z ) = pd ( x ) pd ( z|x ) through re-parameterization , z = fθ ( t ( x ) ) , t u.a.r.∼ T , x ∼ pd ( x ) , ( 6 ) where u.a.r . denotes sampling uniformly at random and T refers to the user-define pretext , e.g. , a set of data augmentation operators T = { t : Rn → Rn } 1 . 4 SUPERVISED SCENARIO : REDISCOVERING ADVERSARIAL TRAINING AS MAXIMUM LIKELIHOOD TRAINING . In this section , we investigate why robust models have a good generative ability . The objective of AT is to solve the following minimax optimization problem : min θ Epd ( x , y ) [ max ‖x̂−x‖p≤ε ` CE ( x̂ , y ; θ ) ] , where ` CE ( x̂ , y ; θ ) = − log pθ ( y|x̂ ) . ( 7 ) The inner maximization problem is to find an adversarial example x̂ within the ` p-norm ε-ball around the natural example x that maximizes the CE loss . While the outer minimization problem is to find model parameters that minimize the loss on the adversarial examples x̂ . 4.1 MAXIMIZATION PROCESS . For the inner maximization problem , Projected Gradient Descent ( PGD ) ( Madry et al. , 2018 ) is the commonly used method , which generates the adversarial example x̂ by maximizing the CE loss2 ( i.e. , minimizing the log conditional probability ) starting from x̂0 = x : x̂n+1 = x̂n + α∇x̂n ` ( x̂n , y ; θ ) = x̂n − α∇x̂n log pθ ( y|x̂n ) = x̂n + α∇x̂n [ log K∑ k=1 exp ( fθ ( x̂n , k ) ) ] − α∇x̂nfθ ( x̂n , y ) , ( 8 ) while the Langevin dynamics for sampling P-CEM starts from random noise x̂0 = δ and updates with x̂n+1 = x̂n + α∇x̂ log pθ ( x̂n ) + √ 2α · ε ( 9 ) = x̂n + α∇x̂n [ log K∑ k=1 exp ( fθ ( x̂n , k ) ) ] + √ 2α · ε. Eqns . 8 and 9 both have a positive logsumexp gradient ( the second term ) to push up the marginal probability pθ ( x̂ ) . As for the third term , PGD starts from a data point ( x , y ) such that it requires the repulsive gradient to be away from the original data point and do the exploration in a local region . Langevin dynamics instead starts from a random noise and an additive noise ε is injected for exploration . Comparing PGD and Langevin . Following the above analysis , the maximization process in AT can be seen as a ( biased ) sampling method that draws samples from the corresponding probabilistic 1For the data pair , we detach the gradient of z w.r.t . θ and assume that x and t ( x ) have the same marginal distribution pd ( x ) . 2Note that we omit the projection operation and the gradient re-normalization steps . model pθ ( x̂ ) . Compared to Langevin dynamics , PGD imposes specific inductive bias for sampling . With the additional repulsive gradient and ε-ball constraint , it explicitly encourages the samples to be misclassified around the original data points . In practice , adversarial training with such adversarial examples is generally more stable than training JEM with Langevin samples , which indicates that PGD attack is a competitive alternative for the negative sampling method for JEM training . 4.2 MINIMIZATION PROCESS . To begin with , the gradient of the joint log likelihood for P-CEM can be written as follows : ∇θEpd ( x , y ) log pθ ( x , y ) =Epd ( x , y ) ∇θfθ ( x , y ) −Epθ ( x̂ , ŷ ) ∇θfθ ( x̂ , ŷ ) =Epd ( x , y ) ∇θfθ ( x , y ) −Epθ ( x̂ ) pθ ( ŷ|x̂ ) ∇θfθ ( x̂ , ŷ ) , ( 10 ) where ( x , y ) ∼ pd ( x , y ) denotes the positive data pair , and ( x̂ , ŷ ) ∼ pθ ( x̂ , ŷ ) denotes the negative sample pair . As discussed above , the adversarial examples x̂ generated by the maximization process can be regarded as negative samples , and ŷ ∼ pθ ( ŷ|x̂ ) denotes the predicted label of x̂ . To see how the maximum likelihood training of P-CEM is related to the minimization process of AT , we add an interpolated adversarial pair ( x̂ , y ) into Eq . 10 and decompose it as the consistency gradient and the contrastive gradient : ∇θEpd ( x , y ) log pθ ( x , y ) = Epd ( x , y ) ⊗ pθ ( x̂ , ŷ ) [ ∇θfθ ( x , y ) −∇θfθ ( x̂ , ŷ ) ] =Epd ( x , y ) ⊗ pθ ( x̂ , ŷ ) [ ∇θfθ ( x , y ) −∇θfθ ( x̂ , y ) ︸ ︷︷ ︸ consistency gradient +∇θfθ ( x̂ , y ) −∇θfθ ( x̂ , ŷ ) ︸ ︷︷ ︸ contrastive gradient ] . ( 11 ) Next , we show that the two parts correspond to two effective mechanisms developed in the adversarial training literature . AT loss . As the two sample pairs in the contrastive gradient share the same input x̂ , we can see that the contrastive gradient can be written equivalently as Epd ( x , y ) ⊗ pθ ( x̂ , ŷ ) [ ∇θfθ ( x̂ , y ) −∇θfθ ( x̂ , ŷ ) ] =Epd ( x , y ) ⊗ pθ ( x̂ ) [ ∇θfθ ( x̂ , y ) − Epθ ( ŷ|x̂ ) ∇θfθ ( x̂ , ŷ ) ] =Epd ( x , y ) ⊗ pθ ( x̂ ) ∇θ log pθ ( y|x̂ ) , ( 12 ) which is exactly the negative gradient of the robust CE loss ( AT loss ) in Eq . 7 , in other words , gradient ascent with the contrastive gradient is equivalent to gradient descent w.r.t . the AT loss . Regularization . As for the consistency gradient , original AT ( Madry et al. , 2018 ) simply ignores it . Its variant TRADES ( Zhang et al. , 2019 ) instead proposes the KL regularization KL ( p ( ·|x̂ ) ‖p ( ·|x ) ) that regularizes the consistency of the predicted probabilities on all classes , whose optimum implies that p ( ·|x̂ ) = p ( ·|x ) → fθ ( x , y ) = fθ ( x̂ , y ) . Comparing AT and JEM training paradigms . The above analysis indicates that the minimization objective of AT is closely related to the maximum likelihood training of JEM ( Grathwohl et al. , 2019 ) . Compared to JEM that decomposes the joint likelihood into an unconditional model pθ ( x ) and a discriminative model pθ ( y|x ) , the decomposition of AT in Eq . 10 instead stabilizes training by introducing an intermediate adversarial pair ( x̂ , y ) that bridges the positive pair ( x , y ) and the negative pair ( x̂ , ŷ ) . Besides , it can inject the adversarial robustness bias by regularizing the consistency gradient . Together with our analysis on the maximization process , we show that AT is a competitive alternative for training JEM ( a generative model ) with more stable training behaviors . That explains why robust models with AT are also generative .
This paper justifies why models trained with adversarial training are good generative models by proposing a probabilistic framework. The paper is heavily influenced by the JEM paper and proposes a generalized form of analysis in that paper to include the unsupervised scenario. The generalization defines a joint distribution $p(x, z)$ over data $x$ and representations $z$. For the supervised case, each class is represented by a "center" $w_y$ and for the unsupervised one, $p(x, z) = p(x) p(z|x)$ and $p(z|x)$ is reparametrized with augmentation. Then the authors use this probabilistic framework to analyze the adversarial training. Specifically, they show PGD is a biased form of the Langevin dynamics in their formulation. Then they show how the maximum likelihood training of their probabilistic framework is similar to adversarial training. As a result, they conclude adversarial training leads to a model with high generative power. Finally, they propose refined sampling strategies from adversarially trained models. In the last part of the paper, they use their framework to propose an unsupervised adversarial training method followed by sampling algorithms from the produced models.
SP:ea4c43bb41d0730ac92c716aea0e118be2119ab3
A Unified Contrastive Energy-based Model for Understanding the Generative Ability of Adversarial Training
1 INTRODUCTION . Adversarial Training ( AT ) is one of the most effective approaches developed so far to improve the robustness of deep neural networks ( DNNs ) ( Madry et al. , 2018 ) . AT solves a minimax optimization problem , with the inner maximization generating adversarial examples by maximizing the classification loss , and the outer minimization finding model parameters by minimizing the loss on adversarial examples generated from the inner maximization . Recently , researchers have noticed that such robust classifiers obtained by AT are able to extract features that are perceptually aligned with humans ( Engstrom et al. , 2019 ) . Furthermore , they are able to synthesize realistic images on par with stateof-the-art generative models ( Santurkar et al. , 2019 ) . Nevertheless , it is still a mystery why AT is able to learn more semantically meaningful features and turn classifiers into generators . Besides , AT needs the labeled data { ( xi , yi ) } for training while canonical deep generative models do not , e.g. , VAE ( Kingma & Welling , 2014 ) and GAN ( Goodfellow et al. , 2015 ) only require { xi } . Thus , it is worth exploring if it is possible to train a robust model without labeled data . Several recent works ( Jiang et al. , 2020 ; Kim et al. , 2020 ; Ho & Vasconcelos , 2020 ) have proposed unsupervised AT by adversarially attacking the InfoNCE loss ( Oord et al. , 2018 ) ( a widely used objective in unsupervised contrastive learning ) , which indeed improves the robustness of contrastive encoders . However , a depth investigation and understanding for unsupervised AT is still missing . To address the above issues , in this work , we propose a unified probabilistic framework , Contrastive Energy-based Models ( CEM ) , that provides a principled understanding on the robustness and the generative ability of different training paradigms . Specifically , we make the following contributions : • Demystifying adversarial training and sampling . We firstly propose a probabilistic interpretation for AT , that is , it is inherently a ( biased ) maximum likelihood training of the corresponding energy-based model , which explains the generative ability of robust models learned by AT . Inspired by this , we propose some novel sampling algorithms with better sample quality than previous methods . • A unified probabilistic framework . Based on the understanding above , we propose Contrastive Energy-based Model ( CEM ) that incorporates both supervised and unsupervised learning paradigms . Our CEM provides a unified probabilistic understanding of previous standard and adversarial training methods in both supervised and unsupervised learning . • Principled unsupervised adversarial training and sampling . Specifically , under our proposed CEM framework , we establish the equivalence between the importance sampling of CEM and the InfoNCE loss of contrastive learning , which enables us to design principled adversarial sampling for unsupervised learning . Notably , we show that the sampling methods derived from our framework achieve state-of-the-art sample quality ( 9.61 Inception score ) with unsupervised robust models , which is comparable to both the supervised counterparts and other state-of-the-art generative models . 2 RELATED WORK . Robust generative models . Researchers recently notice that features extracted by robust classifiers are perceptually aligned with humans , while standard classifiers are not ( Engstrom et al. , 2019 ; Kaur et al. , 2019 ) . Furthermore , Santurkar et al . ( 2019 ) show that we can also generate images of high quality with robust classifiers by iteratively updating from a randomly sampled noise . They show the sample quality of robust classifiers is comparable to state-of-the-art generative models like BigGAN ( Brock et al. , 2018 ) . Contrastive learning . Oord et al . ( 2018 ) firstly propose unsupervised contrastive learning by maximizing a tractable lower bound on mutual information ( MI ) , i.e. , the negative InfoNCE loss . However , later works find that the lower bounds degrade a lot with a large MI , and the success of these methods can not be attributed to the properties of MI alone ( Poole et al. , 2019 ; Tschannen et al. , 2020 ) . Our work provides an alternative understanding of unsupervised contrastive learning as importance sampling of an energy-based model , which also enables us to characterize the limitations of existing methods from a new perspective . In fact , contrastive learning can also be seen as a general learning framework beyond the unsupervised scenarios . For example , SupContrast ( Khosla et al. , 2020 ) extends contrastive learning to supervised scenarios . Our work further bridges supervised , unsupervised and adversarial contrastive learning with a unified probabilistic framework . 3 CEM : A UNIFIED PROBABILISTIC FRAMEWORK . Inspired by previous work that bridges discriminative models with energy-based models ( Grathwohl et al. , 2019 ) , in this work , we propose a unified framework , called Contrastive Energy-based Model ( CEM ) , that incorporates both supervised and unsupervised scenarios . Our proposed CEM is a special kind of Energy-based Models ( EBMs ) that models the joint distribution pθ ( u , v ) over two variables ( u , v ) with a similarity function fθ ( u , v ) defined in a contrastive form , pθ ( u , v ) = exp ( fθ ( u , v ) ) Z ( θ ) , ( 1 ) where Z ( θ ) = ∫ exp ( fθ ( u , v ) ) dudv is the corresponding partition function . In other words , in CEM , a pair of samples ( u , v ) has higher probability if they are more alike . In particular , it can be instantiated into the two following variants under different learning scenarios . Parametric CEM . In the supervised scenario , we specify the Parametric CEM ( P-CEM ) that models the joint distribution pθ ( x , y ) of data x and label y in the following form , pθ ( x , y ) = exp ( fθ ( x , y ) ) Z ( θ ) = exp ( gθ ( x ) > wy ) Z ( θ ) , ( 2 ) where gθ : Rn → Rm denotes the encoder , g ( x ) ∈ Rm is the representation of x , and wk ∈ Rm refers to the parametric cluster center of the k-th class . Denote the linear classification weight as W = [ w1 , · · · , wK ] and the logit vector as h ( x ) = g ( x ) > W , we can see the equivalence between P-CEM and JEM ( Grathwohl et al. , 2019 ) as fθ ( x , y ) = gθ ( x ) > wy = hθ ( x ) [ y ] . ( 3 ) Non-Parametric CEM . In the unsupervised scenario , we do not have access to labels , thus we instead model the joint distribution between data x and representation z as pθ ( x , z ) = exp ( fθ ( x , z ) ) Z ( θ ) = exp ( gθ ( x ) > z ) Z ( θ ) , ( 4 ) and the corresponding likelihood gradient is ∇θEpd ( x , z ) log pθ ( x , z ) = Epd ( x , z ) ∇θfθ ( x , z ) −Epθ ( x̂ , ẑ ) ∇θfθ ( x̂ , ẑ ) . ( 5 ) In contrastive to P-CEM that incorporates parametric cluster centers , the joint distribution of NPCEM ( Non-Parametric CEM ) is directly defined based on the similarity between instances . We define the joint data distribution pd ( x , z ) = pd ( x ) pd ( z|x ) through re-parameterization , z = fθ ( t ( x ) ) , t u.a.r.∼ T , x ∼ pd ( x ) , ( 6 ) where u.a.r . denotes sampling uniformly at random and T refers to the user-define pretext , e.g. , a set of data augmentation operators T = { t : Rn → Rn } 1 . 4 SUPERVISED SCENARIO : REDISCOVERING ADVERSARIAL TRAINING AS MAXIMUM LIKELIHOOD TRAINING . In this section , we investigate why robust models have a good generative ability . The objective of AT is to solve the following minimax optimization problem : min θ Epd ( x , y ) [ max ‖x̂−x‖p≤ε ` CE ( x̂ , y ; θ ) ] , where ` CE ( x̂ , y ; θ ) = − log pθ ( y|x̂ ) . ( 7 ) The inner maximization problem is to find an adversarial example x̂ within the ` p-norm ε-ball around the natural example x that maximizes the CE loss . While the outer minimization problem is to find model parameters that minimize the loss on the adversarial examples x̂ . 4.1 MAXIMIZATION PROCESS . For the inner maximization problem , Projected Gradient Descent ( PGD ) ( Madry et al. , 2018 ) is the commonly used method , which generates the adversarial example x̂ by maximizing the CE loss2 ( i.e. , minimizing the log conditional probability ) starting from x̂0 = x : x̂n+1 = x̂n + α∇x̂n ` ( x̂n , y ; θ ) = x̂n − α∇x̂n log pθ ( y|x̂n ) = x̂n + α∇x̂n [ log K∑ k=1 exp ( fθ ( x̂n , k ) ) ] − α∇x̂nfθ ( x̂n , y ) , ( 8 ) while the Langevin dynamics for sampling P-CEM starts from random noise x̂0 = δ and updates with x̂n+1 = x̂n + α∇x̂ log pθ ( x̂n ) + √ 2α · ε ( 9 ) = x̂n + α∇x̂n [ log K∑ k=1 exp ( fθ ( x̂n , k ) ) ] + √ 2α · ε. Eqns . 8 and 9 both have a positive logsumexp gradient ( the second term ) to push up the marginal probability pθ ( x̂ ) . As for the third term , PGD starts from a data point ( x , y ) such that it requires the repulsive gradient to be away from the original data point and do the exploration in a local region . Langevin dynamics instead starts from a random noise and an additive noise ε is injected for exploration . Comparing PGD and Langevin . Following the above analysis , the maximization process in AT can be seen as a ( biased ) sampling method that draws samples from the corresponding probabilistic 1For the data pair , we detach the gradient of z w.r.t . θ and assume that x and t ( x ) have the same marginal distribution pd ( x ) . 2Note that we omit the projection operation and the gradient re-normalization steps . model pθ ( x̂ ) . Compared to Langevin dynamics , PGD imposes specific inductive bias for sampling . With the additional repulsive gradient and ε-ball constraint , it explicitly encourages the samples to be misclassified around the original data points . In practice , adversarial training with such adversarial examples is generally more stable than training JEM with Langevin samples , which indicates that PGD attack is a competitive alternative for the negative sampling method for JEM training . 4.2 MINIMIZATION PROCESS . To begin with , the gradient of the joint log likelihood for P-CEM can be written as follows : ∇θEpd ( x , y ) log pθ ( x , y ) =Epd ( x , y ) ∇θfθ ( x , y ) −Epθ ( x̂ , ŷ ) ∇θfθ ( x̂ , ŷ ) =Epd ( x , y ) ∇θfθ ( x , y ) −Epθ ( x̂ ) pθ ( ŷ|x̂ ) ∇θfθ ( x̂ , ŷ ) , ( 10 ) where ( x , y ) ∼ pd ( x , y ) denotes the positive data pair , and ( x̂ , ŷ ) ∼ pθ ( x̂ , ŷ ) denotes the negative sample pair . As discussed above , the adversarial examples x̂ generated by the maximization process can be regarded as negative samples , and ŷ ∼ pθ ( ŷ|x̂ ) denotes the predicted label of x̂ . To see how the maximum likelihood training of P-CEM is related to the minimization process of AT , we add an interpolated adversarial pair ( x̂ , y ) into Eq . 10 and decompose it as the consistency gradient and the contrastive gradient : ∇θEpd ( x , y ) log pθ ( x , y ) = Epd ( x , y ) ⊗ pθ ( x̂ , ŷ ) [ ∇θfθ ( x , y ) −∇θfθ ( x̂ , ŷ ) ] =Epd ( x , y ) ⊗ pθ ( x̂ , ŷ ) [ ∇θfθ ( x , y ) −∇θfθ ( x̂ , y ) ︸ ︷︷ ︸ consistency gradient +∇θfθ ( x̂ , y ) −∇θfθ ( x̂ , ŷ ) ︸ ︷︷ ︸ contrastive gradient ] . ( 11 ) Next , we show that the two parts correspond to two effective mechanisms developed in the adversarial training literature . AT loss . As the two sample pairs in the contrastive gradient share the same input x̂ , we can see that the contrastive gradient can be written equivalently as Epd ( x , y ) ⊗ pθ ( x̂ , ŷ ) [ ∇θfθ ( x̂ , y ) −∇θfθ ( x̂ , ŷ ) ] =Epd ( x , y ) ⊗ pθ ( x̂ ) [ ∇θfθ ( x̂ , y ) − Epθ ( ŷ|x̂ ) ∇θfθ ( x̂ , ŷ ) ] =Epd ( x , y ) ⊗ pθ ( x̂ ) ∇θ log pθ ( y|x̂ ) , ( 12 ) which is exactly the negative gradient of the robust CE loss ( AT loss ) in Eq . 7 , in other words , gradient ascent with the contrastive gradient is equivalent to gradient descent w.r.t . the AT loss . Regularization . As for the consistency gradient , original AT ( Madry et al. , 2018 ) simply ignores it . Its variant TRADES ( Zhang et al. , 2019 ) instead proposes the KL regularization KL ( p ( ·|x̂ ) ‖p ( ·|x ) ) that regularizes the consistency of the predicted probabilities on all classes , whose optimum implies that p ( ·|x̂ ) = p ( ·|x ) → fθ ( x , y ) = fθ ( x̂ , y ) . Comparing AT and JEM training paradigms . The above analysis indicates that the minimization objective of AT is closely related to the maximum likelihood training of JEM ( Grathwohl et al. , 2019 ) . Compared to JEM that decomposes the joint likelihood into an unconditional model pθ ( x ) and a discriminative model pθ ( y|x ) , the decomposition of AT in Eq . 10 instead stabilizes training by introducing an intermediate adversarial pair ( x̂ , y ) that bridges the positive pair ( x , y ) and the negative pair ( x̂ , ŷ ) . Besides , it can inject the adversarial robustness bias by regularizing the consistency gradient . Together with our analysis on the maximization process , we show that AT is a competitive alternative for training JEM ( a generative model ) with more stable training behaviors . That explains why robust models with AT are also generative .
This paper proposed a unified probabilistic framework, dubbed as Contrastive Energy-based Models, to understand the robustness and generative capability. The proposed CEM is a special case of EBM that models the joint distribution over two variables with a similarity function defined in a contrastive form. CEM could be instantiated into parametric form and non-parametric form, which work for supervised learning and unsupervised learning respectively. CEM could demystify adversarial training's generative capability in both supervised and unsupervised setting. Moreover, with CEM, adversarial training could be extended to unsupervised scenario.
SP:ea4c43bb41d0730ac92c716aea0e118be2119ab3
A Unified Contrastive Energy-based Model for Understanding the Generative Ability of Adversarial Training
1 INTRODUCTION . Adversarial Training ( AT ) is one of the most effective approaches developed so far to improve the robustness of deep neural networks ( DNNs ) ( Madry et al. , 2018 ) . AT solves a minimax optimization problem , with the inner maximization generating adversarial examples by maximizing the classification loss , and the outer minimization finding model parameters by minimizing the loss on adversarial examples generated from the inner maximization . Recently , researchers have noticed that such robust classifiers obtained by AT are able to extract features that are perceptually aligned with humans ( Engstrom et al. , 2019 ) . Furthermore , they are able to synthesize realistic images on par with stateof-the-art generative models ( Santurkar et al. , 2019 ) . Nevertheless , it is still a mystery why AT is able to learn more semantically meaningful features and turn classifiers into generators . Besides , AT needs the labeled data { ( xi , yi ) } for training while canonical deep generative models do not , e.g. , VAE ( Kingma & Welling , 2014 ) and GAN ( Goodfellow et al. , 2015 ) only require { xi } . Thus , it is worth exploring if it is possible to train a robust model without labeled data . Several recent works ( Jiang et al. , 2020 ; Kim et al. , 2020 ; Ho & Vasconcelos , 2020 ) have proposed unsupervised AT by adversarially attacking the InfoNCE loss ( Oord et al. , 2018 ) ( a widely used objective in unsupervised contrastive learning ) , which indeed improves the robustness of contrastive encoders . However , a depth investigation and understanding for unsupervised AT is still missing . To address the above issues , in this work , we propose a unified probabilistic framework , Contrastive Energy-based Models ( CEM ) , that provides a principled understanding on the robustness and the generative ability of different training paradigms . Specifically , we make the following contributions : • Demystifying adversarial training and sampling . We firstly propose a probabilistic interpretation for AT , that is , it is inherently a ( biased ) maximum likelihood training of the corresponding energy-based model , which explains the generative ability of robust models learned by AT . Inspired by this , we propose some novel sampling algorithms with better sample quality than previous methods . • A unified probabilistic framework . Based on the understanding above , we propose Contrastive Energy-based Model ( CEM ) that incorporates both supervised and unsupervised learning paradigms . Our CEM provides a unified probabilistic understanding of previous standard and adversarial training methods in both supervised and unsupervised learning . • Principled unsupervised adversarial training and sampling . Specifically , under our proposed CEM framework , we establish the equivalence between the importance sampling of CEM and the InfoNCE loss of contrastive learning , which enables us to design principled adversarial sampling for unsupervised learning . Notably , we show that the sampling methods derived from our framework achieve state-of-the-art sample quality ( 9.61 Inception score ) with unsupervised robust models , which is comparable to both the supervised counterparts and other state-of-the-art generative models . 2 RELATED WORK . Robust generative models . Researchers recently notice that features extracted by robust classifiers are perceptually aligned with humans , while standard classifiers are not ( Engstrom et al. , 2019 ; Kaur et al. , 2019 ) . Furthermore , Santurkar et al . ( 2019 ) show that we can also generate images of high quality with robust classifiers by iteratively updating from a randomly sampled noise . They show the sample quality of robust classifiers is comparable to state-of-the-art generative models like BigGAN ( Brock et al. , 2018 ) . Contrastive learning . Oord et al . ( 2018 ) firstly propose unsupervised contrastive learning by maximizing a tractable lower bound on mutual information ( MI ) , i.e. , the negative InfoNCE loss . However , later works find that the lower bounds degrade a lot with a large MI , and the success of these methods can not be attributed to the properties of MI alone ( Poole et al. , 2019 ; Tschannen et al. , 2020 ) . Our work provides an alternative understanding of unsupervised contrastive learning as importance sampling of an energy-based model , which also enables us to characterize the limitations of existing methods from a new perspective . In fact , contrastive learning can also be seen as a general learning framework beyond the unsupervised scenarios . For example , SupContrast ( Khosla et al. , 2020 ) extends contrastive learning to supervised scenarios . Our work further bridges supervised , unsupervised and adversarial contrastive learning with a unified probabilistic framework . 3 CEM : A UNIFIED PROBABILISTIC FRAMEWORK . Inspired by previous work that bridges discriminative models with energy-based models ( Grathwohl et al. , 2019 ) , in this work , we propose a unified framework , called Contrastive Energy-based Model ( CEM ) , that incorporates both supervised and unsupervised scenarios . Our proposed CEM is a special kind of Energy-based Models ( EBMs ) that models the joint distribution pθ ( u , v ) over two variables ( u , v ) with a similarity function fθ ( u , v ) defined in a contrastive form , pθ ( u , v ) = exp ( fθ ( u , v ) ) Z ( θ ) , ( 1 ) where Z ( θ ) = ∫ exp ( fθ ( u , v ) ) dudv is the corresponding partition function . In other words , in CEM , a pair of samples ( u , v ) has higher probability if they are more alike . In particular , it can be instantiated into the two following variants under different learning scenarios . Parametric CEM . In the supervised scenario , we specify the Parametric CEM ( P-CEM ) that models the joint distribution pθ ( x , y ) of data x and label y in the following form , pθ ( x , y ) = exp ( fθ ( x , y ) ) Z ( θ ) = exp ( gθ ( x ) > wy ) Z ( θ ) , ( 2 ) where gθ : Rn → Rm denotes the encoder , g ( x ) ∈ Rm is the representation of x , and wk ∈ Rm refers to the parametric cluster center of the k-th class . Denote the linear classification weight as W = [ w1 , · · · , wK ] and the logit vector as h ( x ) = g ( x ) > W , we can see the equivalence between P-CEM and JEM ( Grathwohl et al. , 2019 ) as fθ ( x , y ) = gθ ( x ) > wy = hθ ( x ) [ y ] . ( 3 ) Non-Parametric CEM . In the unsupervised scenario , we do not have access to labels , thus we instead model the joint distribution between data x and representation z as pθ ( x , z ) = exp ( fθ ( x , z ) ) Z ( θ ) = exp ( gθ ( x ) > z ) Z ( θ ) , ( 4 ) and the corresponding likelihood gradient is ∇θEpd ( x , z ) log pθ ( x , z ) = Epd ( x , z ) ∇θfθ ( x , z ) −Epθ ( x̂ , ẑ ) ∇θfθ ( x̂ , ẑ ) . ( 5 ) In contrastive to P-CEM that incorporates parametric cluster centers , the joint distribution of NPCEM ( Non-Parametric CEM ) is directly defined based on the similarity between instances . We define the joint data distribution pd ( x , z ) = pd ( x ) pd ( z|x ) through re-parameterization , z = fθ ( t ( x ) ) , t u.a.r.∼ T , x ∼ pd ( x ) , ( 6 ) where u.a.r . denotes sampling uniformly at random and T refers to the user-define pretext , e.g. , a set of data augmentation operators T = { t : Rn → Rn } 1 . 4 SUPERVISED SCENARIO : REDISCOVERING ADVERSARIAL TRAINING AS MAXIMUM LIKELIHOOD TRAINING . In this section , we investigate why robust models have a good generative ability . The objective of AT is to solve the following minimax optimization problem : min θ Epd ( x , y ) [ max ‖x̂−x‖p≤ε ` CE ( x̂ , y ; θ ) ] , where ` CE ( x̂ , y ; θ ) = − log pθ ( y|x̂ ) . ( 7 ) The inner maximization problem is to find an adversarial example x̂ within the ` p-norm ε-ball around the natural example x that maximizes the CE loss . While the outer minimization problem is to find model parameters that minimize the loss on the adversarial examples x̂ . 4.1 MAXIMIZATION PROCESS . For the inner maximization problem , Projected Gradient Descent ( PGD ) ( Madry et al. , 2018 ) is the commonly used method , which generates the adversarial example x̂ by maximizing the CE loss2 ( i.e. , minimizing the log conditional probability ) starting from x̂0 = x : x̂n+1 = x̂n + α∇x̂n ` ( x̂n , y ; θ ) = x̂n − α∇x̂n log pθ ( y|x̂n ) = x̂n + α∇x̂n [ log K∑ k=1 exp ( fθ ( x̂n , k ) ) ] − α∇x̂nfθ ( x̂n , y ) , ( 8 ) while the Langevin dynamics for sampling P-CEM starts from random noise x̂0 = δ and updates with x̂n+1 = x̂n + α∇x̂ log pθ ( x̂n ) + √ 2α · ε ( 9 ) = x̂n + α∇x̂n [ log K∑ k=1 exp ( fθ ( x̂n , k ) ) ] + √ 2α · ε. Eqns . 8 and 9 both have a positive logsumexp gradient ( the second term ) to push up the marginal probability pθ ( x̂ ) . As for the third term , PGD starts from a data point ( x , y ) such that it requires the repulsive gradient to be away from the original data point and do the exploration in a local region . Langevin dynamics instead starts from a random noise and an additive noise ε is injected for exploration . Comparing PGD and Langevin . Following the above analysis , the maximization process in AT can be seen as a ( biased ) sampling method that draws samples from the corresponding probabilistic 1For the data pair , we detach the gradient of z w.r.t . θ and assume that x and t ( x ) have the same marginal distribution pd ( x ) . 2Note that we omit the projection operation and the gradient re-normalization steps . model pθ ( x̂ ) . Compared to Langevin dynamics , PGD imposes specific inductive bias for sampling . With the additional repulsive gradient and ε-ball constraint , it explicitly encourages the samples to be misclassified around the original data points . In practice , adversarial training with such adversarial examples is generally more stable than training JEM with Langevin samples , which indicates that PGD attack is a competitive alternative for the negative sampling method for JEM training . 4.2 MINIMIZATION PROCESS . To begin with , the gradient of the joint log likelihood for P-CEM can be written as follows : ∇θEpd ( x , y ) log pθ ( x , y ) =Epd ( x , y ) ∇θfθ ( x , y ) −Epθ ( x̂ , ŷ ) ∇θfθ ( x̂ , ŷ ) =Epd ( x , y ) ∇θfθ ( x , y ) −Epθ ( x̂ ) pθ ( ŷ|x̂ ) ∇θfθ ( x̂ , ŷ ) , ( 10 ) where ( x , y ) ∼ pd ( x , y ) denotes the positive data pair , and ( x̂ , ŷ ) ∼ pθ ( x̂ , ŷ ) denotes the negative sample pair . As discussed above , the adversarial examples x̂ generated by the maximization process can be regarded as negative samples , and ŷ ∼ pθ ( ŷ|x̂ ) denotes the predicted label of x̂ . To see how the maximum likelihood training of P-CEM is related to the minimization process of AT , we add an interpolated adversarial pair ( x̂ , y ) into Eq . 10 and decompose it as the consistency gradient and the contrastive gradient : ∇θEpd ( x , y ) log pθ ( x , y ) = Epd ( x , y ) ⊗ pθ ( x̂ , ŷ ) [ ∇θfθ ( x , y ) −∇θfθ ( x̂ , ŷ ) ] =Epd ( x , y ) ⊗ pθ ( x̂ , ŷ ) [ ∇θfθ ( x , y ) −∇θfθ ( x̂ , y ) ︸ ︷︷ ︸ consistency gradient +∇θfθ ( x̂ , y ) −∇θfθ ( x̂ , ŷ ) ︸ ︷︷ ︸ contrastive gradient ] . ( 11 ) Next , we show that the two parts correspond to two effective mechanisms developed in the adversarial training literature . AT loss . As the two sample pairs in the contrastive gradient share the same input x̂ , we can see that the contrastive gradient can be written equivalently as Epd ( x , y ) ⊗ pθ ( x̂ , ŷ ) [ ∇θfθ ( x̂ , y ) −∇θfθ ( x̂ , ŷ ) ] =Epd ( x , y ) ⊗ pθ ( x̂ ) [ ∇θfθ ( x̂ , y ) − Epθ ( ŷ|x̂ ) ∇θfθ ( x̂ , ŷ ) ] =Epd ( x , y ) ⊗ pθ ( x̂ ) ∇θ log pθ ( y|x̂ ) , ( 12 ) which is exactly the negative gradient of the robust CE loss ( AT loss ) in Eq . 7 , in other words , gradient ascent with the contrastive gradient is equivalent to gradient descent w.r.t . the AT loss . Regularization . As for the consistency gradient , original AT ( Madry et al. , 2018 ) simply ignores it . Its variant TRADES ( Zhang et al. , 2019 ) instead proposes the KL regularization KL ( p ( ·|x̂ ) ‖p ( ·|x ) ) that regularizes the consistency of the predicted probabilities on all classes , whose optimum implies that p ( ·|x̂ ) = p ( ·|x ) → fθ ( x , y ) = fθ ( x̂ , y ) . Comparing AT and JEM training paradigms . The above analysis indicates that the minimization objective of AT is closely related to the maximum likelihood training of JEM ( Grathwohl et al. , 2019 ) . Compared to JEM that decomposes the joint likelihood into an unconditional model pθ ( x ) and a discriminative model pθ ( y|x ) , the decomposition of AT in Eq . 10 instead stabilizes training by introducing an intermediate adversarial pair ( x̂ , y ) that bridges the positive pair ( x , y ) and the negative pair ( x̂ , ŷ ) . Besides , it can inject the adversarial robustness bias by regularizing the consistency gradient . Together with our analysis on the maximization process , we show that AT is a competitive alternative for training JEM ( a generative model ) with more stable training behaviors . That explains why robust models with AT are also generative .
The submission proposes a unified probabilistic framework to illustrate the generative capability of adversarial training. It also offers a unified perspective of adversarial training and sampling from both a supervised learning setting and an unsupervised learning setting. The proposed adversarial sampling strategy from the method is extensively demonstrated on different benchmarks, showing better quality compared with existing related works.
SP:ea4c43bb41d0730ac92c716aea0e118be2119ab3
Differentiable Hyper-parameter Optimization
Hyper-parameters are widely present in machine learning . Concretely , large amount of hyper-parameters exist in network layers , such as kernel size , channel size and the hidden layer size , which directly affect performance of the model . Thus , hyper-parameter optimization is crucial for machine learning . Current hyper-parameter optimization always requires multiple training sessions , resulting in a large time consuming . To solve this problem , we propose a method to fine-tune neural network ’ s hyper-parameters efficiently in this paper , where optimization completes in only one training session . We apply our method for the optimization of various neural network layers ’ hyper-parameters and compare it with multiple benchmark hyper-parameter optimization models . Experimental results show that our method is commonly 10 times faster than traditional and mainstream methods such as random search , Bayesian optimization and many other state-of-art models . It also achieves higher quality hyper-parameters with better accuracy and stronger stability . 1 INTRODUCTION . HPO ( hyper-parameter optimization ) is one of the most critical parts in auto-ML ( Thornton et al. , 2012 ; Domhan et al. , 2015 ; Kotthoff et al. , 2017 ) . Simple and low-dimensional hyper-parameters can be adjusted manually . It is also practical to use grid search or combine grid search with manual adjustment to deal with this simple problem ( Montavon et al. , 2012 ; gri , 2007 ; Hinton , 2010 ) . With the number of hyper-parameters continues increasing , manual tuning and grid search get ineffective . For a slightly large neural network model , we can use BO ( bayesian optimization ) ( Snoek et al. , 2012 ) or ZOOpt ( zeroth-order optimization ) ( Liu et al. , 2018 ) to optimize hyper-parameters . BO uses Gaussian process regression to fit mean and variance of objective function . However , a large number of matrix operations are needed in the fitting process , and multiple training sessions are needed to evaluate the predicted hyper-parameters . Time consuming increases along with each training session , and the total time consuming is positively correlated with the number of training sessions . Therefore , BO is still not suitable for large amount of hyper-parameters and so is ZOOpt . In addition to BO and ZOOpt , many evolutionary algorithms ( Young et al. , 2015 ) have also been applied . For example , genetic algorithm ( Goldberg ) is often used for HPO . Evolutionary algorithms can often avoid the problem of local optimal . However , a fatal flaw is the low time efficiency . When dealing with large-scale systems , random search ( ran , 2012 ) is a practical and more efficient method to solve HPO . Based on experiences , random search may perform better than BO in some cases with better time efficiency and accuracy . In addition , currently very effective HPO methods are probably HB ( Hyperband ( Li et al. , 2016 ) and DEHB ( Awad et al. , 2021 ) . They accelerate the convergence and make it twice faster than random search . Totally , all current models have a common defect which is a requirement for multiple training sessions of the fine-tuned model . While each training session is always expensive in time consuming . To get rid of this limit , we propose DHPO ( differentiable hyper-parameter optimization ) , which accomplish HPO within one training session . Concretely , we change the form of hyper-parameters and include them in the calculation of forward propagation to achieve differentiable hyper-parameters . In this way , hyper-parameters are differentiable with the goal of minimize the loss function . When the session is over , hyper-parameters complete optimization together with network ’ s parameters . Therefore , only one training session is needed in DHPO . The contributions of this paper are summarized as follows . • In this paper , we propose DHPO , which is the first model to solve hyper-parameter optimization in only one training session . • The proposed approach is universal . It is an idea for HPO which can be applied to various kinds of hyper-parameters in neural network . • We conduct extensive experiments on various kinds of neural network layers compared with multiple benchmark HPO models to evaluate the extreme efficiency and high performance of DHPO . In the remaining of this paper , Section 3 describes the proposed method . Experiments are conducted and analyzed in Section 4 . We overview related work in Section 5 . Section 6 draws the conclusions and future work . 2 BACKGROUND . In this section , we introduce related techniques briefly . Darts ( Liu et al. , 2019 ) is used to solve automatic network architecture search , which is described to determine the best operation from multiple candidate operators locally and globally . Take Figure 1 as example . It is selecting an activation for the fully connected layer from { Tanh , Sigmoid , Relu , Softmax } and supposing Relu is the best choice . Grid search costs four training sessions to evaluate each activation . While Darts can select the hyper-parameters in a single training session . Firstly , Darts calculates features X transformed by the fully connected layer and then uses each activation to process X once to get four non-linear features , denoted as o = [ o1 , o2 , o3 , o4 ] . Further , softmax ( α ) assigns a weight to each oi and aggregates weighted oi by summing them , where αi is a trainable parameter . An ideal train always ends up with max softmax ( α ) → 1 as shown in Figure 1 . Darts in Figure 1 finally determines Relu as the optimal activation with softmax ( alpha ) 3 very close to 1 . Accordingly , softmax ( α ) i ≈ 0 , i 6= 3 meaning a shield to the information contained in o1 , o2 , o4 , which is equivalent to using Relu only . 3 METHOD . As introduced in the background , Darts still has fatal defects . On the one hand , max softmax ( α ) doesn ’ t always converge to a level very close to 1 . The cases where multiple candidates occupy similar weights always exist especially for a large amount of candidates , which means Darts fails to distinguish different candidates and hit the optimal . On the other hand , Darts is only suitable for hyper-parameter with independent candidates . For example , the channel size is beyond Darts ’ s capability . If we ’ d like to apply Darts to solve channel size , we should set a candidate for each possible value of channel size . Then there will beO ( n2 ) channels in total , which is space expensive . Motivated by this , we propose DHPO , aiming at solving all these problems existing in Darts and current HPO models . In the following , we first take the optimization of convolution layer ’ s channel size as example to draw the core of DHPO in Section 3.1 . Then , we apply DHPO to more hyperparameters in Section 3.2 . 3.1 DIFFERENTIABLE HYPER-PARAMETER OPTIMIZATION . The target of DHPO is to make hyper-parameter θ differentiable , and we achieve it through constructing trainable parameter α to substitute θ in the training . Obviously , the core of the idea is to point out the limitations for α and give out a universal method to construct and apply α . In this section , we first declare the sufficient conditions for α to substitute θ based on Theorem 1 in Section 3.1.1 . Then we explain how to construct α and use it to control the structure of neural network , namely that is the forward propagation under α in Section 3.1.2 . In the end , we use Theorem 1 to prove that α is able to substitute θ as Theorem 2 in Section 3.1.3 . 3.1.1 LIMITATIONS FOR α Our target is to construct trainable parameter α to substitute θ in the training . We will point out the sufficient conditions for α in the following . Firstly , we define found sufficient conditions as a new relation between α and θ , which is defined as expressible as Definition 3.1 . Then , we prove that if α is expressible for θ , then we can replace θ with α in neural network as Theorem 1 . The definition and theorem are as follows . Definition 3.1 . Expressible : For a neural network F : Rd 7→ R with W and Θ as parameters and hyper-parameters respectively , hyper-parameter θ2 ∈ Ω2 is expressible for hyper-parameter θ1 ∈ Ω1 if and only if there is a surjective h : Ω2 7→ Ω1 ( θ1 = h ( θ2 ) ) which makes network structure under F ( W |θ1 ) and that under F ( W |θ2 ) are the same . Theorem 1 . If θ2 is expressible for θ1 , then we can replace θ1 with θ2 in neural network . Proof . If θ2 is expressible for θ1 , then there is a surjective from θ2 to θ1 . Therefore , ∀θ1 ∈ Ω1 , ∃θ2 ∈ Ω2 , h ( θ2 ) = θ1 . Meanwhile , F ( W |θ2 ) and F ( W |θ1 ) share the same structures according to Definition 3.1 . So we can replace θ1 with θ2 in a neural network . According to Theorem 1 and Definition 3.1 , we can replace θ with α in neural network as long as the constructed α satisfies the following two conditions . One is that there is a surjective θ = h ( α ) . The other is that the network structure controlled by α is the same to that of θ under θ = h ( α ) . 3.1.2 FORWARD PROPAGATION UNDER α In this section , we first propose the method to construct expressible α as described above , and then explain how α controls the structure of neural network , i.e. , applying α in the forward propagation . φ ( X|α ) = sup ( θ ) ∑ i=1 i ∗ ( X ? κi ) = σ ( ( softmax ( α ) ) ·A− σ ( β ) ) ∗ a ) ( 1 ) We take convolution layer ’ s channel size as example to construct trainable α , which should be expressible for θchannel size ( abbreviated as θ ) . We construct α as α = [ α1 , · · · , αsup ( θ ) ] and α ∈ Rsup ( θ ) , sup ( θ ) = max θ . Formula 1 describes the forward propagation in this convolution layer under α. X ∈ RW×H is the input of convolution layer which is a single-channel image . κi represents the convolution kernel of i-th channel , and we prepare sup ( θ ) candidate kernels in the initialization of neural network . ( ? ) represents convolution operation and ( · ) represents matrix multiplication . A = [ 1 · · · 1 . . . . . . 0 1 ] T is a lower triangular matrix . γ ∈ R is a trainable parameter and a ∈ R is a large constant . Obviously , the core of formula 1 is the calculation of . We visualize the calculation in Figure 2 . Two cases are given in this figure . We take the left as example . α is first transformed by softmax activation and 0 < softmax ( α ) i < 1 . Then we get A by multiplying matrix softmax ( α ) and matrixA , A1 = 1 and Ai > Aj if i > j . Next , we subtract σ ( γ ) from Ai and multiply it by a large constant a , a > 1 . In this time , −a < ( Ai − σ ( γ ) ) ∗ a < a , and it maintains the same monotonicity as A . In the last step , we use σ again to map ( Ai − σ ( γ ) ) ∗ a to a value close to 1 or 0 . Finally , i = σ ( ( Ai−σ ( γ ) ) ∗a ) . In this example , 1 , 2 , 3 are very close to 1 , and the others are very close to 0 . In this occasion , we think that the channel size is 3 . Based on the above construction , α has the same effect as θchannel size . Thus , it is reasonable to substitute θchannel size with α . We will prove this in the following Section 3.1.3 . 3.1.3 EXPRESSIBLE FOR θ The goal is to prove that we can substitute θchannel size with α . According to Theorem 1 , we just need to prove that α is expressible for θchannel size . Before proof , we first list three key properties of in the following which are necessary to the proof . is constructed from α and has three key characteristics . ¬ 1 ≈ 1 . 1 > · · · > sup ( θ ) . ® There is an index t dividing into two sets εbig = { i|1 ≤ i ≤ t } and εsmall = { i|t+ 1 ≤ i ≤ sup ( θ ) } . The items in εbig are all close to 1 and items in εsmall are all close to 0 . The first property ensures that at least one channel is selected . The second property ensures the selected channels are always the first few rather than random several in candidate channels . The third property makes unselected channels blocked away , especially when a 7→ ∞ . Based on these features , we have Theorem 2 . Theorem 2 . When a 7→ ∞ , α is expressible for θ under h ( α ) = rounded ∑ . Proof . If we would like to prove α is expressible for θ , we just need to prove h ( α ) is surjective and network structure controlled by α is the same to that of θ under θ = h ( α ) according to the discussion in Section 3.1.1 . Obviously , θ = h ( α ) is a surjective . We then prove convolution layers under θ and α have same structure . Suppose that the network structure controlled by θ is a convolution layer composed of the first θ channels from candidates . As for the structure controlled by α , we can also see it as a convolution layer composed of the first θ channels according to the third characteristic of . Because noise from unselected channels will fade out with a→∞ . At this time , F ( X|α ) ⇔ F ( X|θ ) . Based on above discussions , we finally achieve the differentiable channel size . Since α is trainable and expressible for θchannel size . Then we can replace θchannel size withα in this convolution layer . When the training session is over , we take rounded ∑ as the optimized θchannel size .
This paper introduces a method for hyper-parameter optimization (HPO) for deep neural networks. Its main idea is to replace hyper-parameters by trainable parameters, which can be included in the training process of the network itself. The proposed method is applied to hyper-parameter tunning for two types of networks, namely CNN and FNN on two datasets MNIST and SVHN. It is also compared with several baselines.
SP:2245e9a39d5ebad6d08e327c57cd822900d3f612
Differentiable Hyper-parameter Optimization
Hyper-parameters are widely present in machine learning . Concretely , large amount of hyper-parameters exist in network layers , such as kernel size , channel size and the hidden layer size , which directly affect performance of the model . Thus , hyper-parameter optimization is crucial for machine learning . Current hyper-parameter optimization always requires multiple training sessions , resulting in a large time consuming . To solve this problem , we propose a method to fine-tune neural network ’ s hyper-parameters efficiently in this paper , where optimization completes in only one training session . We apply our method for the optimization of various neural network layers ’ hyper-parameters and compare it with multiple benchmark hyper-parameter optimization models . Experimental results show that our method is commonly 10 times faster than traditional and mainstream methods such as random search , Bayesian optimization and many other state-of-art models . It also achieves higher quality hyper-parameters with better accuracy and stronger stability . 1 INTRODUCTION . HPO ( hyper-parameter optimization ) is one of the most critical parts in auto-ML ( Thornton et al. , 2012 ; Domhan et al. , 2015 ; Kotthoff et al. , 2017 ) . Simple and low-dimensional hyper-parameters can be adjusted manually . It is also practical to use grid search or combine grid search with manual adjustment to deal with this simple problem ( Montavon et al. , 2012 ; gri , 2007 ; Hinton , 2010 ) . With the number of hyper-parameters continues increasing , manual tuning and grid search get ineffective . For a slightly large neural network model , we can use BO ( bayesian optimization ) ( Snoek et al. , 2012 ) or ZOOpt ( zeroth-order optimization ) ( Liu et al. , 2018 ) to optimize hyper-parameters . BO uses Gaussian process regression to fit mean and variance of objective function . However , a large number of matrix operations are needed in the fitting process , and multiple training sessions are needed to evaluate the predicted hyper-parameters . Time consuming increases along with each training session , and the total time consuming is positively correlated with the number of training sessions . Therefore , BO is still not suitable for large amount of hyper-parameters and so is ZOOpt . In addition to BO and ZOOpt , many evolutionary algorithms ( Young et al. , 2015 ) have also been applied . For example , genetic algorithm ( Goldberg ) is often used for HPO . Evolutionary algorithms can often avoid the problem of local optimal . However , a fatal flaw is the low time efficiency . When dealing with large-scale systems , random search ( ran , 2012 ) is a practical and more efficient method to solve HPO . Based on experiences , random search may perform better than BO in some cases with better time efficiency and accuracy . In addition , currently very effective HPO methods are probably HB ( Hyperband ( Li et al. , 2016 ) and DEHB ( Awad et al. , 2021 ) . They accelerate the convergence and make it twice faster than random search . Totally , all current models have a common defect which is a requirement for multiple training sessions of the fine-tuned model . While each training session is always expensive in time consuming . To get rid of this limit , we propose DHPO ( differentiable hyper-parameter optimization ) , which accomplish HPO within one training session . Concretely , we change the form of hyper-parameters and include them in the calculation of forward propagation to achieve differentiable hyper-parameters . In this way , hyper-parameters are differentiable with the goal of minimize the loss function . When the session is over , hyper-parameters complete optimization together with network ’ s parameters . Therefore , only one training session is needed in DHPO . The contributions of this paper are summarized as follows . • In this paper , we propose DHPO , which is the first model to solve hyper-parameter optimization in only one training session . • The proposed approach is universal . It is an idea for HPO which can be applied to various kinds of hyper-parameters in neural network . • We conduct extensive experiments on various kinds of neural network layers compared with multiple benchmark HPO models to evaluate the extreme efficiency and high performance of DHPO . In the remaining of this paper , Section 3 describes the proposed method . Experiments are conducted and analyzed in Section 4 . We overview related work in Section 5 . Section 6 draws the conclusions and future work . 2 BACKGROUND . In this section , we introduce related techniques briefly . Darts ( Liu et al. , 2019 ) is used to solve automatic network architecture search , which is described to determine the best operation from multiple candidate operators locally and globally . Take Figure 1 as example . It is selecting an activation for the fully connected layer from { Tanh , Sigmoid , Relu , Softmax } and supposing Relu is the best choice . Grid search costs four training sessions to evaluate each activation . While Darts can select the hyper-parameters in a single training session . Firstly , Darts calculates features X transformed by the fully connected layer and then uses each activation to process X once to get four non-linear features , denoted as o = [ o1 , o2 , o3 , o4 ] . Further , softmax ( α ) assigns a weight to each oi and aggregates weighted oi by summing them , where αi is a trainable parameter . An ideal train always ends up with max softmax ( α ) → 1 as shown in Figure 1 . Darts in Figure 1 finally determines Relu as the optimal activation with softmax ( alpha ) 3 very close to 1 . Accordingly , softmax ( α ) i ≈ 0 , i 6= 3 meaning a shield to the information contained in o1 , o2 , o4 , which is equivalent to using Relu only . 3 METHOD . As introduced in the background , Darts still has fatal defects . On the one hand , max softmax ( α ) doesn ’ t always converge to a level very close to 1 . The cases where multiple candidates occupy similar weights always exist especially for a large amount of candidates , which means Darts fails to distinguish different candidates and hit the optimal . On the other hand , Darts is only suitable for hyper-parameter with independent candidates . For example , the channel size is beyond Darts ’ s capability . If we ’ d like to apply Darts to solve channel size , we should set a candidate for each possible value of channel size . Then there will beO ( n2 ) channels in total , which is space expensive . Motivated by this , we propose DHPO , aiming at solving all these problems existing in Darts and current HPO models . In the following , we first take the optimization of convolution layer ’ s channel size as example to draw the core of DHPO in Section 3.1 . Then , we apply DHPO to more hyperparameters in Section 3.2 . 3.1 DIFFERENTIABLE HYPER-PARAMETER OPTIMIZATION . The target of DHPO is to make hyper-parameter θ differentiable , and we achieve it through constructing trainable parameter α to substitute θ in the training . Obviously , the core of the idea is to point out the limitations for α and give out a universal method to construct and apply α . In this section , we first declare the sufficient conditions for α to substitute θ based on Theorem 1 in Section 3.1.1 . Then we explain how to construct α and use it to control the structure of neural network , namely that is the forward propagation under α in Section 3.1.2 . In the end , we use Theorem 1 to prove that α is able to substitute θ as Theorem 2 in Section 3.1.3 . 3.1.1 LIMITATIONS FOR α Our target is to construct trainable parameter α to substitute θ in the training . We will point out the sufficient conditions for α in the following . Firstly , we define found sufficient conditions as a new relation between α and θ , which is defined as expressible as Definition 3.1 . Then , we prove that if α is expressible for θ , then we can replace θ with α in neural network as Theorem 1 . The definition and theorem are as follows . Definition 3.1 . Expressible : For a neural network F : Rd 7→ R with W and Θ as parameters and hyper-parameters respectively , hyper-parameter θ2 ∈ Ω2 is expressible for hyper-parameter θ1 ∈ Ω1 if and only if there is a surjective h : Ω2 7→ Ω1 ( θ1 = h ( θ2 ) ) which makes network structure under F ( W |θ1 ) and that under F ( W |θ2 ) are the same . Theorem 1 . If θ2 is expressible for θ1 , then we can replace θ1 with θ2 in neural network . Proof . If θ2 is expressible for θ1 , then there is a surjective from θ2 to θ1 . Therefore , ∀θ1 ∈ Ω1 , ∃θ2 ∈ Ω2 , h ( θ2 ) = θ1 . Meanwhile , F ( W |θ2 ) and F ( W |θ1 ) share the same structures according to Definition 3.1 . So we can replace θ1 with θ2 in a neural network . According to Theorem 1 and Definition 3.1 , we can replace θ with α in neural network as long as the constructed α satisfies the following two conditions . One is that there is a surjective θ = h ( α ) . The other is that the network structure controlled by α is the same to that of θ under θ = h ( α ) . 3.1.2 FORWARD PROPAGATION UNDER α In this section , we first propose the method to construct expressible α as described above , and then explain how α controls the structure of neural network , i.e. , applying α in the forward propagation . φ ( X|α ) = sup ( θ ) ∑ i=1 i ∗ ( X ? κi ) = σ ( ( softmax ( α ) ) ·A− σ ( β ) ) ∗ a ) ( 1 ) We take convolution layer ’ s channel size as example to construct trainable α , which should be expressible for θchannel size ( abbreviated as θ ) . We construct α as α = [ α1 , · · · , αsup ( θ ) ] and α ∈ Rsup ( θ ) , sup ( θ ) = max θ . Formula 1 describes the forward propagation in this convolution layer under α. X ∈ RW×H is the input of convolution layer which is a single-channel image . κi represents the convolution kernel of i-th channel , and we prepare sup ( θ ) candidate kernels in the initialization of neural network . ( ? ) represents convolution operation and ( · ) represents matrix multiplication . A = [ 1 · · · 1 . . . . . . 0 1 ] T is a lower triangular matrix . γ ∈ R is a trainable parameter and a ∈ R is a large constant . Obviously , the core of formula 1 is the calculation of . We visualize the calculation in Figure 2 . Two cases are given in this figure . We take the left as example . α is first transformed by softmax activation and 0 < softmax ( α ) i < 1 . Then we get A by multiplying matrix softmax ( α ) and matrixA , A1 = 1 and Ai > Aj if i > j . Next , we subtract σ ( γ ) from Ai and multiply it by a large constant a , a > 1 . In this time , −a < ( Ai − σ ( γ ) ) ∗ a < a , and it maintains the same monotonicity as A . In the last step , we use σ again to map ( Ai − σ ( γ ) ) ∗ a to a value close to 1 or 0 . Finally , i = σ ( ( Ai−σ ( γ ) ) ∗a ) . In this example , 1 , 2 , 3 are very close to 1 , and the others are very close to 0 . In this occasion , we think that the channel size is 3 . Based on the above construction , α has the same effect as θchannel size . Thus , it is reasonable to substitute θchannel size with α . We will prove this in the following Section 3.1.3 . 3.1.3 EXPRESSIBLE FOR θ The goal is to prove that we can substitute θchannel size with α . According to Theorem 1 , we just need to prove that α is expressible for θchannel size . Before proof , we first list three key properties of in the following which are necessary to the proof . is constructed from α and has three key characteristics . ¬ 1 ≈ 1 . 1 > · · · > sup ( θ ) . ® There is an index t dividing into two sets εbig = { i|1 ≤ i ≤ t } and εsmall = { i|t+ 1 ≤ i ≤ sup ( θ ) } . The items in εbig are all close to 1 and items in εsmall are all close to 0 . The first property ensures that at least one channel is selected . The second property ensures the selected channels are always the first few rather than random several in candidate channels . The third property makes unselected channels blocked away , especially when a 7→ ∞ . Based on these features , we have Theorem 2 . Theorem 2 . When a 7→ ∞ , α is expressible for θ under h ( α ) = rounded ∑ . Proof . If we would like to prove α is expressible for θ , we just need to prove h ( α ) is surjective and network structure controlled by α is the same to that of θ under θ = h ( α ) according to the discussion in Section 3.1.1 . Obviously , θ = h ( α ) is a surjective . We then prove convolution layers under θ and α have same structure . Suppose that the network structure controlled by θ is a convolution layer composed of the first θ channels from candidates . As for the structure controlled by α , we can also see it as a convolution layer composed of the first θ channels according to the third characteristic of . Because noise from unselected channels will fade out with a→∞ . At this time , F ( X|α ) ⇔ F ( X|θ ) . Based on above discussions , we finally achieve the differentiable channel size . Since α is trainable and expressible for θchannel size . Then we can replace θchannel size withα in this convolution layer . When the training session is over , we take rounded ∑ as the optimized θchannel size .
The authors proposed a differentiable method to optimize neural networks and hyperparameters simultaneously like DARTS. And, they used a new parameterization to represent the original discrete hyperparameters. They claimed that it could eliminate the impact of rounding.
SP:2245e9a39d5ebad6d08e327c57cd822900d3f612
Differentiable Hyper-parameter Optimization
Hyper-parameters are widely present in machine learning . Concretely , large amount of hyper-parameters exist in network layers , such as kernel size , channel size and the hidden layer size , which directly affect performance of the model . Thus , hyper-parameter optimization is crucial for machine learning . Current hyper-parameter optimization always requires multiple training sessions , resulting in a large time consuming . To solve this problem , we propose a method to fine-tune neural network ’ s hyper-parameters efficiently in this paper , where optimization completes in only one training session . We apply our method for the optimization of various neural network layers ’ hyper-parameters and compare it with multiple benchmark hyper-parameter optimization models . Experimental results show that our method is commonly 10 times faster than traditional and mainstream methods such as random search , Bayesian optimization and many other state-of-art models . It also achieves higher quality hyper-parameters with better accuracy and stronger stability . 1 INTRODUCTION . HPO ( hyper-parameter optimization ) is one of the most critical parts in auto-ML ( Thornton et al. , 2012 ; Domhan et al. , 2015 ; Kotthoff et al. , 2017 ) . Simple and low-dimensional hyper-parameters can be adjusted manually . It is also practical to use grid search or combine grid search with manual adjustment to deal with this simple problem ( Montavon et al. , 2012 ; gri , 2007 ; Hinton , 2010 ) . With the number of hyper-parameters continues increasing , manual tuning and grid search get ineffective . For a slightly large neural network model , we can use BO ( bayesian optimization ) ( Snoek et al. , 2012 ) or ZOOpt ( zeroth-order optimization ) ( Liu et al. , 2018 ) to optimize hyper-parameters . BO uses Gaussian process regression to fit mean and variance of objective function . However , a large number of matrix operations are needed in the fitting process , and multiple training sessions are needed to evaluate the predicted hyper-parameters . Time consuming increases along with each training session , and the total time consuming is positively correlated with the number of training sessions . Therefore , BO is still not suitable for large amount of hyper-parameters and so is ZOOpt . In addition to BO and ZOOpt , many evolutionary algorithms ( Young et al. , 2015 ) have also been applied . For example , genetic algorithm ( Goldberg ) is often used for HPO . Evolutionary algorithms can often avoid the problem of local optimal . However , a fatal flaw is the low time efficiency . When dealing with large-scale systems , random search ( ran , 2012 ) is a practical and more efficient method to solve HPO . Based on experiences , random search may perform better than BO in some cases with better time efficiency and accuracy . In addition , currently very effective HPO methods are probably HB ( Hyperband ( Li et al. , 2016 ) and DEHB ( Awad et al. , 2021 ) . They accelerate the convergence and make it twice faster than random search . Totally , all current models have a common defect which is a requirement for multiple training sessions of the fine-tuned model . While each training session is always expensive in time consuming . To get rid of this limit , we propose DHPO ( differentiable hyper-parameter optimization ) , which accomplish HPO within one training session . Concretely , we change the form of hyper-parameters and include them in the calculation of forward propagation to achieve differentiable hyper-parameters . In this way , hyper-parameters are differentiable with the goal of minimize the loss function . When the session is over , hyper-parameters complete optimization together with network ’ s parameters . Therefore , only one training session is needed in DHPO . The contributions of this paper are summarized as follows . • In this paper , we propose DHPO , which is the first model to solve hyper-parameter optimization in only one training session . • The proposed approach is universal . It is an idea for HPO which can be applied to various kinds of hyper-parameters in neural network . • We conduct extensive experiments on various kinds of neural network layers compared with multiple benchmark HPO models to evaluate the extreme efficiency and high performance of DHPO . In the remaining of this paper , Section 3 describes the proposed method . Experiments are conducted and analyzed in Section 4 . We overview related work in Section 5 . Section 6 draws the conclusions and future work . 2 BACKGROUND . In this section , we introduce related techniques briefly . Darts ( Liu et al. , 2019 ) is used to solve automatic network architecture search , which is described to determine the best operation from multiple candidate operators locally and globally . Take Figure 1 as example . It is selecting an activation for the fully connected layer from { Tanh , Sigmoid , Relu , Softmax } and supposing Relu is the best choice . Grid search costs four training sessions to evaluate each activation . While Darts can select the hyper-parameters in a single training session . Firstly , Darts calculates features X transformed by the fully connected layer and then uses each activation to process X once to get four non-linear features , denoted as o = [ o1 , o2 , o3 , o4 ] . Further , softmax ( α ) assigns a weight to each oi and aggregates weighted oi by summing them , where αi is a trainable parameter . An ideal train always ends up with max softmax ( α ) → 1 as shown in Figure 1 . Darts in Figure 1 finally determines Relu as the optimal activation with softmax ( alpha ) 3 very close to 1 . Accordingly , softmax ( α ) i ≈ 0 , i 6= 3 meaning a shield to the information contained in o1 , o2 , o4 , which is equivalent to using Relu only . 3 METHOD . As introduced in the background , Darts still has fatal defects . On the one hand , max softmax ( α ) doesn ’ t always converge to a level very close to 1 . The cases where multiple candidates occupy similar weights always exist especially for a large amount of candidates , which means Darts fails to distinguish different candidates and hit the optimal . On the other hand , Darts is only suitable for hyper-parameter with independent candidates . For example , the channel size is beyond Darts ’ s capability . If we ’ d like to apply Darts to solve channel size , we should set a candidate for each possible value of channel size . Then there will beO ( n2 ) channels in total , which is space expensive . Motivated by this , we propose DHPO , aiming at solving all these problems existing in Darts and current HPO models . In the following , we first take the optimization of convolution layer ’ s channel size as example to draw the core of DHPO in Section 3.1 . Then , we apply DHPO to more hyperparameters in Section 3.2 . 3.1 DIFFERENTIABLE HYPER-PARAMETER OPTIMIZATION . The target of DHPO is to make hyper-parameter θ differentiable , and we achieve it through constructing trainable parameter α to substitute θ in the training . Obviously , the core of the idea is to point out the limitations for α and give out a universal method to construct and apply α . In this section , we first declare the sufficient conditions for α to substitute θ based on Theorem 1 in Section 3.1.1 . Then we explain how to construct α and use it to control the structure of neural network , namely that is the forward propagation under α in Section 3.1.2 . In the end , we use Theorem 1 to prove that α is able to substitute θ as Theorem 2 in Section 3.1.3 . 3.1.1 LIMITATIONS FOR α Our target is to construct trainable parameter α to substitute θ in the training . We will point out the sufficient conditions for α in the following . Firstly , we define found sufficient conditions as a new relation between α and θ , which is defined as expressible as Definition 3.1 . Then , we prove that if α is expressible for θ , then we can replace θ with α in neural network as Theorem 1 . The definition and theorem are as follows . Definition 3.1 . Expressible : For a neural network F : Rd 7→ R with W and Θ as parameters and hyper-parameters respectively , hyper-parameter θ2 ∈ Ω2 is expressible for hyper-parameter θ1 ∈ Ω1 if and only if there is a surjective h : Ω2 7→ Ω1 ( θ1 = h ( θ2 ) ) which makes network structure under F ( W |θ1 ) and that under F ( W |θ2 ) are the same . Theorem 1 . If θ2 is expressible for θ1 , then we can replace θ1 with θ2 in neural network . Proof . If θ2 is expressible for θ1 , then there is a surjective from θ2 to θ1 . Therefore , ∀θ1 ∈ Ω1 , ∃θ2 ∈ Ω2 , h ( θ2 ) = θ1 . Meanwhile , F ( W |θ2 ) and F ( W |θ1 ) share the same structures according to Definition 3.1 . So we can replace θ1 with θ2 in a neural network . According to Theorem 1 and Definition 3.1 , we can replace θ with α in neural network as long as the constructed α satisfies the following two conditions . One is that there is a surjective θ = h ( α ) . The other is that the network structure controlled by α is the same to that of θ under θ = h ( α ) . 3.1.2 FORWARD PROPAGATION UNDER α In this section , we first propose the method to construct expressible α as described above , and then explain how α controls the structure of neural network , i.e. , applying α in the forward propagation . φ ( X|α ) = sup ( θ ) ∑ i=1 i ∗ ( X ? κi ) = σ ( ( softmax ( α ) ) ·A− σ ( β ) ) ∗ a ) ( 1 ) We take convolution layer ’ s channel size as example to construct trainable α , which should be expressible for θchannel size ( abbreviated as θ ) . We construct α as α = [ α1 , · · · , αsup ( θ ) ] and α ∈ Rsup ( θ ) , sup ( θ ) = max θ . Formula 1 describes the forward propagation in this convolution layer under α. X ∈ RW×H is the input of convolution layer which is a single-channel image . κi represents the convolution kernel of i-th channel , and we prepare sup ( θ ) candidate kernels in the initialization of neural network . ( ? ) represents convolution operation and ( · ) represents matrix multiplication . A = [ 1 · · · 1 . . . . . . 0 1 ] T is a lower triangular matrix . γ ∈ R is a trainable parameter and a ∈ R is a large constant . Obviously , the core of formula 1 is the calculation of . We visualize the calculation in Figure 2 . Two cases are given in this figure . We take the left as example . α is first transformed by softmax activation and 0 < softmax ( α ) i < 1 . Then we get A by multiplying matrix softmax ( α ) and matrixA , A1 = 1 and Ai > Aj if i > j . Next , we subtract σ ( γ ) from Ai and multiply it by a large constant a , a > 1 . In this time , −a < ( Ai − σ ( γ ) ) ∗ a < a , and it maintains the same monotonicity as A . In the last step , we use σ again to map ( Ai − σ ( γ ) ) ∗ a to a value close to 1 or 0 . Finally , i = σ ( ( Ai−σ ( γ ) ) ∗a ) . In this example , 1 , 2 , 3 are very close to 1 , and the others are very close to 0 . In this occasion , we think that the channel size is 3 . Based on the above construction , α has the same effect as θchannel size . Thus , it is reasonable to substitute θchannel size with α . We will prove this in the following Section 3.1.3 . 3.1.3 EXPRESSIBLE FOR θ The goal is to prove that we can substitute θchannel size with α . According to Theorem 1 , we just need to prove that α is expressible for θchannel size . Before proof , we first list three key properties of in the following which are necessary to the proof . is constructed from α and has three key characteristics . ¬ 1 ≈ 1 . 1 > · · · > sup ( θ ) . ® There is an index t dividing into two sets εbig = { i|1 ≤ i ≤ t } and εsmall = { i|t+ 1 ≤ i ≤ sup ( θ ) } . The items in εbig are all close to 1 and items in εsmall are all close to 0 . The first property ensures that at least one channel is selected . The second property ensures the selected channels are always the first few rather than random several in candidate channels . The third property makes unselected channels blocked away , especially when a 7→ ∞ . Based on these features , we have Theorem 2 . Theorem 2 . When a 7→ ∞ , α is expressible for θ under h ( α ) = rounded ∑ . Proof . If we would like to prove α is expressible for θ , we just need to prove h ( α ) is surjective and network structure controlled by α is the same to that of θ under θ = h ( α ) according to the discussion in Section 3.1.1 . Obviously , θ = h ( α ) is a surjective . We then prove convolution layers under θ and α have same structure . Suppose that the network structure controlled by θ is a convolution layer composed of the first θ channels from candidates . As for the structure controlled by α , we can also see it as a convolution layer composed of the first θ channels according to the third characteristic of . Because noise from unselected channels will fade out with a→∞ . At this time , F ( X|α ) ⇔ F ( X|θ ) . Based on above discussions , we finally achieve the differentiable channel size . Since α is trainable and expressible for θchannel size . Then we can replace θchannel size withα in this convolution layer . When the training session is over , we take rounded ∑ as the optimized θchannel size .
This paper proposes to tune hyperparameters in a differentiable way by using a modified version of softmax function. It covers the tuning for three kinds of hyper-parameters as examples: channel size, kernel size and hidden layer size. Experiments on MNIST and SVHN (which are small scale datasets by modern DNN standards) show improvements on previous methods. The proposed method itself is reasonable, however, this paper misses many previous works on this topic, which makes it hard to appreciate its novelty.
SP:2245e9a39d5ebad6d08e327c57cd822900d3f612
Weakly-Supervised Learning of Disentangled and Interpretable Skills for Hierarchical Reinforcement Learning
1 INTRODUCTION . Deep reinforcement learning ( RL ) has achieved great success for various applications , ranging from playing games ( Mnih et al. , 2013 ; Silver et al. , 2016 ) to complex locomotion and robots control ( Lillicrap et al. , 2015 ; Schulman et al. , 2015 ; 2017 ; Haarnoja et al. , 2017 ) . However , several challenges such as sparse rewards or inadaptability to unlearned tasks still hinder its practical usages in real-world problems . To alleviate these challenges , hierarchical RL ( Sutton et al. , 1999 ; Dietterich , 2000 ) has been studied where an agent pre-learns reusable skills from prior experiences and hierarchically solve higher-level problems by combining the skills . Two issues need to be resolved for the successful deployment of the hierarchical RL ; how to learn useful skills and how to effectively make use of the skills for various downstream tasks . A possible approach for skills that can be applicable to various downstream tasks is to learn without task-specific rewards ( Eysenbach et al. , 2018 ) . Another way to achieve the useful skills is to make them predictable . To learn those skills , ( Co-Reyes et al. , 2018 ; Sharma et al. , 2019 ) proposed to combine model-free and model-based RL approaches , where a skill-based predictive model , a dynamics model over the latent space , is trained together with a skill-based policy network.By using the predictive model for model-based planning during testing time , these works showed to efficiently solve various downstream tasks without the need to learn additional higher-level policies . However , since they did not consider how the skill is embedded into the latent space , the factors consisting of the skill often are entangled when the skill is a continuous latent variable . Compared to the entangled one , the skill consisting of disentangled factors has several advantages in its applicability in that the factors can be separately interpreted and handled . In this paper , we introduce a novel WEakly-supervised learning approach for learning Disentangled and Interpretable Skills ( WEDIS ) from the continuous latent representations of trajectories that are composed of several generative factors , e.g. , speed , direction , and curvature . To this end , we propose a weakly-supervised trajectory variational autoencoder ( WET-VAE ) model that is an extension of the trajectory VAE ( Co-Reyes et al. , 2018 ) consisting of a recurrent neural network ( RNN ) . We leverage the weak labels ( Margonis et al. , 2020 ) to enforce an inductive bias on the model , which explicitly enforces the trajectory representations to be disentangled into factors of interest that we intend the model to learn . To train the WET-VAE , we first synthetically generate a trajectory dataset by the combination of several factors of interest , because the trajectories obtained by an online exploration are likely to contain meaningless samples such as random walks . With the trajectory dataset , the WET-VAE model is trained apart from a policy network . It is worthy of noting that while this is similar to imitation learning , our data acquisition is much simpler than collecting expert demonstration . Sequentially , we train a skill-based policy network with the WET-VAE fixed . Given the latent representations as skills , the skill-based policy network is trained to generate similar trajectories with the decoder of the WET-VAE by minimizing the KL divergence between two trajectory distributions . However , training a policy to generate a trajectory given a skill is difficult since it is unlikely to explore the corresponding trajectory in the training procedure . Instead , we propose to train the policy network with the single-step transitions and perform the trajectory-level behaviors in the test time , which can be achieved with the knowledge of the learned skills . This simplifies the training procedure of the policy , and also allows for a sample-efficient large-scale planning strategy with the scaled trajectories . In experiments in Mujoco Ant environment , we show that our disentangled and interpretable skills are effective in solving challenging sparse reward and long-horizon problems in 2D navigation in mazes . 2 RELATED WORKS . Numerous approaches ( Sutton et al. , 1999 ; Bacon et al. , 2017 ; Florensa et al. , 2017 ; Hausman et al. , 2018 ; Haarnoja et al. , 2018 ; Eysenbach et al. , 2018 ; Shankar et al. , 2019 ; Shankar & Gupta , 2020 ; Co-Reyes et al. , 2018 ; Sharma et al. , 2019 ) have explored on learning reusable skills in RL to solve challenging long-horizon or sparse reward problems . ( Sutton et al. , 1999 ) pioneered a way to control higher-level abstraction by introducing an option-framework , which learns low-level primitives in a top-down manner . ( Bacon et al. , 2017 ) proposed an option-critic architecture that learns sub-policies of options . Also , several works ( Florensa et al. , 2017 ; Hausman et al. , 2018 ; Haarnoja et al. , 2018 ) introduced to learn skills with multiple tasks in a bottom-up manner . However , designing reward functions still requires expert knowledge and such task-specific rewards may limit a generalization ability of the agent to the downstream tasks . To overcome this issue , recent works ( Eysenbach et al. , 2018 ; Achiam et al. , 2018 ; Co-Reyes et al. , 2018 ; Sharma et al. , 2019 ; Campos et al. , 2020 ) proposed an unsupervised framework that does not require a hand-specified reward function . Model-based RL methods ( Levine et al. , 2016 ; Nagabandi et al. , 2018 ; Chua et al. , 2018 ; Ha & Schmidhuber , 2018 ) aim to learn a dynamics model of the environment . While these works are capable of solving unlearned tasks without the needs of an additional learning via planning through the dynamics model , they are often at the risk of falling into over-fitting due to a huge capacity of the required data to explore the environment . Instead of learning the underlying dynamics , some methods ( Co-Reyes et al. , 2018 ; Sharma et al. , 2019 ) attempted to combine the model-free and model-based RL for learning a skill-based predictive model and a skill-based policy . Despite the improved results , they still suffer from the lack of the interpretability of the skills . Learning disentangled latent representations of factors of variation within dataset is beneficial to a variety of downstream tasks such as few-shot classification and data generation , thanks to the interpretability of the disentangled factors . ( Higgins et al. , 2016 ) proposed β-VAE , an unsupervised method to learn the disentangled representations by modifying the weight of the KL-divergence term of the VAE ( Kingma & Welling , 2013 ; Rezende et al. , 2014 ) greater than one . Afterwards , while several variants ( Kim & Mnih , 2018 ; Chen et al. , 2018 ) improved the β-VAE by introducing a total correlation ( TC ) term , ( Locatello et al. , 2019a ) pointed out the inherent limitation of the purely unsupervised approaches and emphasized the need of an inductive bias . Recent works ( Locatello et al. , 2019b ; Shu et al. , 2019 ; Locatello et al. , 2020 ; Margonis et al. , 2020 ) proposed various forms of weak supervision to encourage the inductive bias to learn the disentangled representations . While there are various categories on the weak labels , we used them in terms of ones that 1 ) are roughly divided into fewer classes and 2 ) can be obtained with programming by using the knowledge on the factors without the need for manual labeling . 3 PRELIMINARIES . Consider a Markov decision process ( MDP ) ( S , A , P , r , ρ0 , γ ) , where S is a set of states , A is a set of action , P : S × A × S → R+ is a transition probability distribution , r : S × A→ R is a reward function , ρ0 : S → R+ is an initial state distribution and γ ∈ ( 0 , 1 ) is a discount factor . We denote a stochastic policy as π : S × A→ R+ . RL has a goal of maximizing the expected discounted sum of rewards for an episode horizon HE : η ( π ) = Eπ [ HE∑ t=0 γtr ( st , at ) ] ( 1 ) Variational autoencoder ( VAE ) optimizes variational the lower bound of the marginal likelihood of dataset . Given an observed datapoint x , the variational lowerbound is defined as : log pθ ( x ) ≥ L ( θ , φ ; x ) = Eqφ ( z |x ) [ log pθ ( x |z ) ] −DKL ( qφ ( z |x ) ‖p ( z ) ) , ( 2 ) where p ( z ) is a prior distribution of a latent variable z , the decoder pθ ( x |z ) is a generative model given a latent z parameterized by θ , and the encoder qφ ( z |x ) is an approximate posterior distribution parameterized by φ . In Equation 2 , the first term is the reconstruction term of the autoencoder , and the second term is the KL divergence regularization . In our work , we will focus on the aspect of the generative model of the decoder . 4 WEAKLY SUPERVISED LEARNING OF DISENTANGLED AND INTERPRETABLE SKILL ( WEDIS ) . Our framework consists of three stages ; 1 ) generating trajectory training data with factors of interest 2 ) training the WET-VAE model , whose decoder is used for the predictive model and 3 ) training a policy network to generate the similar trajectories with the predictive model conditioned on skills . The generation process of the trajectory dataset is explained in Appendix A.1.1 due to the lack of space . As a notation , we will use superscript for factors and subscript for time steps . The WEDIS algorithm is summarized in Figure 2 . 4.1 LEARNING DISENTANGLED AND INTERPRETABLE REPRESENTATIONS OF TRAJECTORY To learn the temporally extended behaviors , ( CoReyes et al. , 2018 ) proposed a trajectory VAE model consisting of the RNN architecture . The trajectory VAE learns latent representations of trajectories , which will be used as skills for a policy . However , this model , which learns the representations in the unsupervised manner , does not consider which factors of variation of a trajectory are embedded in the latent space . Thus , the factors that are often entangled make the interpretation of the representations difficult , exposing limitations in further applicability of the learned skills . To address this , we propose a weakly-supervised trajectory VAE ( WET-VAE ) model that leverages an inductive bias in the form of weak supervision ( Margonis et al. , 2020 ) to explicitly enforce the model to learn the disentangled representations consisting of desired factors , yielding interpretable skills . Consider a latent-variable generative model p ( τ |z ) to generate a trajectory τ given a latent variable z . We assume the fixed initial state s0 at the origin as when given other initial states we can obtain the next states with a linear translation based on the initial states such that p ( s|s0 , z ) = p ( s − s0|z ) . Considering M factors of interest to generate trajectories , the weak supervision can be provided by simply adding a set of M weak labels y = { y1 , ... , yM } to the generative model , where each label ym is one-hot encoded vector for each factor . The idea is that a latent representation z ∈ RM , which can generate the trajectories based on the M disentangled generative factors , should also be able to reconstruct the factors . Assuming that the trajectory and the factors that are represented as the multiple labels satisfy conditional independence with respect to a given z , the generative model is extended with the labels p ( τ , y |z ) = p ( τ |z ) p ( y1|z ) · · ·p ( yM |z ) . Then , the variational lower bound of the marginal joint distribution p ( τ , y ) can be formulated as follows : L ( θ , φ ; τ , y ) = Eqφ ( z |τ , y ) [ log pθ ( τ , y |z ) ] −DKL ( qφ ( z |τ , y ) ‖p ( z ) ) = Eqφ ( z |τ , y ) [ T∑ t=1 log pθ ( st |s1 : t−1 , z ) + M∑ m=1 log pθ ( y m |z ) ] −DKL ( qφ ( z |τ , y ) ‖p ( z ) ) , ( 3 ) where pθ ( τ |z ) = pθ ( s1|z ) pθ ( s2|s1 , z ) · · · pθ ( sT |s1 , s2 , ... , sT−1 , z ) . Since pθ ( ym |z ) can be understood as a classifier for each factor , the factors should be distinctly embedded in a latent representation z for high classification probability . As a result , this enforces a disentangled representation of the factors . Practically , the scales of the values of the log-likelihoods of the states and labels are different due to the difference in dimensionality . To fill the gap , we introduce a balancing weight γ inspired by ( Margonis et al. , 2020 ) . We also use a weight β > 1 to emphasize the KL divergence term for better disentanglement in the spirit of the β-VAE ( Higgins et al. , 2016 ) . Then , the final objective function becomes : L ( θ , φ ; τ , y , β , γ ) = Eqφ ( z |τ , y ) [ T∑ t=1 log pθ ( st |s1 : t−1 , z ) + γ · M∑ m=1 log pθ ( y m |z ) ] − β ·DKL ( qφ ( z |τ , y ) ‖p ( z ) ) ( 4 ) The WET-VAE model is trained to maximize Equation 4 . To handle the sequential data , we use the RNN architecture with LSTMs as in Figure 1 . With the support of the weak supervision , this model can learn the disentangled representations of trajectories that consist of factors of variation contributing over different time steps .
The paper proposes a method that learns disentangled skill representations, and shows qualitative & quantitative results on Mujoco Ant navigation. (1) They first synthetically generate a trajectory dataset by the combination of different factors. (2) They train a trajectory VAE (Co-Reyes ‘18) that enforces the learned trajectory representations to be disentangled using weak labels (Margonis ‘20). (3) Then, keeping the pre-trained trajectory VAE fixed, they learn a skill-based policy to generate similar trajectories to the learned decoder of the trajectory VAE by minimizing the KL divergence between the trajectory distributions.
SP:049a08148746e9024f00db4e5b05154208f6b80b
Weakly-Supervised Learning of Disentangled and Interpretable Skills for Hierarchical Reinforcement Learning
1 INTRODUCTION . Deep reinforcement learning ( RL ) has achieved great success for various applications , ranging from playing games ( Mnih et al. , 2013 ; Silver et al. , 2016 ) to complex locomotion and robots control ( Lillicrap et al. , 2015 ; Schulman et al. , 2015 ; 2017 ; Haarnoja et al. , 2017 ) . However , several challenges such as sparse rewards or inadaptability to unlearned tasks still hinder its practical usages in real-world problems . To alleviate these challenges , hierarchical RL ( Sutton et al. , 1999 ; Dietterich , 2000 ) has been studied where an agent pre-learns reusable skills from prior experiences and hierarchically solve higher-level problems by combining the skills . Two issues need to be resolved for the successful deployment of the hierarchical RL ; how to learn useful skills and how to effectively make use of the skills for various downstream tasks . A possible approach for skills that can be applicable to various downstream tasks is to learn without task-specific rewards ( Eysenbach et al. , 2018 ) . Another way to achieve the useful skills is to make them predictable . To learn those skills , ( Co-Reyes et al. , 2018 ; Sharma et al. , 2019 ) proposed to combine model-free and model-based RL approaches , where a skill-based predictive model , a dynamics model over the latent space , is trained together with a skill-based policy network.By using the predictive model for model-based planning during testing time , these works showed to efficiently solve various downstream tasks without the need to learn additional higher-level policies . However , since they did not consider how the skill is embedded into the latent space , the factors consisting of the skill often are entangled when the skill is a continuous latent variable . Compared to the entangled one , the skill consisting of disentangled factors has several advantages in its applicability in that the factors can be separately interpreted and handled . In this paper , we introduce a novel WEakly-supervised learning approach for learning Disentangled and Interpretable Skills ( WEDIS ) from the continuous latent representations of trajectories that are composed of several generative factors , e.g. , speed , direction , and curvature . To this end , we propose a weakly-supervised trajectory variational autoencoder ( WET-VAE ) model that is an extension of the trajectory VAE ( Co-Reyes et al. , 2018 ) consisting of a recurrent neural network ( RNN ) . We leverage the weak labels ( Margonis et al. , 2020 ) to enforce an inductive bias on the model , which explicitly enforces the trajectory representations to be disentangled into factors of interest that we intend the model to learn . To train the WET-VAE , we first synthetically generate a trajectory dataset by the combination of several factors of interest , because the trajectories obtained by an online exploration are likely to contain meaningless samples such as random walks . With the trajectory dataset , the WET-VAE model is trained apart from a policy network . It is worthy of noting that while this is similar to imitation learning , our data acquisition is much simpler than collecting expert demonstration . Sequentially , we train a skill-based policy network with the WET-VAE fixed . Given the latent representations as skills , the skill-based policy network is trained to generate similar trajectories with the decoder of the WET-VAE by minimizing the KL divergence between two trajectory distributions . However , training a policy to generate a trajectory given a skill is difficult since it is unlikely to explore the corresponding trajectory in the training procedure . Instead , we propose to train the policy network with the single-step transitions and perform the trajectory-level behaviors in the test time , which can be achieved with the knowledge of the learned skills . This simplifies the training procedure of the policy , and also allows for a sample-efficient large-scale planning strategy with the scaled trajectories . In experiments in Mujoco Ant environment , we show that our disentangled and interpretable skills are effective in solving challenging sparse reward and long-horizon problems in 2D navigation in mazes . 2 RELATED WORKS . Numerous approaches ( Sutton et al. , 1999 ; Bacon et al. , 2017 ; Florensa et al. , 2017 ; Hausman et al. , 2018 ; Haarnoja et al. , 2018 ; Eysenbach et al. , 2018 ; Shankar et al. , 2019 ; Shankar & Gupta , 2020 ; Co-Reyes et al. , 2018 ; Sharma et al. , 2019 ) have explored on learning reusable skills in RL to solve challenging long-horizon or sparse reward problems . ( Sutton et al. , 1999 ) pioneered a way to control higher-level abstraction by introducing an option-framework , which learns low-level primitives in a top-down manner . ( Bacon et al. , 2017 ) proposed an option-critic architecture that learns sub-policies of options . Also , several works ( Florensa et al. , 2017 ; Hausman et al. , 2018 ; Haarnoja et al. , 2018 ) introduced to learn skills with multiple tasks in a bottom-up manner . However , designing reward functions still requires expert knowledge and such task-specific rewards may limit a generalization ability of the agent to the downstream tasks . To overcome this issue , recent works ( Eysenbach et al. , 2018 ; Achiam et al. , 2018 ; Co-Reyes et al. , 2018 ; Sharma et al. , 2019 ; Campos et al. , 2020 ) proposed an unsupervised framework that does not require a hand-specified reward function . Model-based RL methods ( Levine et al. , 2016 ; Nagabandi et al. , 2018 ; Chua et al. , 2018 ; Ha & Schmidhuber , 2018 ) aim to learn a dynamics model of the environment . While these works are capable of solving unlearned tasks without the needs of an additional learning via planning through the dynamics model , they are often at the risk of falling into over-fitting due to a huge capacity of the required data to explore the environment . Instead of learning the underlying dynamics , some methods ( Co-Reyes et al. , 2018 ; Sharma et al. , 2019 ) attempted to combine the model-free and model-based RL for learning a skill-based predictive model and a skill-based policy . Despite the improved results , they still suffer from the lack of the interpretability of the skills . Learning disentangled latent representations of factors of variation within dataset is beneficial to a variety of downstream tasks such as few-shot classification and data generation , thanks to the interpretability of the disentangled factors . ( Higgins et al. , 2016 ) proposed β-VAE , an unsupervised method to learn the disentangled representations by modifying the weight of the KL-divergence term of the VAE ( Kingma & Welling , 2013 ; Rezende et al. , 2014 ) greater than one . Afterwards , while several variants ( Kim & Mnih , 2018 ; Chen et al. , 2018 ) improved the β-VAE by introducing a total correlation ( TC ) term , ( Locatello et al. , 2019a ) pointed out the inherent limitation of the purely unsupervised approaches and emphasized the need of an inductive bias . Recent works ( Locatello et al. , 2019b ; Shu et al. , 2019 ; Locatello et al. , 2020 ; Margonis et al. , 2020 ) proposed various forms of weak supervision to encourage the inductive bias to learn the disentangled representations . While there are various categories on the weak labels , we used them in terms of ones that 1 ) are roughly divided into fewer classes and 2 ) can be obtained with programming by using the knowledge on the factors without the need for manual labeling . 3 PRELIMINARIES . Consider a Markov decision process ( MDP ) ( S , A , P , r , ρ0 , γ ) , where S is a set of states , A is a set of action , P : S × A × S → R+ is a transition probability distribution , r : S × A→ R is a reward function , ρ0 : S → R+ is an initial state distribution and γ ∈ ( 0 , 1 ) is a discount factor . We denote a stochastic policy as π : S × A→ R+ . RL has a goal of maximizing the expected discounted sum of rewards for an episode horizon HE : η ( π ) = Eπ [ HE∑ t=0 γtr ( st , at ) ] ( 1 ) Variational autoencoder ( VAE ) optimizes variational the lower bound of the marginal likelihood of dataset . Given an observed datapoint x , the variational lowerbound is defined as : log pθ ( x ) ≥ L ( θ , φ ; x ) = Eqφ ( z |x ) [ log pθ ( x |z ) ] −DKL ( qφ ( z |x ) ‖p ( z ) ) , ( 2 ) where p ( z ) is a prior distribution of a latent variable z , the decoder pθ ( x |z ) is a generative model given a latent z parameterized by θ , and the encoder qφ ( z |x ) is an approximate posterior distribution parameterized by φ . In Equation 2 , the first term is the reconstruction term of the autoencoder , and the second term is the KL divergence regularization . In our work , we will focus on the aspect of the generative model of the decoder . 4 WEAKLY SUPERVISED LEARNING OF DISENTANGLED AND INTERPRETABLE SKILL ( WEDIS ) . Our framework consists of three stages ; 1 ) generating trajectory training data with factors of interest 2 ) training the WET-VAE model , whose decoder is used for the predictive model and 3 ) training a policy network to generate the similar trajectories with the predictive model conditioned on skills . The generation process of the trajectory dataset is explained in Appendix A.1.1 due to the lack of space . As a notation , we will use superscript for factors and subscript for time steps . The WEDIS algorithm is summarized in Figure 2 . 4.1 LEARNING DISENTANGLED AND INTERPRETABLE REPRESENTATIONS OF TRAJECTORY To learn the temporally extended behaviors , ( CoReyes et al. , 2018 ) proposed a trajectory VAE model consisting of the RNN architecture . The trajectory VAE learns latent representations of trajectories , which will be used as skills for a policy . However , this model , which learns the representations in the unsupervised manner , does not consider which factors of variation of a trajectory are embedded in the latent space . Thus , the factors that are often entangled make the interpretation of the representations difficult , exposing limitations in further applicability of the learned skills . To address this , we propose a weakly-supervised trajectory VAE ( WET-VAE ) model that leverages an inductive bias in the form of weak supervision ( Margonis et al. , 2020 ) to explicitly enforce the model to learn the disentangled representations consisting of desired factors , yielding interpretable skills . Consider a latent-variable generative model p ( τ |z ) to generate a trajectory τ given a latent variable z . We assume the fixed initial state s0 at the origin as when given other initial states we can obtain the next states with a linear translation based on the initial states such that p ( s|s0 , z ) = p ( s − s0|z ) . Considering M factors of interest to generate trajectories , the weak supervision can be provided by simply adding a set of M weak labels y = { y1 , ... , yM } to the generative model , where each label ym is one-hot encoded vector for each factor . The idea is that a latent representation z ∈ RM , which can generate the trajectories based on the M disentangled generative factors , should also be able to reconstruct the factors . Assuming that the trajectory and the factors that are represented as the multiple labels satisfy conditional independence with respect to a given z , the generative model is extended with the labels p ( τ , y |z ) = p ( τ |z ) p ( y1|z ) · · ·p ( yM |z ) . Then , the variational lower bound of the marginal joint distribution p ( τ , y ) can be formulated as follows : L ( θ , φ ; τ , y ) = Eqφ ( z |τ , y ) [ log pθ ( τ , y |z ) ] −DKL ( qφ ( z |τ , y ) ‖p ( z ) ) = Eqφ ( z |τ , y ) [ T∑ t=1 log pθ ( st |s1 : t−1 , z ) + M∑ m=1 log pθ ( y m |z ) ] −DKL ( qφ ( z |τ , y ) ‖p ( z ) ) , ( 3 ) where pθ ( τ |z ) = pθ ( s1|z ) pθ ( s2|s1 , z ) · · · pθ ( sT |s1 , s2 , ... , sT−1 , z ) . Since pθ ( ym |z ) can be understood as a classifier for each factor , the factors should be distinctly embedded in a latent representation z for high classification probability . As a result , this enforces a disentangled representation of the factors . Practically , the scales of the values of the log-likelihoods of the states and labels are different due to the difference in dimensionality . To fill the gap , we introduce a balancing weight γ inspired by ( Margonis et al. , 2020 ) . We also use a weight β > 1 to emphasize the KL divergence term for better disentanglement in the spirit of the β-VAE ( Higgins et al. , 2016 ) . Then , the final objective function becomes : L ( θ , φ ; τ , y , β , γ ) = Eqφ ( z |τ , y ) [ T∑ t=1 log pθ ( st |s1 : t−1 , z ) + γ · M∑ m=1 log pθ ( y m |z ) ] − β ·DKL ( qφ ( z |τ , y ) ‖p ( z ) ) ( 4 ) The WET-VAE model is trained to maximize Equation 4 . To handle the sequential data , we use the RNN architecture with LSTMs as in Figure 1 . With the support of the weak supervision , this model can learn the disentangled representations of trajectories that consist of factors of variation contributing over different time steps .
The paper at hand proposes a new framework for pre-training skill policies (WEDIS), and use them for control in a hierarchical setup with MPC. The main idea is that skill policies should follow a set of generated trajectories based on some salient factors. For this, the authors train a VAE that will then provide both the control variables (latent encoding) and a predictive model of the trajectory (decoder). The skill policy is trained to match the trajectories of the predictive model, and the predictive model is then used for MPC.
SP:049a08148746e9024f00db4e5b05154208f6b80b
Weakly-Supervised Learning of Disentangled and Interpretable Skills for Hierarchical Reinforcement Learning
1 INTRODUCTION . Deep reinforcement learning ( RL ) has achieved great success for various applications , ranging from playing games ( Mnih et al. , 2013 ; Silver et al. , 2016 ) to complex locomotion and robots control ( Lillicrap et al. , 2015 ; Schulman et al. , 2015 ; 2017 ; Haarnoja et al. , 2017 ) . However , several challenges such as sparse rewards or inadaptability to unlearned tasks still hinder its practical usages in real-world problems . To alleviate these challenges , hierarchical RL ( Sutton et al. , 1999 ; Dietterich , 2000 ) has been studied where an agent pre-learns reusable skills from prior experiences and hierarchically solve higher-level problems by combining the skills . Two issues need to be resolved for the successful deployment of the hierarchical RL ; how to learn useful skills and how to effectively make use of the skills for various downstream tasks . A possible approach for skills that can be applicable to various downstream tasks is to learn without task-specific rewards ( Eysenbach et al. , 2018 ) . Another way to achieve the useful skills is to make them predictable . To learn those skills , ( Co-Reyes et al. , 2018 ; Sharma et al. , 2019 ) proposed to combine model-free and model-based RL approaches , where a skill-based predictive model , a dynamics model over the latent space , is trained together with a skill-based policy network.By using the predictive model for model-based planning during testing time , these works showed to efficiently solve various downstream tasks without the need to learn additional higher-level policies . However , since they did not consider how the skill is embedded into the latent space , the factors consisting of the skill often are entangled when the skill is a continuous latent variable . Compared to the entangled one , the skill consisting of disentangled factors has several advantages in its applicability in that the factors can be separately interpreted and handled . In this paper , we introduce a novel WEakly-supervised learning approach for learning Disentangled and Interpretable Skills ( WEDIS ) from the continuous latent representations of trajectories that are composed of several generative factors , e.g. , speed , direction , and curvature . To this end , we propose a weakly-supervised trajectory variational autoencoder ( WET-VAE ) model that is an extension of the trajectory VAE ( Co-Reyes et al. , 2018 ) consisting of a recurrent neural network ( RNN ) . We leverage the weak labels ( Margonis et al. , 2020 ) to enforce an inductive bias on the model , which explicitly enforces the trajectory representations to be disentangled into factors of interest that we intend the model to learn . To train the WET-VAE , we first synthetically generate a trajectory dataset by the combination of several factors of interest , because the trajectories obtained by an online exploration are likely to contain meaningless samples such as random walks . With the trajectory dataset , the WET-VAE model is trained apart from a policy network . It is worthy of noting that while this is similar to imitation learning , our data acquisition is much simpler than collecting expert demonstration . Sequentially , we train a skill-based policy network with the WET-VAE fixed . Given the latent representations as skills , the skill-based policy network is trained to generate similar trajectories with the decoder of the WET-VAE by minimizing the KL divergence between two trajectory distributions . However , training a policy to generate a trajectory given a skill is difficult since it is unlikely to explore the corresponding trajectory in the training procedure . Instead , we propose to train the policy network with the single-step transitions and perform the trajectory-level behaviors in the test time , which can be achieved with the knowledge of the learned skills . This simplifies the training procedure of the policy , and also allows for a sample-efficient large-scale planning strategy with the scaled trajectories . In experiments in Mujoco Ant environment , we show that our disentangled and interpretable skills are effective in solving challenging sparse reward and long-horizon problems in 2D navigation in mazes . 2 RELATED WORKS . Numerous approaches ( Sutton et al. , 1999 ; Bacon et al. , 2017 ; Florensa et al. , 2017 ; Hausman et al. , 2018 ; Haarnoja et al. , 2018 ; Eysenbach et al. , 2018 ; Shankar et al. , 2019 ; Shankar & Gupta , 2020 ; Co-Reyes et al. , 2018 ; Sharma et al. , 2019 ) have explored on learning reusable skills in RL to solve challenging long-horizon or sparse reward problems . ( Sutton et al. , 1999 ) pioneered a way to control higher-level abstraction by introducing an option-framework , which learns low-level primitives in a top-down manner . ( Bacon et al. , 2017 ) proposed an option-critic architecture that learns sub-policies of options . Also , several works ( Florensa et al. , 2017 ; Hausman et al. , 2018 ; Haarnoja et al. , 2018 ) introduced to learn skills with multiple tasks in a bottom-up manner . However , designing reward functions still requires expert knowledge and such task-specific rewards may limit a generalization ability of the agent to the downstream tasks . To overcome this issue , recent works ( Eysenbach et al. , 2018 ; Achiam et al. , 2018 ; Co-Reyes et al. , 2018 ; Sharma et al. , 2019 ; Campos et al. , 2020 ) proposed an unsupervised framework that does not require a hand-specified reward function . Model-based RL methods ( Levine et al. , 2016 ; Nagabandi et al. , 2018 ; Chua et al. , 2018 ; Ha & Schmidhuber , 2018 ) aim to learn a dynamics model of the environment . While these works are capable of solving unlearned tasks without the needs of an additional learning via planning through the dynamics model , they are often at the risk of falling into over-fitting due to a huge capacity of the required data to explore the environment . Instead of learning the underlying dynamics , some methods ( Co-Reyes et al. , 2018 ; Sharma et al. , 2019 ) attempted to combine the model-free and model-based RL for learning a skill-based predictive model and a skill-based policy . Despite the improved results , they still suffer from the lack of the interpretability of the skills . Learning disentangled latent representations of factors of variation within dataset is beneficial to a variety of downstream tasks such as few-shot classification and data generation , thanks to the interpretability of the disentangled factors . ( Higgins et al. , 2016 ) proposed β-VAE , an unsupervised method to learn the disentangled representations by modifying the weight of the KL-divergence term of the VAE ( Kingma & Welling , 2013 ; Rezende et al. , 2014 ) greater than one . Afterwards , while several variants ( Kim & Mnih , 2018 ; Chen et al. , 2018 ) improved the β-VAE by introducing a total correlation ( TC ) term , ( Locatello et al. , 2019a ) pointed out the inherent limitation of the purely unsupervised approaches and emphasized the need of an inductive bias . Recent works ( Locatello et al. , 2019b ; Shu et al. , 2019 ; Locatello et al. , 2020 ; Margonis et al. , 2020 ) proposed various forms of weak supervision to encourage the inductive bias to learn the disentangled representations . While there are various categories on the weak labels , we used them in terms of ones that 1 ) are roughly divided into fewer classes and 2 ) can be obtained with programming by using the knowledge on the factors without the need for manual labeling . 3 PRELIMINARIES . Consider a Markov decision process ( MDP ) ( S , A , P , r , ρ0 , γ ) , where S is a set of states , A is a set of action , P : S × A × S → R+ is a transition probability distribution , r : S × A→ R is a reward function , ρ0 : S → R+ is an initial state distribution and γ ∈ ( 0 , 1 ) is a discount factor . We denote a stochastic policy as π : S × A→ R+ . RL has a goal of maximizing the expected discounted sum of rewards for an episode horizon HE : η ( π ) = Eπ [ HE∑ t=0 γtr ( st , at ) ] ( 1 ) Variational autoencoder ( VAE ) optimizes variational the lower bound of the marginal likelihood of dataset . Given an observed datapoint x , the variational lowerbound is defined as : log pθ ( x ) ≥ L ( θ , φ ; x ) = Eqφ ( z |x ) [ log pθ ( x |z ) ] −DKL ( qφ ( z |x ) ‖p ( z ) ) , ( 2 ) where p ( z ) is a prior distribution of a latent variable z , the decoder pθ ( x |z ) is a generative model given a latent z parameterized by θ , and the encoder qφ ( z |x ) is an approximate posterior distribution parameterized by φ . In Equation 2 , the first term is the reconstruction term of the autoencoder , and the second term is the KL divergence regularization . In our work , we will focus on the aspect of the generative model of the decoder . 4 WEAKLY SUPERVISED LEARNING OF DISENTANGLED AND INTERPRETABLE SKILL ( WEDIS ) . Our framework consists of three stages ; 1 ) generating trajectory training data with factors of interest 2 ) training the WET-VAE model , whose decoder is used for the predictive model and 3 ) training a policy network to generate the similar trajectories with the predictive model conditioned on skills . The generation process of the trajectory dataset is explained in Appendix A.1.1 due to the lack of space . As a notation , we will use superscript for factors and subscript for time steps . The WEDIS algorithm is summarized in Figure 2 . 4.1 LEARNING DISENTANGLED AND INTERPRETABLE REPRESENTATIONS OF TRAJECTORY To learn the temporally extended behaviors , ( CoReyes et al. , 2018 ) proposed a trajectory VAE model consisting of the RNN architecture . The trajectory VAE learns latent representations of trajectories , which will be used as skills for a policy . However , this model , which learns the representations in the unsupervised manner , does not consider which factors of variation of a trajectory are embedded in the latent space . Thus , the factors that are often entangled make the interpretation of the representations difficult , exposing limitations in further applicability of the learned skills . To address this , we propose a weakly-supervised trajectory VAE ( WET-VAE ) model that leverages an inductive bias in the form of weak supervision ( Margonis et al. , 2020 ) to explicitly enforce the model to learn the disentangled representations consisting of desired factors , yielding interpretable skills . Consider a latent-variable generative model p ( τ |z ) to generate a trajectory τ given a latent variable z . We assume the fixed initial state s0 at the origin as when given other initial states we can obtain the next states with a linear translation based on the initial states such that p ( s|s0 , z ) = p ( s − s0|z ) . Considering M factors of interest to generate trajectories , the weak supervision can be provided by simply adding a set of M weak labels y = { y1 , ... , yM } to the generative model , where each label ym is one-hot encoded vector for each factor . The idea is that a latent representation z ∈ RM , which can generate the trajectories based on the M disentangled generative factors , should also be able to reconstruct the factors . Assuming that the trajectory and the factors that are represented as the multiple labels satisfy conditional independence with respect to a given z , the generative model is extended with the labels p ( τ , y |z ) = p ( τ |z ) p ( y1|z ) · · ·p ( yM |z ) . Then , the variational lower bound of the marginal joint distribution p ( τ , y ) can be formulated as follows : L ( θ , φ ; τ , y ) = Eqφ ( z |τ , y ) [ log pθ ( τ , y |z ) ] −DKL ( qφ ( z |τ , y ) ‖p ( z ) ) = Eqφ ( z |τ , y ) [ T∑ t=1 log pθ ( st |s1 : t−1 , z ) + M∑ m=1 log pθ ( y m |z ) ] −DKL ( qφ ( z |τ , y ) ‖p ( z ) ) , ( 3 ) where pθ ( τ |z ) = pθ ( s1|z ) pθ ( s2|s1 , z ) · · · pθ ( sT |s1 , s2 , ... , sT−1 , z ) . Since pθ ( ym |z ) can be understood as a classifier for each factor , the factors should be distinctly embedded in a latent representation z for high classification probability . As a result , this enforces a disentangled representation of the factors . Practically , the scales of the values of the log-likelihoods of the states and labels are different due to the difference in dimensionality . To fill the gap , we introduce a balancing weight γ inspired by ( Margonis et al. , 2020 ) . We also use a weight β > 1 to emphasize the KL divergence term for better disentanglement in the spirit of the β-VAE ( Higgins et al. , 2016 ) . Then , the final objective function becomes : L ( θ , φ ; τ , y , β , γ ) = Eqφ ( z |τ , y ) [ T∑ t=1 log pθ ( st |s1 : t−1 , z ) + γ · M∑ m=1 log pθ ( y m |z ) ] − β ·DKL ( qφ ( z |τ , y ) ‖p ( z ) ) ( 4 ) The WET-VAE model is trained to maximize Equation 4 . To handle the sequential data , we use the RNN architecture with LSTMs as in Figure 1 . With the support of the weak supervision , this model can learn the disentangled representations of trajectories that consist of factors of variation contributing over different time steps .
This work proposes to learn representations of artificially generated trajectories using a VAE-based approach that relies on weak labels to improve disentanglement. Then, a skill-based policy (i.e. a policy conditioned on the learned sequence representation) is trained to imitate the learned model via soft actor-critic. Moreover, the paper introduces a hierarchical planning strategy that explores at the “aggregated sequence level”, i.e. the representation space, and allows for “trajectory rescaling”. The authors show empirically both the disentanglement of WET-VAE and the advantage of their hierarchical approach.
SP:049a08148746e9024f00db4e5b05154208f6b80b
Implicit Regularization of Bregman Proximal Point Algorithm and Mirror Descent on Separable Data
1 INTRODUCTION . The role of optimization algorithms has become arguably one of the most critical factors in the empirical successes of training deep models . As the go-to choice for modern machine learning , first-order algorithms , including ( stochastic ) gradient descent and their adaptive counterparts ( Kingma and Ba , 2014 ; Duchi et al. , 2011 ) , have received tremendous attention , with detailed investigations dedicated to understanding the effect of batch size ( Goyal et al. , 2017 ; Smith et al. , 2018 ; Keskar et al. , 2016 ) , learning rate ( Li et al. , 2019 ; He et al. , 2019 ; Lewkowycz et al. , 2020 ) , and momentum ( Sutskever et al. , 2013 ; Smith , 2018 ) across a broad spectrum of applications . Meanwhile , Bregman proximal point algorithm ( Eckstein , 1993 ; Kiwiel , 1997 ) has been drawing substantial interests . The resounding successes of this classical algorithm are particularly evident for applications including knowledge distillation ( Furlanello et al. , 2018 ) , mean-teacher learning paradigm ( Tarvainen and Valpola , 2017 ) , few-shot learning ( Zhou et al. , 2019 ) , policy optimization ( Green et al. , 2019 ) , and fine-tuning pre-trained models ( Jiang et al. , 2020 ) , yielding competitive performance compared to its first-order counterparts . In the general form , Bregman proximal point algorithm updates parameters by minimizing a loss L ( · ) , while regularizing the weighted distance to the previous iterate measured by some divergence function D ( · , · ) , θt+1 = argminθ L ( θ ) + 1/ ( 2ηt ) D ( θ , θt ) . ( 1.1 ) Popular choices of divergence function used in practice include the squared ` 2-norm distance DLS ( θ , θt ) = ED ‖fθ ( x ) − fθt ( x ) ‖22 ( Tarvainen and Valpola , 2017 ) , and Kullback-Leibler based divergence DKL ( θ , θt ) = EDKL ( fθ′ ( x ) ‖fθ ( x ) ) ( Furlanello et al. , 2018 ) , where D denotes the data distribution . Such a simple update is of great practical purposes , as it is easy to describe , and admits simple implementation by adopting suitable off-the-shelf black-box optimization algorithms ( Solodov and Svaiter , 2000 ; Monteiro and Svaiter , 2010 ; Zaslavski , 2010 ) . The updating form also suggests plausible intuitions for its empirical successes , including iteratively constraining the search space , alleviating aggressive updates , and preventing catastrophic forgetting ( Schulman et al. , 2015 ; Li and Hoiem , 2017 ) . However , none of the intuitions have been rigorously justified , and theoretical understandings for the empirical successes of Bregman proximal point algorithm remains underexplored . A first , and a natural question is whether Bregman proximal point algorithm benefits from the same kind of mechanism that ( stochastic ) gradient descent ( GD/SGD ) enjoys for having the generalization properties . In particular , in many important applications , GD/SGD is widely believed as the “ the algorithm that finds the right kind of solutions ” for problems with non-unique solutions . Such a claim is supported with numerous provable examples : GD/SGD converges to the minimum-norm solution of under-determined linear systems ( Gunasekar et al. , 2018 ) , converges to the max-margin solution for separable data ( Soudry et al. , 2018 ; Nacson et al. , 2019 ) , aligns layers of deep linear networks ( Ji and Telgarsky , 2018 ) , and converges to a generalizable solution for nonlinear networks ( Brutzkus et al. , 2017 ; Allen-Zhu et al. , 2018 ) in the presence of infinitely many overfitting solutions . Given the emerging successes of Bregman proximal point algorithm , and the aforementioned evidences on its first-order counterparts ( e.g . GD/SGD ) finding generalizable solutions , one would naturally wonder Does Bregman proximal point algorithm converge to a solution with favorable qualities ? Another important question with great practical implications for Bregman proximal point algorithm is how the divergence measure D ( · , · ) affects the solution . Instead of directly applying the Euclidean distance based divergence , it is widely observed that the successful application of Bregman proximal point algorithm is contingent on the careful design of divergence measure , based on the task at hand ( Li and Hoiem , 2017 ; Hinton et al. , 2015 ) . Take the example of fine-tuning language model , the symmetrized Kullback-Leibler based divergence evaluated on the predictions of the updated model ( i.e. , θt+1 ) and previous model ( i.e. , θt ) yields the state-of-the-art result ( Jiang et al. , 2020 ) . Identifying the underlying mechanism for the success or failure of a given divergence choice is not only of theoretical interest , but also can significantly reduce human effort in searching/designing the suitable divergence for a given task . As an important addition , one may also ask whether the impact of divergence on the Bregman proximal point algorithm find natural counterparts in commonly adopted first-order algorithms ( e.g . mirror descent , ( Nemirovski and Yudin , 1983 ) ) . In such cases , better task-dependent algorithmic designs could be proposed in conjunction with the suitable divergence . To this end , we raise our second question . How does divergence affect the qualities of the solution obtained by Bregman proximal point algorithm ( and other first-order algorithms ) ? In this paper , we initiate our study to address our previously proposed questions . We focus on a non-trivial example of an under-determined system – training linear classifiers using separable data . In particular , for exponential tail losses ( e.g. , exponential loss ) , the empirical loss function has infimum zero that is asymptotically attainable at infinity along infinitely many directions . The natural candidate for measuring the quality of the obtained classifier is its margin , i.e. , the minimum distance between the samples and the decision hyperplane . For such a problem , we summarize our theoretical findings below as concrete answers to the previous questions . • We show that Bregman proximal point algorithm ( BPPA ) obtains a solution with non-trivial margin lower-bound . As a concrete demonstration , we tailor our main theorem for Mahalanobis distance , and show that BPPA converges in direction to the maximal margin solution . We provide nonasymptotic analyses of the margin and empirical loss for constant stepsize BPPA , and propose a more aggressive stepsize rule for a provable exponential speed-up . • We establish a dependence of such a margin lower-bound on the condition number of the distance generating function for defining the divergence . In addition , we provide a class of problems where the margin lower-bound is tight , demonstrating that the Bregman divergence is crucial in affecting the quality of the obtained solution . • We extend our findings to first-order algorithms . Specifically , we show that mirror descent ( MD ) enjoys the same previously mentioned margin properties . We also provide non-asymptotic convergence analyses of the margin and empirical loss for constant stepsize MD , and its exponential speed-up using a varying stepsize scheme . Our findings for MD strictly complement prior works on under-determined regression problems ( Gunasekar et al. , 2018 ; Azizan and Hassibi , 2019 ) . Notations . We denote [ n ] : = { 1 , . . . , n } ; sgn ( z ) = 1 if z ≥ 0 and −1 elsewhere . We use w.r.t in short for “ with respect to ” . For any ‖·‖ in Euclidean space Rd , we use ‖·‖∗ = max‖y‖≤1 〈· , y〉 to denote its dual norm . Note that we have ( ‖·‖∗ ) ∗ = ‖·‖ . 2 PROBLEM SETUP . We study the binary classification on linearly separable data . Specifically , the dataset is S = { ( xi , yi ) } ni=1 ⊂ Rd × { +1 , −1 } , where xi is the feature vector , and yi is the label . In addition , there exists a linear classifier u ∈ Rd such that yi 〈u , xi〉 > 0 for all i ∈ [ n ] . That is , the decision rule fu ( · ) = sgn ( 〈u , ·〉 ) achieves the perfect accuracy on the dataset , with yi = fu ( xi ) for all i ∈ [ n ] . For each linear classifier fu ( · ) with perfect accuracy , we define its ‖·‖∗-norm margin as the minimum distance in ‖·‖∗-norm from the feature vectors to the decision boundaryHu = { x : 〈x , u〉 = 0 } . It is well known that the ‖·‖∗-norm margin , denoted as γu , only depends on the direction of the classifier and satisfies γu = mini∈ [ n ] 〈 xiyi , u ‖u‖ 〉 , where ‖·‖ is the dual norm of ‖·‖∗ . The ‖·‖∗-norm margin measures how well the data is separated by decision rule fu ( · ) , measured in ‖·‖∗-norm , and is an important measure on the generalizability and robustness of the decision rule . Given a norm ‖·‖∗ on Rd , we define the optimal linear classifier with the maximum ‖·‖∗-margin below . Definition 2.1 ( Maximum ‖·‖∗-norm Margin Classifier ) . Given a linearly separable dataset { ( xi , yi ) } i∈ [ n ] , we define the maximum ‖·‖∗-norm margin classifier u‖·‖∗ , and its associated maximum ‖·‖∗-norm margin γ‖·‖∗ as u‖·‖∗ = argmax‖u‖≤1 min i∈ [ n ] 〈u , yixi〉 , γ‖·‖∗ = max‖u‖≤1 mini∈ [ n ] 〈u , yixi〉 . For a separable dataset , we consider finding the classifier by minimizing the empirical loss LS ( θ ) = 1n ∑n i=1 ` ( 〈θ , yixi〉 ) . ( 2.1 ) Here we focus on the exponential loss ` ( x ) = exp ( −x ) , and our analyses can be readily extended to other losses with tight exponential tail ( e.g. , logistic loss ) . Observation . One can readily verify that with a separable dataset S , the empirical loss has infimum 0 but possesses no finite solution that attains the infimum . Thus any optimization algorithm minimizing the loss LS ( · ) will observe the explosion on the norm of iterate . It has been shown that various optimization algorithms , including ( stochastic ) gradient descent and steepest descent , converge in direction to the maximum margin classifier in different norms ( Soudry et al. , 2018 ; Nacson et al. , 2019 ; Gunasekar et al. , 2018 ; Ji and Telgarsky , 2019 ; 2021 ) . Connections between gradient descent and the regularization path of homotopy method have also been established ( Ji et al. , 2020 ) . A striking feature behind such phenomena is that there is no explicit regularization in the loss function , and such effects have been termed as the implicit ( algorithmic ) regularization . Up to date , most of the implicit regularization effects are attributed to ( stochastic ) gradient descent , given their prevalence in applications . However , as Bregman proximal point algorithm ( BPPA ) becomes increasingly popular in various domains , there exists considerable lack of understanding on the computational properties of BPPA . In addition , practitioners often find the choice of divergence function crucially important for the performance of BPPA ( Jiang et al. , 2020 ; Furlanello et al. , 2018 ) . This empirical evidence thus calls for a detailed characterization on the connection between computational properties and the divergence function of BPPA . In what follows , we study the BPPA for solving problem ( 2.1 ) in detail . The BPPA ( Algorithm 1 ) is an adaptation of the vanilla proximal point algorithm ( Rockafellar , 1976a ; b ) to non-euclidean geometry , by using Bregman divergence as the divergence measure in ( 1.1 ) . Specifically , given a distance generating function w ( · ) that is convex and differentiable , we define the Bregman divergence Dw ( · , · ) associated with w ( · ) as Dw ( θ , θ′ ) = w ( θ ) −w ( θ′ ) − 〈∇w ( θ′ ) , θ − θ′〉 . Throughout our discussions , we only impose the following mild assumption on Bregman divergence function Dw ( · , · ) . Algorithm 1 Bregman Proximal Point Algorithm ( BPPA ) Input : Distance generating function w ( · ) , stepsizes { ηt } t≥0 , samples { xi , yi } ni=1 . Initialize : θ0 ← 0. for t = 0 , . . . do Update θt+1 = argmin θ LS ( θ ) + 1 2ηt Dw ( θ , θt ) . ( 2.2 ) end for Assumption 1 . We assume that the distance generating function of Bregman divergence Dw ( · , · ) is Lw-smooth and µw-strongly convex w.r.t . ‖·‖-norm . That is , µw 2 ‖θ − θ′‖2 ≤ w ( θ ) − w ( θ′ ) − 〈∇w ( θ′ ) , θ − θ′〉 ≤ Lw 2 ‖θ − θ′‖2 .
This article provides an analysis of Bregman PPA / mirror descent for classification. This work is largely motivated by the recent works on implicit regularisation (of gradient descent). Their theoretical results show how the recovered margins depend on the Bregman divergence used.
SP:dcf98b9e5610a1c12a6173269a8082fc1a7c2d1b
Implicit Regularization of Bregman Proximal Point Algorithm and Mirror Descent on Separable Data
1 INTRODUCTION . The role of optimization algorithms has become arguably one of the most critical factors in the empirical successes of training deep models . As the go-to choice for modern machine learning , first-order algorithms , including ( stochastic ) gradient descent and their adaptive counterparts ( Kingma and Ba , 2014 ; Duchi et al. , 2011 ) , have received tremendous attention , with detailed investigations dedicated to understanding the effect of batch size ( Goyal et al. , 2017 ; Smith et al. , 2018 ; Keskar et al. , 2016 ) , learning rate ( Li et al. , 2019 ; He et al. , 2019 ; Lewkowycz et al. , 2020 ) , and momentum ( Sutskever et al. , 2013 ; Smith , 2018 ) across a broad spectrum of applications . Meanwhile , Bregman proximal point algorithm ( Eckstein , 1993 ; Kiwiel , 1997 ) has been drawing substantial interests . The resounding successes of this classical algorithm are particularly evident for applications including knowledge distillation ( Furlanello et al. , 2018 ) , mean-teacher learning paradigm ( Tarvainen and Valpola , 2017 ) , few-shot learning ( Zhou et al. , 2019 ) , policy optimization ( Green et al. , 2019 ) , and fine-tuning pre-trained models ( Jiang et al. , 2020 ) , yielding competitive performance compared to its first-order counterparts . In the general form , Bregman proximal point algorithm updates parameters by minimizing a loss L ( · ) , while regularizing the weighted distance to the previous iterate measured by some divergence function D ( · , · ) , θt+1 = argminθ L ( θ ) + 1/ ( 2ηt ) D ( θ , θt ) . ( 1.1 ) Popular choices of divergence function used in practice include the squared ` 2-norm distance DLS ( θ , θt ) = ED ‖fθ ( x ) − fθt ( x ) ‖22 ( Tarvainen and Valpola , 2017 ) , and Kullback-Leibler based divergence DKL ( θ , θt ) = EDKL ( fθ′ ( x ) ‖fθ ( x ) ) ( Furlanello et al. , 2018 ) , where D denotes the data distribution . Such a simple update is of great practical purposes , as it is easy to describe , and admits simple implementation by adopting suitable off-the-shelf black-box optimization algorithms ( Solodov and Svaiter , 2000 ; Monteiro and Svaiter , 2010 ; Zaslavski , 2010 ) . The updating form also suggests plausible intuitions for its empirical successes , including iteratively constraining the search space , alleviating aggressive updates , and preventing catastrophic forgetting ( Schulman et al. , 2015 ; Li and Hoiem , 2017 ) . However , none of the intuitions have been rigorously justified , and theoretical understandings for the empirical successes of Bregman proximal point algorithm remains underexplored . A first , and a natural question is whether Bregman proximal point algorithm benefits from the same kind of mechanism that ( stochastic ) gradient descent ( GD/SGD ) enjoys for having the generalization properties . In particular , in many important applications , GD/SGD is widely believed as the “ the algorithm that finds the right kind of solutions ” for problems with non-unique solutions . Such a claim is supported with numerous provable examples : GD/SGD converges to the minimum-norm solution of under-determined linear systems ( Gunasekar et al. , 2018 ) , converges to the max-margin solution for separable data ( Soudry et al. , 2018 ; Nacson et al. , 2019 ) , aligns layers of deep linear networks ( Ji and Telgarsky , 2018 ) , and converges to a generalizable solution for nonlinear networks ( Brutzkus et al. , 2017 ; Allen-Zhu et al. , 2018 ) in the presence of infinitely many overfitting solutions . Given the emerging successes of Bregman proximal point algorithm , and the aforementioned evidences on its first-order counterparts ( e.g . GD/SGD ) finding generalizable solutions , one would naturally wonder Does Bregman proximal point algorithm converge to a solution with favorable qualities ? Another important question with great practical implications for Bregman proximal point algorithm is how the divergence measure D ( · , · ) affects the solution . Instead of directly applying the Euclidean distance based divergence , it is widely observed that the successful application of Bregman proximal point algorithm is contingent on the careful design of divergence measure , based on the task at hand ( Li and Hoiem , 2017 ; Hinton et al. , 2015 ) . Take the example of fine-tuning language model , the symmetrized Kullback-Leibler based divergence evaluated on the predictions of the updated model ( i.e. , θt+1 ) and previous model ( i.e. , θt ) yields the state-of-the-art result ( Jiang et al. , 2020 ) . Identifying the underlying mechanism for the success or failure of a given divergence choice is not only of theoretical interest , but also can significantly reduce human effort in searching/designing the suitable divergence for a given task . As an important addition , one may also ask whether the impact of divergence on the Bregman proximal point algorithm find natural counterparts in commonly adopted first-order algorithms ( e.g . mirror descent , ( Nemirovski and Yudin , 1983 ) ) . In such cases , better task-dependent algorithmic designs could be proposed in conjunction with the suitable divergence . To this end , we raise our second question . How does divergence affect the qualities of the solution obtained by Bregman proximal point algorithm ( and other first-order algorithms ) ? In this paper , we initiate our study to address our previously proposed questions . We focus on a non-trivial example of an under-determined system – training linear classifiers using separable data . In particular , for exponential tail losses ( e.g. , exponential loss ) , the empirical loss function has infimum zero that is asymptotically attainable at infinity along infinitely many directions . The natural candidate for measuring the quality of the obtained classifier is its margin , i.e. , the minimum distance between the samples and the decision hyperplane . For such a problem , we summarize our theoretical findings below as concrete answers to the previous questions . • We show that Bregman proximal point algorithm ( BPPA ) obtains a solution with non-trivial margin lower-bound . As a concrete demonstration , we tailor our main theorem for Mahalanobis distance , and show that BPPA converges in direction to the maximal margin solution . We provide nonasymptotic analyses of the margin and empirical loss for constant stepsize BPPA , and propose a more aggressive stepsize rule for a provable exponential speed-up . • We establish a dependence of such a margin lower-bound on the condition number of the distance generating function for defining the divergence . In addition , we provide a class of problems where the margin lower-bound is tight , demonstrating that the Bregman divergence is crucial in affecting the quality of the obtained solution . • We extend our findings to first-order algorithms . Specifically , we show that mirror descent ( MD ) enjoys the same previously mentioned margin properties . We also provide non-asymptotic convergence analyses of the margin and empirical loss for constant stepsize MD , and its exponential speed-up using a varying stepsize scheme . Our findings for MD strictly complement prior works on under-determined regression problems ( Gunasekar et al. , 2018 ; Azizan and Hassibi , 2019 ) . Notations . We denote [ n ] : = { 1 , . . . , n } ; sgn ( z ) = 1 if z ≥ 0 and −1 elsewhere . We use w.r.t in short for “ with respect to ” . For any ‖·‖ in Euclidean space Rd , we use ‖·‖∗ = max‖y‖≤1 〈· , y〉 to denote its dual norm . Note that we have ( ‖·‖∗ ) ∗ = ‖·‖ . 2 PROBLEM SETUP . We study the binary classification on linearly separable data . Specifically , the dataset is S = { ( xi , yi ) } ni=1 ⊂ Rd × { +1 , −1 } , where xi is the feature vector , and yi is the label . In addition , there exists a linear classifier u ∈ Rd such that yi 〈u , xi〉 > 0 for all i ∈ [ n ] . That is , the decision rule fu ( · ) = sgn ( 〈u , ·〉 ) achieves the perfect accuracy on the dataset , with yi = fu ( xi ) for all i ∈ [ n ] . For each linear classifier fu ( · ) with perfect accuracy , we define its ‖·‖∗-norm margin as the minimum distance in ‖·‖∗-norm from the feature vectors to the decision boundaryHu = { x : 〈x , u〉 = 0 } . It is well known that the ‖·‖∗-norm margin , denoted as γu , only depends on the direction of the classifier and satisfies γu = mini∈ [ n ] 〈 xiyi , u ‖u‖ 〉 , where ‖·‖ is the dual norm of ‖·‖∗ . The ‖·‖∗-norm margin measures how well the data is separated by decision rule fu ( · ) , measured in ‖·‖∗-norm , and is an important measure on the generalizability and robustness of the decision rule . Given a norm ‖·‖∗ on Rd , we define the optimal linear classifier with the maximum ‖·‖∗-margin below . Definition 2.1 ( Maximum ‖·‖∗-norm Margin Classifier ) . Given a linearly separable dataset { ( xi , yi ) } i∈ [ n ] , we define the maximum ‖·‖∗-norm margin classifier u‖·‖∗ , and its associated maximum ‖·‖∗-norm margin γ‖·‖∗ as u‖·‖∗ = argmax‖u‖≤1 min i∈ [ n ] 〈u , yixi〉 , γ‖·‖∗ = max‖u‖≤1 mini∈ [ n ] 〈u , yixi〉 . For a separable dataset , we consider finding the classifier by minimizing the empirical loss LS ( θ ) = 1n ∑n i=1 ` ( 〈θ , yixi〉 ) . ( 2.1 ) Here we focus on the exponential loss ` ( x ) = exp ( −x ) , and our analyses can be readily extended to other losses with tight exponential tail ( e.g. , logistic loss ) . Observation . One can readily verify that with a separable dataset S , the empirical loss has infimum 0 but possesses no finite solution that attains the infimum . Thus any optimization algorithm minimizing the loss LS ( · ) will observe the explosion on the norm of iterate . It has been shown that various optimization algorithms , including ( stochastic ) gradient descent and steepest descent , converge in direction to the maximum margin classifier in different norms ( Soudry et al. , 2018 ; Nacson et al. , 2019 ; Gunasekar et al. , 2018 ; Ji and Telgarsky , 2019 ; 2021 ) . Connections between gradient descent and the regularization path of homotopy method have also been established ( Ji et al. , 2020 ) . A striking feature behind such phenomena is that there is no explicit regularization in the loss function , and such effects have been termed as the implicit ( algorithmic ) regularization . Up to date , most of the implicit regularization effects are attributed to ( stochastic ) gradient descent , given their prevalence in applications . However , as Bregman proximal point algorithm ( BPPA ) becomes increasingly popular in various domains , there exists considerable lack of understanding on the computational properties of BPPA . In addition , practitioners often find the choice of divergence function crucially important for the performance of BPPA ( Jiang et al. , 2020 ; Furlanello et al. , 2018 ) . This empirical evidence thus calls for a detailed characterization on the connection between computational properties and the divergence function of BPPA . In what follows , we study the BPPA for solving problem ( 2.1 ) in detail . The BPPA ( Algorithm 1 ) is an adaptation of the vanilla proximal point algorithm ( Rockafellar , 1976a ; b ) to non-euclidean geometry , by using Bregman divergence as the divergence measure in ( 1.1 ) . Specifically , given a distance generating function w ( · ) that is convex and differentiable , we define the Bregman divergence Dw ( · , · ) associated with w ( · ) as Dw ( θ , θ′ ) = w ( θ ) −w ( θ′ ) − 〈∇w ( θ′ ) , θ − θ′〉 . Throughout our discussions , we only impose the following mild assumption on Bregman divergence function Dw ( · , · ) . Algorithm 1 Bregman Proximal Point Algorithm ( BPPA ) Input : Distance generating function w ( · ) , stepsizes { ηt } t≥0 , samples { xi , yi } ni=1 . Initialize : θ0 ← 0. for t = 0 , . . . do Update θt+1 = argmin θ LS ( θ ) + 1 2ηt Dw ( θ , θt ) . ( 2.2 ) end for Assumption 1 . We assume that the distance generating function of Bregman divergence Dw ( · , · ) is Lw-smooth and µw-strongly convex w.r.t . ‖·‖-norm . That is , µw 2 ‖θ − θ′‖2 ≤ w ( θ ) − w ( θ′ ) − 〈∇w ( θ′ ) , θ − θ′〉 ≤ Lw 2 ‖θ − θ′‖2 .
This work studies the use of Bregman Proximal Point Algorithm(BPPA) on training linear classifiers using seperable data. The paper focuses on theoretical findings of the following form a) BPPA obtains a solution with non-trivial margin lower bound. For the mahalanobis distance, they show that the solution is a max-margin solution. They also show non-asymptotic analysis for constant step size and speed it up to exponential step size using a stepsize selection. b) Show that the max-margin lower bound is dependent on the condition number of generating function for defining the divergence. As a result suggest that the divergence should be chosen based on the underlying space on which the data resides. c) It shows that that above results also extend to the dual first order algorithms such as mirror descent.
SP:dcf98b9e5610a1c12a6173269a8082fc1a7c2d1b
Implicit Regularization of Bregman Proximal Point Algorithm and Mirror Descent on Separable Data
1 INTRODUCTION . The role of optimization algorithms has become arguably one of the most critical factors in the empirical successes of training deep models . As the go-to choice for modern machine learning , first-order algorithms , including ( stochastic ) gradient descent and their adaptive counterparts ( Kingma and Ba , 2014 ; Duchi et al. , 2011 ) , have received tremendous attention , with detailed investigations dedicated to understanding the effect of batch size ( Goyal et al. , 2017 ; Smith et al. , 2018 ; Keskar et al. , 2016 ) , learning rate ( Li et al. , 2019 ; He et al. , 2019 ; Lewkowycz et al. , 2020 ) , and momentum ( Sutskever et al. , 2013 ; Smith , 2018 ) across a broad spectrum of applications . Meanwhile , Bregman proximal point algorithm ( Eckstein , 1993 ; Kiwiel , 1997 ) has been drawing substantial interests . The resounding successes of this classical algorithm are particularly evident for applications including knowledge distillation ( Furlanello et al. , 2018 ) , mean-teacher learning paradigm ( Tarvainen and Valpola , 2017 ) , few-shot learning ( Zhou et al. , 2019 ) , policy optimization ( Green et al. , 2019 ) , and fine-tuning pre-trained models ( Jiang et al. , 2020 ) , yielding competitive performance compared to its first-order counterparts . In the general form , Bregman proximal point algorithm updates parameters by minimizing a loss L ( · ) , while regularizing the weighted distance to the previous iterate measured by some divergence function D ( · , · ) , θt+1 = argminθ L ( θ ) + 1/ ( 2ηt ) D ( θ , θt ) . ( 1.1 ) Popular choices of divergence function used in practice include the squared ` 2-norm distance DLS ( θ , θt ) = ED ‖fθ ( x ) − fθt ( x ) ‖22 ( Tarvainen and Valpola , 2017 ) , and Kullback-Leibler based divergence DKL ( θ , θt ) = EDKL ( fθ′ ( x ) ‖fθ ( x ) ) ( Furlanello et al. , 2018 ) , where D denotes the data distribution . Such a simple update is of great practical purposes , as it is easy to describe , and admits simple implementation by adopting suitable off-the-shelf black-box optimization algorithms ( Solodov and Svaiter , 2000 ; Monteiro and Svaiter , 2010 ; Zaslavski , 2010 ) . The updating form also suggests plausible intuitions for its empirical successes , including iteratively constraining the search space , alleviating aggressive updates , and preventing catastrophic forgetting ( Schulman et al. , 2015 ; Li and Hoiem , 2017 ) . However , none of the intuitions have been rigorously justified , and theoretical understandings for the empirical successes of Bregman proximal point algorithm remains underexplored . A first , and a natural question is whether Bregman proximal point algorithm benefits from the same kind of mechanism that ( stochastic ) gradient descent ( GD/SGD ) enjoys for having the generalization properties . In particular , in many important applications , GD/SGD is widely believed as the “ the algorithm that finds the right kind of solutions ” for problems with non-unique solutions . Such a claim is supported with numerous provable examples : GD/SGD converges to the minimum-norm solution of under-determined linear systems ( Gunasekar et al. , 2018 ) , converges to the max-margin solution for separable data ( Soudry et al. , 2018 ; Nacson et al. , 2019 ) , aligns layers of deep linear networks ( Ji and Telgarsky , 2018 ) , and converges to a generalizable solution for nonlinear networks ( Brutzkus et al. , 2017 ; Allen-Zhu et al. , 2018 ) in the presence of infinitely many overfitting solutions . Given the emerging successes of Bregman proximal point algorithm , and the aforementioned evidences on its first-order counterparts ( e.g . GD/SGD ) finding generalizable solutions , one would naturally wonder Does Bregman proximal point algorithm converge to a solution with favorable qualities ? Another important question with great practical implications for Bregman proximal point algorithm is how the divergence measure D ( · , · ) affects the solution . Instead of directly applying the Euclidean distance based divergence , it is widely observed that the successful application of Bregman proximal point algorithm is contingent on the careful design of divergence measure , based on the task at hand ( Li and Hoiem , 2017 ; Hinton et al. , 2015 ) . Take the example of fine-tuning language model , the symmetrized Kullback-Leibler based divergence evaluated on the predictions of the updated model ( i.e. , θt+1 ) and previous model ( i.e. , θt ) yields the state-of-the-art result ( Jiang et al. , 2020 ) . Identifying the underlying mechanism for the success or failure of a given divergence choice is not only of theoretical interest , but also can significantly reduce human effort in searching/designing the suitable divergence for a given task . As an important addition , one may also ask whether the impact of divergence on the Bregman proximal point algorithm find natural counterparts in commonly adopted first-order algorithms ( e.g . mirror descent , ( Nemirovski and Yudin , 1983 ) ) . In such cases , better task-dependent algorithmic designs could be proposed in conjunction with the suitable divergence . To this end , we raise our second question . How does divergence affect the qualities of the solution obtained by Bregman proximal point algorithm ( and other first-order algorithms ) ? In this paper , we initiate our study to address our previously proposed questions . We focus on a non-trivial example of an under-determined system – training linear classifiers using separable data . In particular , for exponential tail losses ( e.g. , exponential loss ) , the empirical loss function has infimum zero that is asymptotically attainable at infinity along infinitely many directions . The natural candidate for measuring the quality of the obtained classifier is its margin , i.e. , the minimum distance between the samples and the decision hyperplane . For such a problem , we summarize our theoretical findings below as concrete answers to the previous questions . • We show that Bregman proximal point algorithm ( BPPA ) obtains a solution with non-trivial margin lower-bound . As a concrete demonstration , we tailor our main theorem for Mahalanobis distance , and show that BPPA converges in direction to the maximal margin solution . We provide nonasymptotic analyses of the margin and empirical loss for constant stepsize BPPA , and propose a more aggressive stepsize rule for a provable exponential speed-up . • We establish a dependence of such a margin lower-bound on the condition number of the distance generating function for defining the divergence . In addition , we provide a class of problems where the margin lower-bound is tight , demonstrating that the Bregman divergence is crucial in affecting the quality of the obtained solution . • We extend our findings to first-order algorithms . Specifically , we show that mirror descent ( MD ) enjoys the same previously mentioned margin properties . We also provide non-asymptotic convergence analyses of the margin and empirical loss for constant stepsize MD , and its exponential speed-up using a varying stepsize scheme . Our findings for MD strictly complement prior works on under-determined regression problems ( Gunasekar et al. , 2018 ; Azizan and Hassibi , 2019 ) . Notations . We denote [ n ] : = { 1 , . . . , n } ; sgn ( z ) = 1 if z ≥ 0 and −1 elsewhere . We use w.r.t in short for “ with respect to ” . For any ‖·‖ in Euclidean space Rd , we use ‖·‖∗ = max‖y‖≤1 〈· , y〉 to denote its dual norm . Note that we have ( ‖·‖∗ ) ∗ = ‖·‖ . 2 PROBLEM SETUP . We study the binary classification on linearly separable data . Specifically , the dataset is S = { ( xi , yi ) } ni=1 ⊂ Rd × { +1 , −1 } , where xi is the feature vector , and yi is the label . In addition , there exists a linear classifier u ∈ Rd such that yi 〈u , xi〉 > 0 for all i ∈ [ n ] . That is , the decision rule fu ( · ) = sgn ( 〈u , ·〉 ) achieves the perfect accuracy on the dataset , with yi = fu ( xi ) for all i ∈ [ n ] . For each linear classifier fu ( · ) with perfect accuracy , we define its ‖·‖∗-norm margin as the minimum distance in ‖·‖∗-norm from the feature vectors to the decision boundaryHu = { x : 〈x , u〉 = 0 } . It is well known that the ‖·‖∗-norm margin , denoted as γu , only depends on the direction of the classifier and satisfies γu = mini∈ [ n ] 〈 xiyi , u ‖u‖ 〉 , where ‖·‖ is the dual norm of ‖·‖∗ . The ‖·‖∗-norm margin measures how well the data is separated by decision rule fu ( · ) , measured in ‖·‖∗-norm , and is an important measure on the generalizability and robustness of the decision rule . Given a norm ‖·‖∗ on Rd , we define the optimal linear classifier with the maximum ‖·‖∗-margin below . Definition 2.1 ( Maximum ‖·‖∗-norm Margin Classifier ) . Given a linearly separable dataset { ( xi , yi ) } i∈ [ n ] , we define the maximum ‖·‖∗-norm margin classifier u‖·‖∗ , and its associated maximum ‖·‖∗-norm margin γ‖·‖∗ as u‖·‖∗ = argmax‖u‖≤1 min i∈ [ n ] 〈u , yixi〉 , γ‖·‖∗ = max‖u‖≤1 mini∈ [ n ] 〈u , yixi〉 . For a separable dataset , we consider finding the classifier by minimizing the empirical loss LS ( θ ) = 1n ∑n i=1 ` ( 〈θ , yixi〉 ) . ( 2.1 ) Here we focus on the exponential loss ` ( x ) = exp ( −x ) , and our analyses can be readily extended to other losses with tight exponential tail ( e.g. , logistic loss ) . Observation . One can readily verify that with a separable dataset S , the empirical loss has infimum 0 but possesses no finite solution that attains the infimum . Thus any optimization algorithm minimizing the loss LS ( · ) will observe the explosion on the norm of iterate . It has been shown that various optimization algorithms , including ( stochastic ) gradient descent and steepest descent , converge in direction to the maximum margin classifier in different norms ( Soudry et al. , 2018 ; Nacson et al. , 2019 ; Gunasekar et al. , 2018 ; Ji and Telgarsky , 2019 ; 2021 ) . Connections between gradient descent and the regularization path of homotopy method have also been established ( Ji et al. , 2020 ) . A striking feature behind such phenomena is that there is no explicit regularization in the loss function , and such effects have been termed as the implicit ( algorithmic ) regularization . Up to date , most of the implicit regularization effects are attributed to ( stochastic ) gradient descent , given their prevalence in applications . However , as Bregman proximal point algorithm ( BPPA ) becomes increasingly popular in various domains , there exists considerable lack of understanding on the computational properties of BPPA . In addition , practitioners often find the choice of divergence function crucially important for the performance of BPPA ( Jiang et al. , 2020 ; Furlanello et al. , 2018 ) . This empirical evidence thus calls for a detailed characterization on the connection between computational properties and the divergence function of BPPA . In what follows , we study the BPPA for solving problem ( 2.1 ) in detail . The BPPA ( Algorithm 1 ) is an adaptation of the vanilla proximal point algorithm ( Rockafellar , 1976a ; b ) to non-euclidean geometry , by using Bregman divergence as the divergence measure in ( 1.1 ) . Specifically , given a distance generating function w ( · ) that is convex and differentiable , we define the Bregman divergence Dw ( · , · ) associated with w ( · ) as Dw ( θ , θ′ ) = w ( θ ) −w ( θ′ ) − 〈∇w ( θ′ ) , θ − θ′〉 . Throughout our discussions , we only impose the following mild assumption on Bregman divergence function Dw ( · , · ) . Algorithm 1 Bregman Proximal Point Algorithm ( BPPA ) Input : Distance generating function w ( · ) , stepsizes { ηt } t≥0 , samples { xi , yi } ni=1 . Initialize : θ0 ← 0. for t = 0 , . . . do Update θt+1 = argmin θ LS ( θ ) + 1 2ηt Dw ( θ , θt ) . ( 2.2 ) end for Assumption 1 . We assume that the distance generating function of Bregman divergence Dw ( · , · ) is Lw-smooth and µw-strongly convex w.r.t . ‖·‖-norm . That is , µw 2 ‖θ − θ′‖2 ≤ w ( θ ) − w ( θ′ ) − 〈∇w ( θ′ ) , θ − θ′〉 ≤ Lw 2 ‖θ − θ′‖2 .
This paper studies theoretical properties of Bregman proximal point algorithm in the linearly separable binary classification problem. The main theorem shows that the margin obtained by BPPA is lower bounded by the maximum margin multiplied by a factor, which depends on the distance generating function of the Bregman divergence. Similar results are extended to mirror descent. The theorems emphasize the importance of the choice of Bregman divergence, which is further demonstrated in several numerical experiments.
SP:dcf98b9e5610a1c12a6173269a8082fc1a7c2d1b
Node-Level Differentially Private Graph Neural Networks
1 INTRODUCTION . Graph Neural Networks ( GNNs ) are powerful modeling tools that capture structural information provided by a graph . Consequently , they have become popular in a wide array of domains such as biology ( Ktena et al. , 2018 ) , medicine ( Ahmedt-Aristizabal et al. , 2021 ) , chemistry ( McCloskey et al. , 2019 ) , computer vision ( Wang et al. , 2019 ) , and text classification ( Yao et al. , 2019 ) . GNNs allow aggregation of data from the neighbors of a given node in the graph , thus evading the challenge of data scarcity per node . Naturally , such solutions are quite attractive in modeling users – each node of the graph is represented by the user and the connections represent interactions between the users – for a variety of recommendation/ranking tasks , where it is challenging to obtain and store user data ( Fan et al. , 2019 ; Budhiraja et al. , 2020 ; Levy et al. , 2021 ) . However , such solutions are challenging to deploy as they are susceptible to leaking highly sensitive private information about the users . It is well-known that standard ML models – without GNN style data aggregation – can leak highly sensitive information about the training data ( Carlini et al. , 2019 ) . The risk of leakage is significantly higher in GNNs as each prediction is based on not just the individual node , but also an aggregation of data from the neighborhood of the given node . In fact , there are two types of highly-sensitive information about an individual node that can be leaked : a ) the features associated with each node/user , b ) the connectivity information of an individual node/user . In this work , we study the problem of designing algorithms to learn GNNs while preserving nodelevel privacy , i.e. , preserving both the features as well as connectivity information of an individual node . We use differential privacy as the notion of privacy ( Dwork et al. , 2006 ) of a node , which roughly-speaking requires that the algorithm should learn similar GNNs despite perturbation of an entire node and all the data points or predictions associated with that node . Example scenarios for such a solution include ranking/recommendation of entities like documents/emails in an organization . Here , the graph can be formed by a variety of means like how users interact with each other , and the goal would be to learn user features that can enable more accurate ranking of emails/documents . Naturally , user interaction data as well as individual users ’ features ( like the topics in which user is interested in ) would be critical to preserve , and any revelation of such data can be catastrophic . Furthermore , once GNNs are learned to model users while preserving privacy , they can be used in different settings based on the problem requirement . For example , in settings where a node can access it ’ s r-hop neighbors data , we can directly apply r-layer GNNs ( if they are trained with DP ) . Similarly , in certain scenarios , we would want to learn GNNs over a large enterprise and deploy the same model for a small enterprise , where at inference time neighborhood information ( like managerial reporting structure ) might be publicly accessible within the enterprise but not across enterprises . See Section 4 for a detailed discussion . Recent works have explored the problem of differentially private learning of GNNs , but they either consider a restricted setting of edge-level privacy which is often insufficient for real-world problems or they restrict themselves to simpler settings like bipartite graphs or node-level privacy without preserving individual connectivity information ( Wu et al. , 2021a ; b ; Zhou et al. , 2020 ) . In contrast , our proposed method preserves the privacy of the features of each node ( ‘ user ’ ) , their labels as well as their connectivity information . To this end , we adapt the standard DP-SGD method ( Song et al. , 2013 ; Bassily et al. , 2014 ; Abadi et al. , 2016 ) to our setting . But , analysis of the standard DP-SGD method does not directly extend to GNNs , as each gradient term in GNNs can depend on multiple nodes . The key technical contribution of our work is two-fold : i ) we provide a careful sensitivity analysis for the special case of 1-layer GNNs , ii ) we extend the standard privacy by amplification technique to GNNs where one gradient term can depend on multiple users . Note that the standard privacy by amplification method only applies to scenarios where each point corresponds to one user/entity . By combining the above two results with the standard Rényi Differential Privacy ( RDP ) accounting , we obtain a formal proof of privacy for our method . Finally , we evaluate our DP-GNN method on standard benchmarks . We demonstrate that DP-GNN is reasonably accurate compared to the standard 1-layer GCN models , while providing privacy parameters of about ≤ 30 which are close to the industry standard . More critically , compared to standard MLP ( multi-layer perceptron ) based methods that completely discard graph side-information , our method can be 5-6 % more accurate while still providing strong privacy guarantees . That is , we demonstrate that GNN based techniques can indeed be deployed in practice with the benefits of improved accuracy over vanilla MLP style methods while still preserving sensitive user data . Contributions : We propose a Node-Level Differentially Private Graph Neural Network that works well in practice and provides formal privacy guarantees . This is the first work , to the best of our knowledge , to provide such strong privacy guarantees for each individual node in the graph learning regime . Our main contributions are organised as follows : • Formulation : In Section 3 , we formalize the problem of node-level differentially private GNNs , and discuss various important settings in which a solution to the problem is applicable . • Method : In Section 4 , we describe our algorithm that adapts standard DP-SGD to train differentially private GNNs , with a strong privacy guarantee that extends standard privacy amplification by sampling . • Empirical Evaluation : In Section 5 , we evaluate our framework on multiple benchmark graph datasets on the task of node classification . We demonstrate that our DP-GNN method can outperform non-private and private MLP methods that can not utilize graph information . 2 RELATED WORK . Mechanisms to make the training process of machine learning models private primarily fall into two categories : model-agnostic methods such as PATE ( Papernot et al. , 2017 ) , and model-aware methods such as DP-SGD ( Abadi et al. , 2016 ) , which augment the standard paradigm of gradientbased training to be differentially private . DP-SGD , in particular , has been used successfully to train neural network models to classify images ( Abadi et al. , 2016 ) and text ( Anil et al. , 2021 ) . Today , there are many varieties of graph neural networks employed : Graph Convolutional Neural Networks ( Kipf & Welling , 2016 ) , Graph Attention Networks ( Veličković et al. , 2018 ) , GraphSAGE ( Hamilton et al. , 2017 ) , and Message-Passing Neural Networks ( Gilmer et al. , 2017 ) , to name a few . Broadly , these models compute node-level representations via aggregation of neighbourhood-level information , that can lead to diffusion of private information across multiple nodes , thus making application of standard DP-SGD like techniques non-trivial . There has been recent work in learning and evaluating edge-level private GNNs ( Wu et al. , 2021b ) but they do not preserve node-level data . Private GNNs have also been studied from the perspective of local privacy ( Sajadmanesh & Gatica-Perez , 2020 ) , where each node performs its share of the GNN computation locally . In such a setting , each node sends noisy versions of its features and labels to neighbouring nodes in order to learn shared weights , resulting in a elaborate learning algorithm that needs to correct for the bias in both the features and labels . ( Wu et al. , 2021a ) utilizes private GNNs for recommendation systems , but their method assumes a bipartite graph structure , and can not naturally handle homogeneous graphs . Other approaches employ federated learning ( Zhou et al. , 2020 ) , but only guarantee that the GNN neighbourhood aggregation step is differentially private , which is insufficient to guarantee privacy of each node ’ s neighborhood . Finally , other attempts ( Shan et al. , 2021 ) to create privacy-preserving GNNs exist , but these do not use the formal notion of DP . Model-agnostic methods , such as PATE , have recently been investigated to train GNNs ( Olatunji et al. , 2021 ) . In their current form , however , such methods require access to public data samples , which may not always be available for the task at hand . In contrast to previous approaches which protect the privacy of a node ’ s features and labels only , we additionally seek to protect every node ’ s adjacency vector , which is its private list of connections to neighbouring nodes . This is because the existence of communication between a pair of nodes can often be sensitive information in itself . Further , our approach extends the standard approaches of gradient-based training to scalably train node-level differentially private GNNs in a centralized setting , without any access to public data . Depending on the required privacy setting , this mechanism can be composed with locally differentially private mechanisms to generate node-level predictions . In different contexts , there has been extensive work on node-level DP ( Raskhodnikova & Smith , 2016 ; Karwa et al. , 2011 ; Borgs et al. , 2015 ; 2018 ) . But these methods generally deal with modeling ‘ global ’ graph-level statistics and do not support learning methods such as GNNs . In contrast , our approach aims to predict ‘ local ’ node-level statistics ( like the label of a node ) while preserving node-level privacy . 3 PROBLEM FORMULATION AND PRELIMINARIES . Consider a graph dataset G = ( V , E , X , Y ) with directed graph G = ( V , E ) represented by a adjacency matrix A ∈ { 0 , 1 } n×n . n is the number of nodes in G , V denotes the node set , E denotes the edge set . Each node v in the graph is equipped with a feature vector Xv ∈ Rd ; X ∈ Rn×d denotes the feature matrix . Y ∈ Rn×Q is the label matrix and yv is the label for the v-th node over Q classes . Note that many of the labels in the label vector can be missing , which models the semi-supervised setting . In particular , we assume that node labels yv are only provided for a subset of nodes Vtr ⊂ V , called the training set . Given the graph dataset G , the goal is to learn parameters of a one-layer GNN while preserving privacy of individual nodes . A GNN can be represented by the following operations : ŷv = GNN ( A , X , v ; Θ ) : = fdec ( fagg ( { fenc ( Xu ) |Avu 6= 0 } ) ) ( 1 ) where ŷv is the prediction from the GNN for a given node v , fenc is the encoder function that encodes node features with parameters Θenc , fagg is the neighborhood aggregation function with parameters Θagg , fdec is the prediction decoder function with parameters Θdec , and Θ : = ( Θenc , Θagg , Θdec ) . While our results apply to most 1-layer GNN models ( Hamilton et al. , 2017 ; Veličković et al. , 2018 ; Xu et al. , 2018 ) , for simplicity , we focus on 1-layer Graph Convolutional Network ( GCN ) models1 ( Kipf & Welling , 2016 ) . These GCN models use a multi-layer perceptron ( MLP ) for encoder and decoder functions , with non-linear activation function σ : ŷv = GCN ( A , X , v ; Θ ) : = MLPdec ( Avσ ( MLPenc ( X ) ) Θagg ) ( 2 ) 1 As is common in practice , we allow any normalization and addition of self-loops to A . Thus , “ learning ” a GCN is equivalent to finding parameters Θ : = ( Θenc , Θagg , Θdec ) that minimize a suitable loss : Θ∗ = arg min Θ ∑ v∈V ` ( ŷv ; yv ) ︸ ︷︷ ︸ L ( G , Θ ) ( 3 ) where ` : RQ×Q → R is a standard loss function such as categorical cross-entropy.2 As mentioned earlier , we use differential privacy as the notion of privacy of a node . Before defining differential privacy , we first define the notion of adjacent graph datasets : Definition 1 ( Adjacent Graph Datasets ) . Two graph datasets G and G′ are said to be node-level adjacent if one can be obtained by adding or removing a node ( with its features , labels and associated edges ) to the other . That is , G and G′ are exactly the same except for the v-th node , i.e. , Xv , yv and Av differ in the two datasets . Informally , A is said to be node-level differentially-private algorithm if the addition or removal of a node in A ’ s input does not affect A ’ s output significantly . Definition 2 ( Node-level Differential Privacy ) . Consider any randomized algorithm A that takes as input a graph dataset . A is said to be ( α , γ ) node-level Rényi differentially-private ( Mironov , 2017b ) if , for every pair of node-level adjacent datasets G and G′ : Dα ( A ( G ) ‖ A ( G′ ) ) ≤ γ , where Rényi divergence Dα of order α between two random variables P and Q is defined as : Dα ( P ‖ Q ) = 1 α− 1 lnEx∼Q [ P ( x ) Q ( x ) ] α . Note that we use Rényi differentially-private ( RDP ) ( Mironov , 2017b ) as the formal notion of differential privacy ( DP ) , as it allows for tighter composition of DP across multiple steps . This notion is closely related to the standard ( ε , δ ) -differential privacy ( Dwork et al. , 2006 ) ; Proposition 3 of Mironov ( 2017b ) states that any ( α , γ ) -RDP mechanism also satisfies ( γ + log 1/δα−1 , δ ) -differential privacy for any 0 < δ < 1 . Thus , the goal is to find Θ by optimizing equation 3 while ensuring RDP ( Definition 2 ) . It is clear that node-level privacy is essential when training models on graph datasets with sensitive node-level information . However , node-level privacy is significantly harder to achieve than the weaker notion of edge-level privacy . In the context of GNNs , the representation for a node is computed using not just the node ’ s individual features , but also features of other nodes from the local neighbourhood . Thus , the removal of a node from a graph dataset affects its entire local neighbourhood , which can be a very large set of nodes . This is in contrast to the standard non-graph setting for differentially private models , where the representation of individual users would only depend on the user ’ s own data . We now define two concepts that are critical in our design and analysis of a private GNN learning method . Definition 3 . The node-level sensitivity ∆ ( f ) of a function f defined on graph datasets is : ∆ ( f ) = max node-level adjacent G , G′ ‖f ( G ) − f ( G′ ) ‖2 The K-restricted node-level sensitivity ∆K ( f ) of a function f defined on graph datasets is : ∆K ( f ) = max deg ( G ) , deg ( G′ ) ≤K node-level adjacent G , G′ ‖f ( G ) − f ( G′ ) ‖2 Definition 4 . We define the clipping operator ClipC ( . ) as : ClipC ( v ) = min ( 1 , C‖v‖F ) · v , for any vector or matrix v. 2 The analysis here holds for multi-label settings as well , which would instead use loss functions such as sigmoidal cross-entropy , for example . Algorithm 1 : DP-GNN ( SGD ) : Differentially Private Graph Neural Network with SGD Data : Graph G = ( V , E , X , Y ) , GNN definition GNN , Training set Vtr , Loss function L , Batch size m , Maximum degree K , Learning rate η , Clipping threshold C , Noise standard deviation σ , Maximum training iterations T . Result : GNN parameters ΘT . Note that Vtr is the subset of nodes for which labels are available ( see Paragraph 1 of Section 3 ) . Using Vtr , construct the set of training subgraphs Str with Algorithm 2 . Construct the 0− 1 adjacency matrix A : Avu = 1 ⇐⇒ ( v , u ) ∈ Str Initialize Θ0 randomly . for t = 0 to T do Sample set Bt ⊆ Vtr of size m uniformly at random from all subsets of Vtr . Compute the update term ut as the sum of the clipped gradient terms in the batch Bt : ut ← ∑ v∈Bt ClipC ( ∇Θ ` ( GNN ( A , X , v ; Θt ) ; yv ) ) Add independent Gaussian noise to the update term : ũt ← ut +N ( 0 , σ2I ) Update the current estimate of the parameters with the noisy update : Θt+1 ← Θt − ηm ũt end
This paper proposes a private algorithm for Graph Neural Networks at the node level. The algorithm is based on some modifications to the DP-SGD, and it applies to directed graphs. The authors analyze the privacy guarantees through Renyi differential privacy and give amplified privacy guarantees for their algorithm. Empirical evaluation is provided to demonstrate the efficacy of the proposed algorithm.
SP:34424377334de88c4d17eddc92d3848bfc622b3a
Node-Level Differentially Private Graph Neural Networks
1 INTRODUCTION . Graph Neural Networks ( GNNs ) are powerful modeling tools that capture structural information provided by a graph . Consequently , they have become popular in a wide array of domains such as biology ( Ktena et al. , 2018 ) , medicine ( Ahmedt-Aristizabal et al. , 2021 ) , chemistry ( McCloskey et al. , 2019 ) , computer vision ( Wang et al. , 2019 ) , and text classification ( Yao et al. , 2019 ) . GNNs allow aggregation of data from the neighbors of a given node in the graph , thus evading the challenge of data scarcity per node . Naturally , such solutions are quite attractive in modeling users – each node of the graph is represented by the user and the connections represent interactions between the users – for a variety of recommendation/ranking tasks , where it is challenging to obtain and store user data ( Fan et al. , 2019 ; Budhiraja et al. , 2020 ; Levy et al. , 2021 ) . However , such solutions are challenging to deploy as they are susceptible to leaking highly sensitive private information about the users . It is well-known that standard ML models – without GNN style data aggregation – can leak highly sensitive information about the training data ( Carlini et al. , 2019 ) . The risk of leakage is significantly higher in GNNs as each prediction is based on not just the individual node , but also an aggregation of data from the neighborhood of the given node . In fact , there are two types of highly-sensitive information about an individual node that can be leaked : a ) the features associated with each node/user , b ) the connectivity information of an individual node/user . In this work , we study the problem of designing algorithms to learn GNNs while preserving nodelevel privacy , i.e. , preserving both the features as well as connectivity information of an individual node . We use differential privacy as the notion of privacy ( Dwork et al. , 2006 ) of a node , which roughly-speaking requires that the algorithm should learn similar GNNs despite perturbation of an entire node and all the data points or predictions associated with that node . Example scenarios for such a solution include ranking/recommendation of entities like documents/emails in an organization . Here , the graph can be formed by a variety of means like how users interact with each other , and the goal would be to learn user features that can enable more accurate ranking of emails/documents . Naturally , user interaction data as well as individual users ’ features ( like the topics in which user is interested in ) would be critical to preserve , and any revelation of such data can be catastrophic . Furthermore , once GNNs are learned to model users while preserving privacy , they can be used in different settings based on the problem requirement . For example , in settings where a node can access it ’ s r-hop neighbors data , we can directly apply r-layer GNNs ( if they are trained with DP ) . Similarly , in certain scenarios , we would want to learn GNNs over a large enterprise and deploy the same model for a small enterprise , where at inference time neighborhood information ( like managerial reporting structure ) might be publicly accessible within the enterprise but not across enterprises . See Section 4 for a detailed discussion . Recent works have explored the problem of differentially private learning of GNNs , but they either consider a restricted setting of edge-level privacy which is often insufficient for real-world problems or they restrict themselves to simpler settings like bipartite graphs or node-level privacy without preserving individual connectivity information ( Wu et al. , 2021a ; b ; Zhou et al. , 2020 ) . In contrast , our proposed method preserves the privacy of the features of each node ( ‘ user ’ ) , their labels as well as their connectivity information . To this end , we adapt the standard DP-SGD method ( Song et al. , 2013 ; Bassily et al. , 2014 ; Abadi et al. , 2016 ) to our setting . But , analysis of the standard DP-SGD method does not directly extend to GNNs , as each gradient term in GNNs can depend on multiple nodes . The key technical contribution of our work is two-fold : i ) we provide a careful sensitivity analysis for the special case of 1-layer GNNs , ii ) we extend the standard privacy by amplification technique to GNNs where one gradient term can depend on multiple users . Note that the standard privacy by amplification method only applies to scenarios where each point corresponds to one user/entity . By combining the above two results with the standard Rényi Differential Privacy ( RDP ) accounting , we obtain a formal proof of privacy for our method . Finally , we evaluate our DP-GNN method on standard benchmarks . We demonstrate that DP-GNN is reasonably accurate compared to the standard 1-layer GCN models , while providing privacy parameters of about ≤ 30 which are close to the industry standard . More critically , compared to standard MLP ( multi-layer perceptron ) based methods that completely discard graph side-information , our method can be 5-6 % more accurate while still providing strong privacy guarantees . That is , we demonstrate that GNN based techniques can indeed be deployed in practice with the benefits of improved accuracy over vanilla MLP style methods while still preserving sensitive user data . Contributions : We propose a Node-Level Differentially Private Graph Neural Network that works well in practice and provides formal privacy guarantees . This is the first work , to the best of our knowledge , to provide such strong privacy guarantees for each individual node in the graph learning regime . Our main contributions are organised as follows : • Formulation : In Section 3 , we formalize the problem of node-level differentially private GNNs , and discuss various important settings in which a solution to the problem is applicable . • Method : In Section 4 , we describe our algorithm that adapts standard DP-SGD to train differentially private GNNs , with a strong privacy guarantee that extends standard privacy amplification by sampling . • Empirical Evaluation : In Section 5 , we evaluate our framework on multiple benchmark graph datasets on the task of node classification . We demonstrate that our DP-GNN method can outperform non-private and private MLP methods that can not utilize graph information . 2 RELATED WORK . Mechanisms to make the training process of machine learning models private primarily fall into two categories : model-agnostic methods such as PATE ( Papernot et al. , 2017 ) , and model-aware methods such as DP-SGD ( Abadi et al. , 2016 ) , which augment the standard paradigm of gradientbased training to be differentially private . DP-SGD , in particular , has been used successfully to train neural network models to classify images ( Abadi et al. , 2016 ) and text ( Anil et al. , 2021 ) . Today , there are many varieties of graph neural networks employed : Graph Convolutional Neural Networks ( Kipf & Welling , 2016 ) , Graph Attention Networks ( Veličković et al. , 2018 ) , GraphSAGE ( Hamilton et al. , 2017 ) , and Message-Passing Neural Networks ( Gilmer et al. , 2017 ) , to name a few . Broadly , these models compute node-level representations via aggregation of neighbourhood-level information , that can lead to diffusion of private information across multiple nodes , thus making application of standard DP-SGD like techniques non-trivial . There has been recent work in learning and evaluating edge-level private GNNs ( Wu et al. , 2021b ) but they do not preserve node-level data . Private GNNs have also been studied from the perspective of local privacy ( Sajadmanesh & Gatica-Perez , 2020 ) , where each node performs its share of the GNN computation locally . In such a setting , each node sends noisy versions of its features and labels to neighbouring nodes in order to learn shared weights , resulting in a elaborate learning algorithm that needs to correct for the bias in both the features and labels . ( Wu et al. , 2021a ) utilizes private GNNs for recommendation systems , but their method assumes a bipartite graph structure , and can not naturally handle homogeneous graphs . Other approaches employ federated learning ( Zhou et al. , 2020 ) , but only guarantee that the GNN neighbourhood aggregation step is differentially private , which is insufficient to guarantee privacy of each node ’ s neighborhood . Finally , other attempts ( Shan et al. , 2021 ) to create privacy-preserving GNNs exist , but these do not use the formal notion of DP . Model-agnostic methods , such as PATE , have recently been investigated to train GNNs ( Olatunji et al. , 2021 ) . In their current form , however , such methods require access to public data samples , which may not always be available for the task at hand . In contrast to previous approaches which protect the privacy of a node ’ s features and labels only , we additionally seek to protect every node ’ s adjacency vector , which is its private list of connections to neighbouring nodes . This is because the existence of communication between a pair of nodes can often be sensitive information in itself . Further , our approach extends the standard approaches of gradient-based training to scalably train node-level differentially private GNNs in a centralized setting , without any access to public data . Depending on the required privacy setting , this mechanism can be composed with locally differentially private mechanisms to generate node-level predictions . In different contexts , there has been extensive work on node-level DP ( Raskhodnikova & Smith , 2016 ; Karwa et al. , 2011 ; Borgs et al. , 2015 ; 2018 ) . But these methods generally deal with modeling ‘ global ’ graph-level statistics and do not support learning methods such as GNNs . In contrast , our approach aims to predict ‘ local ’ node-level statistics ( like the label of a node ) while preserving node-level privacy . 3 PROBLEM FORMULATION AND PRELIMINARIES . Consider a graph dataset G = ( V , E , X , Y ) with directed graph G = ( V , E ) represented by a adjacency matrix A ∈ { 0 , 1 } n×n . n is the number of nodes in G , V denotes the node set , E denotes the edge set . Each node v in the graph is equipped with a feature vector Xv ∈ Rd ; X ∈ Rn×d denotes the feature matrix . Y ∈ Rn×Q is the label matrix and yv is the label for the v-th node over Q classes . Note that many of the labels in the label vector can be missing , which models the semi-supervised setting . In particular , we assume that node labels yv are only provided for a subset of nodes Vtr ⊂ V , called the training set . Given the graph dataset G , the goal is to learn parameters of a one-layer GNN while preserving privacy of individual nodes . A GNN can be represented by the following operations : ŷv = GNN ( A , X , v ; Θ ) : = fdec ( fagg ( { fenc ( Xu ) |Avu 6= 0 } ) ) ( 1 ) where ŷv is the prediction from the GNN for a given node v , fenc is the encoder function that encodes node features with parameters Θenc , fagg is the neighborhood aggregation function with parameters Θagg , fdec is the prediction decoder function with parameters Θdec , and Θ : = ( Θenc , Θagg , Θdec ) . While our results apply to most 1-layer GNN models ( Hamilton et al. , 2017 ; Veličković et al. , 2018 ; Xu et al. , 2018 ) , for simplicity , we focus on 1-layer Graph Convolutional Network ( GCN ) models1 ( Kipf & Welling , 2016 ) . These GCN models use a multi-layer perceptron ( MLP ) for encoder and decoder functions , with non-linear activation function σ : ŷv = GCN ( A , X , v ; Θ ) : = MLPdec ( Avσ ( MLPenc ( X ) ) Θagg ) ( 2 ) 1 As is common in practice , we allow any normalization and addition of self-loops to A . Thus , “ learning ” a GCN is equivalent to finding parameters Θ : = ( Θenc , Θagg , Θdec ) that minimize a suitable loss : Θ∗ = arg min Θ ∑ v∈V ` ( ŷv ; yv ) ︸ ︷︷ ︸ L ( G , Θ ) ( 3 ) where ` : RQ×Q → R is a standard loss function such as categorical cross-entropy.2 As mentioned earlier , we use differential privacy as the notion of privacy of a node . Before defining differential privacy , we first define the notion of adjacent graph datasets : Definition 1 ( Adjacent Graph Datasets ) . Two graph datasets G and G′ are said to be node-level adjacent if one can be obtained by adding or removing a node ( with its features , labels and associated edges ) to the other . That is , G and G′ are exactly the same except for the v-th node , i.e. , Xv , yv and Av differ in the two datasets . Informally , A is said to be node-level differentially-private algorithm if the addition or removal of a node in A ’ s input does not affect A ’ s output significantly . Definition 2 ( Node-level Differential Privacy ) . Consider any randomized algorithm A that takes as input a graph dataset . A is said to be ( α , γ ) node-level Rényi differentially-private ( Mironov , 2017b ) if , for every pair of node-level adjacent datasets G and G′ : Dα ( A ( G ) ‖ A ( G′ ) ) ≤ γ , where Rényi divergence Dα of order α between two random variables P and Q is defined as : Dα ( P ‖ Q ) = 1 α− 1 lnEx∼Q [ P ( x ) Q ( x ) ] α . Note that we use Rényi differentially-private ( RDP ) ( Mironov , 2017b ) as the formal notion of differential privacy ( DP ) , as it allows for tighter composition of DP across multiple steps . This notion is closely related to the standard ( ε , δ ) -differential privacy ( Dwork et al. , 2006 ) ; Proposition 3 of Mironov ( 2017b ) states that any ( α , γ ) -RDP mechanism also satisfies ( γ + log 1/δα−1 , δ ) -differential privacy for any 0 < δ < 1 . Thus , the goal is to find Θ by optimizing equation 3 while ensuring RDP ( Definition 2 ) . It is clear that node-level privacy is essential when training models on graph datasets with sensitive node-level information . However , node-level privacy is significantly harder to achieve than the weaker notion of edge-level privacy . In the context of GNNs , the representation for a node is computed using not just the node ’ s individual features , but also features of other nodes from the local neighbourhood . Thus , the removal of a node from a graph dataset affects its entire local neighbourhood , which can be a very large set of nodes . This is in contrast to the standard non-graph setting for differentially private models , where the representation of individual users would only depend on the user ’ s own data . We now define two concepts that are critical in our design and analysis of a private GNN learning method . Definition 3 . The node-level sensitivity ∆ ( f ) of a function f defined on graph datasets is : ∆ ( f ) = max node-level adjacent G , G′ ‖f ( G ) − f ( G′ ) ‖2 The K-restricted node-level sensitivity ∆K ( f ) of a function f defined on graph datasets is : ∆K ( f ) = max deg ( G ) , deg ( G′ ) ≤K node-level adjacent G , G′ ‖f ( G ) − f ( G′ ) ‖2 Definition 4 . We define the clipping operator ClipC ( . ) as : ClipC ( v ) = min ( 1 , C‖v‖F ) · v , for any vector or matrix v. 2 The analysis here holds for multi-label settings as well , which would instead use loss functions such as sigmoidal cross-entropy , for example . Algorithm 1 : DP-GNN ( SGD ) : Differentially Private Graph Neural Network with SGD Data : Graph G = ( V , E , X , Y ) , GNN definition GNN , Training set Vtr , Loss function L , Batch size m , Maximum degree K , Learning rate η , Clipping threshold C , Noise standard deviation σ , Maximum training iterations T . Result : GNN parameters ΘT . Note that Vtr is the subset of nodes for which labels are available ( see Paragraph 1 of Section 3 ) . Using Vtr , construct the set of training subgraphs Str with Algorithm 2 . Construct the 0− 1 adjacency matrix A : Avu = 1 ⇐⇒ ( v , u ) ∈ Str Initialize Θ0 randomly . for t = 0 to T do Sample set Bt ⊆ Vtr of size m uniformly at random from all subsets of Vtr . Compute the update term ut as the sum of the clipped gradient terms in the batch Bt : ut ← ∑ v∈Bt ClipC ( ∇Θ ` ( GNN ( A , X , v ; Θt ) ; yv ) ) Add independent Gaussian noise to the update term : ũt ← ut +N ( 0 , σ2I ) Update the current estimate of the parameters with the noisy update : Θt+1 ← Θt − ηm ũt end
This paper aims to achieve node-level differential privacy on GNNs. Through adding noises to calculated gradients at each optimization step, this work shows that trained GNN layer can be (α, γ) node-level Renyi differentially-private. Concretely, this work considers the 1-layer GNN case, and make the maximum degree of each node to be K. With these requirements, this work theoretically prove the scale of noises. Its contributions are as follows: 1. Propose the task of learning node-level differential private GNNs, 2. Adapt DP-SGD to work on graphs, through extending amplified privacy guarantee, 3. Evaluate proposed optimization algorithm on benchmark graph datasets.
SP:34424377334de88c4d17eddc92d3848bfc622b3a
Node-Level Differentially Private Graph Neural Networks
1 INTRODUCTION . Graph Neural Networks ( GNNs ) are powerful modeling tools that capture structural information provided by a graph . Consequently , they have become popular in a wide array of domains such as biology ( Ktena et al. , 2018 ) , medicine ( Ahmedt-Aristizabal et al. , 2021 ) , chemistry ( McCloskey et al. , 2019 ) , computer vision ( Wang et al. , 2019 ) , and text classification ( Yao et al. , 2019 ) . GNNs allow aggregation of data from the neighbors of a given node in the graph , thus evading the challenge of data scarcity per node . Naturally , such solutions are quite attractive in modeling users – each node of the graph is represented by the user and the connections represent interactions between the users – for a variety of recommendation/ranking tasks , where it is challenging to obtain and store user data ( Fan et al. , 2019 ; Budhiraja et al. , 2020 ; Levy et al. , 2021 ) . However , such solutions are challenging to deploy as they are susceptible to leaking highly sensitive private information about the users . It is well-known that standard ML models – without GNN style data aggregation – can leak highly sensitive information about the training data ( Carlini et al. , 2019 ) . The risk of leakage is significantly higher in GNNs as each prediction is based on not just the individual node , but also an aggregation of data from the neighborhood of the given node . In fact , there are two types of highly-sensitive information about an individual node that can be leaked : a ) the features associated with each node/user , b ) the connectivity information of an individual node/user . In this work , we study the problem of designing algorithms to learn GNNs while preserving nodelevel privacy , i.e. , preserving both the features as well as connectivity information of an individual node . We use differential privacy as the notion of privacy ( Dwork et al. , 2006 ) of a node , which roughly-speaking requires that the algorithm should learn similar GNNs despite perturbation of an entire node and all the data points or predictions associated with that node . Example scenarios for such a solution include ranking/recommendation of entities like documents/emails in an organization . Here , the graph can be formed by a variety of means like how users interact with each other , and the goal would be to learn user features that can enable more accurate ranking of emails/documents . Naturally , user interaction data as well as individual users ’ features ( like the topics in which user is interested in ) would be critical to preserve , and any revelation of such data can be catastrophic . Furthermore , once GNNs are learned to model users while preserving privacy , they can be used in different settings based on the problem requirement . For example , in settings where a node can access it ’ s r-hop neighbors data , we can directly apply r-layer GNNs ( if they are trained with DP ) . Similarly , in certain scenarios , we would want to learn GNNs over a large enterprise and deploy the same model for a small enterprise , where at inference time neighborhood information ( like managerial reporting structure ) might be publicly accessible within the enterprise but not across enterprises . See Section 4 for a detailed discussion . Recent works have explored the problem of differentially private learning of GNNs , but they either consider a restricted setting of edge-level privacy which is often insufficient for real-world problems or they restrict themselves to simpler settings like bipartite graphs or node-level privacy without preserving individual connectivity information ( Wu et al. , 2021a ; b ; Zhou et al. , 2020 ) . In contrast , our proposed method preserves the privacy of the features of each node ( ‘ user ’ ) , their labels as well as their connectivity information . To this end , we adapt the standard DP-SGD method ( Song et al. , 2013 ; Bassily et al. , 2014 ; Abadi et al. , 2016 ) to our setting . But , analysis of the standard DP-SGD method does not directly extend to GNNs , as each gradient term in GNNs can depend on multiple nodes . The key technical contribution of our work is two-fold : i ) we provide a careful sensitivity analysis for the special case of 1-layer GNNs , ii ) we extend the standard privacy by amplification technique to GNNs where one gradient term can depend on multiple users . Note that the standard privacy by amplification method only applies to scenarios where each point corresponds to one user/entity . By combining the above two results with the standard Rényi Differential Privacy ( RDP ) accounting , we obtain a formal proof of privacy for our method . Finally , we evaluate our DP-GNN method on standard benchmarks . We demonstrate that DP-GNN is reasonably accurate compared to the standard 1-layer GCN models , while providing privacy parameters of about ≤ 30 which are close to the industry standard . More critically , compared to standard MLP ( multi-layer perceptron ) based methods that completely discard graph side-information , our method can be 5-6 % more accurate while still providing strong privacy guarantees . That is , we demonstrate that GNN based techniques can indeed be deployed in practice with the benefits of improved accuracy over vanilla MLP style methods while still preserving sensitive user data . Contributions : We propose a Node-Level Differentially Private Graph Neural Network that works well in practice and provides formal privacy guarantees . This is the first work , to the best of our knowledge , to provide such strong privacy guarantees for each individual node in the graph learning regime . Our main contributions are organised as follows : • Formulation : In Section 3 , we formalize the problem of node-level differentially private GNNs , and discuss various important settings in which a solution to the problem is applicable . • Method : In Section 4 , we describe our algorithm that adapts standard DP-SGD to train differentially private GNNs , with a strong privacy guarantee that extends standard privacy amplification by sampling . • Empirical Evaluation : In Section 5 , we evaluate our framework on multiple benchmark graph datasets on the task of node classification . We demonstrate that our DP-GNN method can outperform non-private and private MLP methods that can not utilize graph information . 2 RELATED WORK . Mechanisms to make the training process of machine learning models private primarily fall into two categories : model-agnostic methods such as PATE ( Papernot et al. , 2017 ) , and model-aware methods such as DP-SGD ( Abadi et al. , 2016 ) , which augment the standard paradigm of gradientbased training to be differentially private . DP-SGD , in particular , has been used successfully to train neural network models to classify images ( Abadi et al. , 2016 ) and text ( Anil et al. , 2021 ) . Today , there are many varieties of graph neural networks employed : Graph Convolutional Neural Networks ( Kipf & Welling , 2016 ) , Graph Attention Networks ( Veličković et al. , 2018 ) , GraphSAGE ( Hamilton et al. , 2017 ) , and Message-Passing Neural Networks ( Gilmer et al. , 2017 ) , to name a few . Broadly , these models compute node-level representations via aggregation of neighbourhood-level information , that can lead to diffusion of private information across multiple nodes , thus making application of standard DP-SGD like techniques non-trivial . There has been recent work in learning and evaluating edge-level private GNNs ( Wu et al. , 2021b ) but they do not preserve node-level data . Private GNNs have also been studied from the perspective of local privacy ( Sajadmanesh & Gatica-Perez , 2020 ) , where each node performs its share of the GNN computation locally . In such a setting , each node sends noisy versions of its features and labels to neighbouring nodes in order to learn shared weights , resulting in a elaborate learning algorithm that needs to correct for the bias in both the features and labels . ( Wu et al. , 2021a ) utilizes private GNNs for recommendation systems , but their method assumes a bipartite graph structure , and can not naturally handle homogeneous graphs . Other approaches employ federated learning ( Zhou et al. , 2020 ) , but only guarantee that the GNN neighbourhood aggregation step is differentially private , which is insufficient to guarantee privacy of each node ’ s neighborhood . Finally , other attempts ( Shan et al. , 2021 ) to create privacy-preserving GNNs exist , but these do not use the formal notion of DP . Model-agnostic methods , such as PATE , have recently been investigated to train GNNs ( Olatunji et al. , 2021 ) . In their current form , however , such methods require access to public data samples , which may not always be available for the task at hand . In contrast to previous approaches which protect the privacy of a node ’ s features and labels only , we additionally seek to protect every node ’ s adjacency vector , which is its private list of connections to neighbouring nodes . This is because the existence of communication between a pair of nodes can often be sensitive information in itself . Further , our approach extends the standard approaches of gradient-based training to scalably train node-level differentially private GNNs in a centralized setting , without any access to public data . Depending on the required privacy setting , this mechanism can be composed with locally differentially private mechanisms to generate node-level predictions . In different contexts , there has been extensive work on node-level DP ( Raskhodnikova & Smith , 2016 ; Karwa et al. , 2011 ; Borgs et al. , 2015 ; 2018 ) . But these methods generally deal with modeling ‘ global ’ graph-level statistics and do not support learning methods such as GNNs . In contrast , our approach aims to predict ‘ local ’ node-level statistics ( like the label of a node ) while preserving node-level privacy . 3 PROBLEM FORMULATION AND PRELIMINARIES . Consider a graph dataset G = ( V , E , X , Y ) with directed graph G = ( V , E ) represented by a adjacency matrix A ∈ { 0 , 1 } n×n . n is the number of nodes in G , V denotes the node set , E denotes the edge set . Each node v in the graph is equipped with a feature vector Xv ∈ Rd ; X ∈ Rn×d denotes the feature matrix . Y ∈ Rn×Q is the label matrix and yv is the label for the v-th node over Q classes . Note that many of the labels in the label vector can be missing , which models the semi-supervised setting . In particular , we assume that node labels yv are only provided for a subset of nodes Vtr ⊂ V , called the training set . Given the graph dataset G , the goal is to learn parameters of a one-layer GNN while preserving privacy of individual nodes . A GNN can be represented by the following operations : ŷv = GNN ( A , X , v ; Θ ) : = fdec ( fagg ( { fenc ( Xu ) |Avu 6= 0 } ) ) ( 1 ) where ŷv is the prediction from the GNN for a given node v , fenc is the encoder function that encodes node features with parameters Θenc , fagg is the neighborhood aggregation function with parameters Θagg , fdec is the prediction decoder function with parameters Θdec , and Θ : = ( Θenc , Θagg , Θdec ) . While our results apply to most 1-layer GNN models ( Hamilton et al. , 2017 ; Veličković et al. , 2018 ; Xu et al. , 2018 ) , for simplicity , we focus on 1-layer Graph Convolutional Network ( GCN ) models1 ( Kipf & Welling , 2016 ) . These GCN models use a multi-layer perceptron ( MLP ) for encoder and decoder functions , with non-linear activation function σ : ŷv = GCN ( A , X , v ; Θ ) : = MLPdec ( Avσ ( MLPenc ( X ) ) Θagg ) ( 2 ) 1 As is common in practice , we allow any normalization and addition of self-loops to A . Thus , “ learning ” a GCN is equivalent to finding parameters Θ : = ( Θenc , Θagg , Θdec ) that minimize a suitable loss : Θ∗ = arg min Θ ∑ v∈V ` ( ŷv ; yv ) ︸ ︷︷ ︸ L ( G , Θ ) ( 3 ) where ` : RQ×Q → R is a standard loss function such as categorical cross-entropy.2 As mentioned earlier , we use differential privacy as the notion of privacy of a node . Before defining differential privacy , we first define the notion of adjacent graph datasets : Definition 1 ( Adjacent Graph Datasets ) . Two graph datasets G and G′ are said to be node-level adjacent if one can be obtained by adding or removing a node ( with its features , labels and associated edges ) to the other . That is , G and G′ are exactly the same except for the v-th node , i.e. , Xv , yv and Av differ in the two datasets . Informally , A is said to be node-level differentially-private algorithm if the addition or removal of a node in A ’ s input does not affect A ’ s output significantly . Definition 2 ( Node-level Differential Privacy ) . Consider any randomized algorithm A that takes as input a graph dataset . A is said to be ( α , γ ) node-level Rényi differentially-private ( Mironov , 2017b ) if , for every pair of node-level adjacent datasets G and G′ : Dα ( A ( G ) ‖ A ( G′ ) ) ≤ γ , where Rényi divergence Dα of order α between two random variables P and Q is defined as : Dα ( P ‖ Q ) = 1 α− 1 lnEx∼Q [ P ( x ) Q ( x ) ] α . Note that we use Rényi differentially-private ( RDP ) ( Mironov , 2017b ) as the formal notion of differential privacy ( DP ) , as it allows for tighter composition of DP across multiple steps . This notion is closely related to the standard ( ε , δ ) -differential privacy ( Dwork et al. , 2006 ) ; Proposition 3 of Mironov ( 2017b ) states that any ( α , γ ) -RDP mechanism also satisfies ( γ + log 1/δα−1 , δ ) -differential privacy for any 0 < δ < 1 . Thus , the goal is to find Θ by optimizing equation 3 while ensuring RDP ( Definition 2 ) . It is clear that node-level privacy is essential when training models on graph datasets with sensitive node-level information . However , node-level privacy is significantly harder to achieve than the weaker notion of edge-level privacy . In the context of GNNs , the representation for a node is computed using not just the node ’ s individual features , but also features of other nodes from the local neighbourhood . Thus , the removal of a node from a graph dataset affects its entire local neighbourhood , which can be a very large set of nodes . This is in contrast to the standard non-graph setting for differentially private models , where the representation of individual users would only depend on the user ’ s own data . We now define two concepts that are critical in our design and analysis of a private GNN learning method . Definition 3 . The node-level sensitivity ∆ ( f ) of a function f defined on graph datasets is : ∆ ( f ) = max node-level adjacent G , G′ ‖f ( G ) − f ( G′ ) ‖2 The K-restricted node-level sensitivity ∆K ( f ) of a function f defined on graph datasets is : ∆K ( f ) = max deg ( G ) , deg ( G′ ) ≤K node-level adjacent G , G′ ‖f ( G ) − f ( G′ ) ‖2 Definition 4 . We define the clipping operator ClipC ( . ) as : ClipC ( v ) = min ( 1 , C‖v‖F ) · v , for any vector or matrix v. 2 The analysis here holds for multi-label settings as well , which would instead use loss functions such as sigmoidal cross-entropy , for example . Algorithm 1 : DP-GNN ( SGD ) : Differentially Private Graph Neural Network with SGD Data : Graph G = ( V , E , X , Y ) , GNN definition GNN , Training set Vtr , Loss function L , Batch size m , Maximum degree K , Learning rate η , Clipping threshold C , Noise standard deviation σ , Maximum training iterations T . Result : GNN parameters ΘT . Note that Vtr is the subset of nodes for which labels are available ( see Paragraph 1 of Section 3 ) . Using Vtr , construct the set of training subgraphs Str with Algorithm 2 . Construct the 0− 1 adjacency matrix A : Avu = 1 ⇐⇒ ( v , u ) ∈ Str Initialize Θ0 randomly . for t = 0 to T do Sample set Bt ⊆ Vtr of size m uniformly at random from all subsets of Vtr . Compute the update term ut as the sum of the clipped gradient terms in the batch Bt : ut ← ∑ v∈Bt ClipC ( ∇Θ ` ( GNN ( A , X , v ; Θt ) ; yv ) ) Add independent Gaussian noise to the update term : ũt ← ut +N ( 0 , σ2I ) Update the current estimate of the parameters with the noisy update : Θt+1 ← Θt − ηm ũt end
The paper claim to proposed a novel training method of GNN under providing both node feature and adjacency privacy. Their main approach is to use existed differential privacy framework into GNN world. They claim that providing privacy on both node feature and their connectivity is novel.
SP:34424377334de88c4d17eddc92d3848bfc622b3a
Learning Long-Term Reward Redistribution via Randomized Return Decomposition
1 INTRODUCTION . Scaling reinforcement learning ( RL ) algorithms to practical applications has become the focus of numerous recent studies , including resource management ( Mao et al. , 2016 ) , industrial control ( Hein et al. , 2017 ) , drug discovery ( Popova et al. , 2018 ) , and recommendation systems ( Chen et al. , 2018 ) . One of the challenges in these real-world problems is the sparse and delayed environmental rewards . For example , in the molecular structure design problem , the target molecule property can only be evaluated after completing the whole sequence of modification operations ( Zhou et al. , 2019b ) . The sparsity of environmental feedback would complicate the attribution of rewards on agent actions and therefore can hinder the efficiency of learning ( Rahmandad et al. , 2009 ) . In practice , it is a common choice to formulate the RL objective with a meticulously designed reward function instead of the sparse environmental rewards . The design of such a reward function is crucial to the performance of the learned polices . Most standard RL algorithms , such as temporal difference learning and policy gradient methods , prefer dense reward functions that can provide instant feedback for every step of environment transitions . Designing such dense reward functions is not a simple problem even with domain knowledge and human supervision . It has been widely observed in prior works that handcrafted heuristic reward functions may lead to unexpected and undesired behaviors ( Randløv & Alstrøm , 1998 ; Bottou et al. , 2013 ; Andrychowicz et al. , 2017 ) . The agent may find a shortcut solution that formally optimizes the given objective but deviates from the desired polices ( Dewey , 2014 ; Amodei et al. , 2016 ) . The reward designer can hardly anticipate all potential side effects of the designed reward function , which highlights the difficulty of reward engineering . To avoid the unintended behaviors induced by misspecified reward engineering , a common paradigm is considering the reward design as an online problem within the trial-and-error loop of reinforcement learning ( Sorg et al. , 2010 ) . This algorithmic framework contains two components , namely reward modeling and policy optimization . The agent first learns a proxy reward function from the experience data and then optimizes its policy based on the learned per-step rewards . By iterating this procedure and interacting with the environment , the agent is able to continuously refine its reward model so that the learned proxy reward function can better approximate the actual objective given by the environmental feedback . More specifically , this paradigm aims to reshape the sparse and delayed environmental rewards to a dense Markovian reward function while trying to avoid misspecifying the goal of given tasks . In this paper , we propose a novel reward redistribution algorithm based on a classical mechanism called return decomposition ( Arjona-Medina et al. , 2019 ) . Our method is built upon the leastsquares-based return decomposition ( Efroni et al. , 2021 ) whose basic idea is training a regression model that decomposes the trajectory return to the summation of per-step proxy rewards . This paradigm is a promising approach to redistributing sparse environmental feedback . Our proposed algorithm , randomized return decomposition ( RRD ) , establish a surrogate optimization of return decomposition to improve the scalability in long-horizon tasks . In this surrogate problem , the reward model is trained to predict the episodic return from a random subsequence of the agent trajectory , i.e. , we conduct a structural constraint that the learned proxy rewards can approximately reconstruct environmental trajectory return from a small subset of state-action pairs . This design enables us to conduct return decomposition effectively by mini-batch training . Our analysis shows that our surrogate loss function is an upper bound of the original loss of deterministic return decomposition , which gives a theoretical interpretation of this randomized implementation . We also present how the surrogate gap can be controlled and draw connections to another method called uniform reward redistribution . In experiments , we demonstrate substantial improvement of our proposed approach over baseline algorithms on a suite of MuJoCo benchmark tasks with episodic rewards . 2 BACKGROUND . 2.1 EPISODIC REINFORCEMENT LEARNING WITH TRAJECTORY FEEDBACK . In standard reinforcement learning settings , the environment model is usually formulated by a Markov decision process ( MDP ; Bellman , 1957 ) , defined as a tuple M = 〈S , A , P , R , µ〉 , where S and A denote the spaces of environment states and agent actions . P ( s′|s , a ) and R ( s , a ) denote the unknown environment transition and reward functions . µ denotes the initial state distribution . The goal of reinforcement learning is to find a policy π : S → A maximizing cumulative rewards . More specifically , a common objective is maximizing infinite-horizon discounted rewards based on a pre-defined discount factor γ as follows : ( standard objective ) J ( π ) = E [ ∞∑ t=0 γtR ( st , π ( st ) ) ∣∣∣∣∣ s0 ∼ µ , st+1 ∼ P ( · | st , π ( st ) ) ] . ( 1 ) In this paper , we consider the episodic reinforcement learning setting with trajectory feedback , in which the agent can only obtain one reward feedback at the end of each trajectory . Let τ denote an agent trajectory that contains all experienced states and behaved actions within an episode . We assume all trajectories terminate in finite steps . The episodic reward function Rep ( τ ) is defined on the trajectory space , which represents the overall performance of trajectory τ . The goal of episodic reinforcement learning is to maximize the expected trajectory return : ( episodic objective ) Jep ( π ) = E [ Rep ( τ ) ∣∣∣∣ s0 ∼ µ , at = π ( st ) , τ = 〈s0 , a0 , s1 , · · · , sT 〉 ] . ( 2 ) In general , the episodic-reward setting is a particular form of partially observable Markov decision processes ( POMDPs ) where the reward function is non-Markovian . The worst case may require the agent to enumerate the entire exponential-size trajectory space for recovering the episodic reward function . In practical problems , the episodic environmental feedback usually has structured representations . A common structural assumption is the existence of an underlying Markovian reward function R̂ ( s , a ) that approximates the episodic reward Rep ( τ ) by a sum-form decomposition , ( sum-decomposable episodic reward ) Rep ( τ ) ≈ R̂ep ( τ ) = T−1∑ t=0 R̂ ( st , at ) . ( 3 ) This structure is commonly considered by both theoretical ( Efroni et al. , 2021 ) and empirical studies ( Liu et al. , 2019 ; Raposo et al. , 2021 ) on long-horizon episodic rewards . It models the situations where the agent objective is measured by some metric with additivity properties , e.g. , the distance of robot running , the time cost of navigation , or the number of products produced in a time interval . 2.2 REWARD REDISTRIBUTION . The goal of reward redistribution is constructing a proxy reward function R̂ ( st , at ) that transforms the episodic-reward problem stated in Eq . ( 2 ) to a standard dense-reward setting . By replacing environmental rewards with such a Markovian proxy reward function R̂ ( st , at ) , the agent can be trained to optimize the discounted objective in Eq . ( 1 ) using any standard RL algorithms . Formally , the proxy rewards R̂ ( st , at ) form a sum-decomposable reward function R̂ep ( τ ) = ∑T−1 t=0 R̂ ( st , at ) that is expected to have high correlation to the environmental reward Rep ( τ ) . Here , we introduce two branches of existing reward redistribution methods , return decomposition and uniform reward redistribution , which are the most related to our proposed approach . We defer the discussions of other related work to section 5 . Return Decomposition . The idea of return decomposition is training a reward model that predicts the trajectory return with a given state-action sequence ( Arjona-Medina et al. , 2019 ) . In this paper , without further specification , we focus on the least-squares-based implementation of return decomposition ( Efroni et al. , 2021 ) . The reward redistribution is given by the learned reward model , i.e. , decomposing the environmental episodic reward Rep ( τ ) to a Markovian proxy reward function R̂ ( s , a ) . In practice , the reward modeling is formulated by optimizing the following loss function : LRD ( θ ) = E τ∼D [ ( Rep ( τ ) − T−1∑ t=0 R̂θ ( st , at ) ) 2 ] , ( 4 ) where R̂θ denotes the parameterized proxy reward function , θ denotes the parameters of the learned reward model , and D denotes the experience dataset collected by the agent . Assuming the sumdecomposable structure stated in Eq . ( 3 ) , R̂θ ( s , a ) is expected to asymptotically concentrate near the ground-truth underlying rewards R̂ ( s , a ) when Eq . ( 4 ) is properly optimized ( Efroni et al. , 2021 ) . One limitation of the least-squares-based return decomposition method specified by Eq . ( 4 ) is its scalability in terms of the computation costs . Note that the trajectory-wise episodic reward is the only environmental supervision for reward modeling . Computing the loss function LRD ( θ ) with a single episodic reward label requires to enumerate all state-action pairs along the whole trajectory . This computation procedure can be expensive in numerous situations , e.g. , when the task horizon T is quite long , or the state space S is high-dimensional . To address this practical barrier , recent works focus on designing reward redistribution mechanisms that can be easily integrated in complex tasks . We will discuss the implementation subtlety of existing methods in section 4 . Uniform Reward Redistribution . To pursue a simple but effective reward redistribution mechanism , IRCR ( Gangwani et al. , 2020 ) considers uniform reward redistribution which assumes all state-action pairs equally contribute to the return value . It is designed to redistribute rewards in the absence of any prior structure or information . More specifically , the proxy reward R̂IRCR ( s , a ) is computed by averaging episodic return values over all experienced trajectories containing ( s , a ) , R̂IRCR ( s , a ) = E τ∼D [ Rep ( τ ) | ( s , a ) ∈ τ ] . ( 5 ) In this paper , we will introduce a novel reward redistribution mechanism that bridges between return decomposition and uniform reward redistribution . 3 REWARD REDISTRIBUTION VIA RANDOMIZED RETURN DECOMPOSITION . In this section , we introduce our approach , randomized return decomposition ( RRD ) , which sets up a surrogate optimization problem of the least-squares-based return decomposition . The proposed surrogate objective allows us to conduct return decomposition on short subsequences of agent trajectories , which is scalable in long-horizon tasks . We provide analyses to characterize the algorithmic property of our surrogate objective function and discuss connections to existing methods . 3.1 RANDOMIZED RETURN DECOMPOSITION WITH MONTE-CARLO RETURN ESTIMATION . One practical barrier to apply least-squares-based return decomposition methods in long-horizon tasks is the computation costs of the regression loss in Eq . ( 4 ) , i.e. , it requires to enumerate all state- action pairs within the agent trajectory . To resolve this issue , we consider a randomized method that uses a Monte-Carlo estimator to compute the predicted episodic return R̂ep , θ ( τ ) as follows : R̂ep , θ ( τ ) = T−1∑ t=0 R̂θ ( st , at ) ︸ ︷︷ ︸ Deterministic Computation = E I∼ρT ( · ) [ T |I| ∑ t∈I R̂θ ( st , at ) ] ≈ T |I| ∑ t∈I R̂θ ( st , at ) ︸ ︷︷ ︸ Monte-Carlo Estimation , ( 6 ) where I denotes a subset of indices . ρT ( · ) denotes an unbiased sampling distribution where each index t has the same probability to be included in I . In this paper , without further specification , ρT ( · ) is constructed by uniformly sampling K distinct indices . ρT ( · ) = Uniform ( { I ⊆ ZT : |I| = K } ) , ( 7 ) whereK is a hyper-parameter . In this sampling distribution , each timestep t has the same probability to be covered by the sampled subsequence I ∼ ρT ( · ) so that it gives an unbiased Monte-Carlo estimation of the episodic summation R̂ep , θ ( τ ) . Randomized Return Decomposition . Based on the idea of using Monte-Carlo estimation shown in Eq . ( 6 ) , we introduce our approach , randomized return decomposition ( RRD ) , to improve the scalability of least-squares-based reward redistribution methods . The objective function of our approach is formulated by the randomized return decomposition loss LRand-RD ( θ ) stated in Eq . ( 8 ) , in which the parameterized proxy reward function R̂θ is trained to predict the episodic return Rep ( τ ) given a random subsequence of the agent trajectory . In other words , we integrate the Monte-Carlo estimator ( see Eq . ( 6 ) ) into the return decomposition loss to obtain the following surrogate loss function : LRand-RD ( θ ) = E τ∼D [ E I∼ρT ( · ) [ ( Rep ( τ ) − T |I| ∑ t∈I R̂θ ( st , at ) ) 2 ] ] . ( 8 ) In practice , the loss function LRand-RD ( θ ) can be estimated by sampling a mini-batch of trajectory subsequences instead of computing R̂θ ( st , at ) for the whole agent trajectory , and thus the implementation of randomized return decomposition is adaptive and flexible in long-horizon tasks .
This paper addresses the delayed reward problem in reinforcement learning (RL). The authors propose an algorithm, randomized return decomposition (RRD), that learns a proxy reward function to provide immediate reward feedback to the RL agent. Theoretical analysis shows that RRD is an interpolation between two existing methods, namely deterministic return decomposition and uniform credit assignment. RRD can be interpreted as a regularized version of the deterministic return decomposition and is a generalization of uniform credit assignment. Empirical results in the Mujoco continuous control benchmark show that RRD performs better than algorithms that are based on deterministic return decomposition and uniform credit assignment, and two other methods that learn auxiliary rewards for facilitating policy learning.
SP:64a07ca5ceb525ba6f708c05548e9d298e99a349
Learning Long-Term Reward Redistribution via Randomized Return Decomposition
1 INTRODUCTION . Scaling reinforcement learning ( RL ) algorithms to practical applications has become the focus of numerous recent studies , including resource management ( Mao et al. , 2016 ) , industrial control ( Hein et al. , 2017 ) , drug discovery ( Popova et al. , 2018 ) , and recommendation systems ( Chen et al. , 2018 ) . One of the challenges in these real-world problems is the sparse and delayed environmental rewards . For example , in the molecular structure design problem , the target molecule property can only be evaluated after completing the whole sequence of modification operations ( Zhou et al. , 2019b ) . The sparsity of environmental feedback would complicate the attribution of rewards on agent actions and therefore can hinder the efficiency of learning ( Rahmandad et al. , 2009 ) . In practice , it is a common choice to formulate the RL objective with a meticulously designed reward function instead of the sparse environmental rewards . The design of such a reward function is crucial to the performance of the learned polices . Most standard RL algorithms , such as temporal difference learning and policy gradient methods , prefer dense reward functions that can provide instant feedback for every step of environment transitions . Designing such dense reward functions is not a simple problem even with domain knowledge and human supervision . It has been widely observed in prior works that handcrafted heuristic reward functions may lead to unexpected and undesired behaviors ( Randløv & Alstrøm , 1998 ; Bottou et al. , 2013 ; Andrychowicz et al. , 2017 ) . The agent may find a shortcut solution that formally optimizes the given objective but deviates from the desired polices ( Dewey , 2014 ; Amodei et al. , 2016 ) . The reward designer can hardly anticipate all potential side effects of the designed reward function , which highlights the difficulty of reward engineering . To avoid the unintended behaviors induced by misspecified reward engineering , a common paradigm is considering the reward design as an online problem within the trial-and-error loop of reinforcement learning ( Sorg et al. , 2010 ) . This algorithmic framework contains two components , namely reward modeling and policy optimization . The agent first learns a proxy reward function from the experience data and then optimizes its policy based on the learned per-step rewards . By iterating this procedure and interacting with the environment , the agent is able to continuously refine its reward model so that the learned proxy reward function can better approximate the actual objective given by the environmental feedback . More specifically , this paradigm aims to reshape the sparse and delayed environmental rewards to a dense Markovian reward function while trying to avoid misspecifying the goal of given tasks . In this paper , we propose a novel reward redistribution algorithm based on a classical mechanism called return decomposition ( Arjona-Medina et al. , 2019 ) . Our method is built upon the leastsquares-based return decomposition ( Efroni et al. , 2021 ) whose basic idea is training a regression model that decomposes the trajectory return to the summation of per-step proxy rewards . This paradigm is a promising approach to redistributing sparse environmental feedback . Our proposed algorithm , randomized return decomposition ( RRD ) , establish a surrogate optimization of return decomposition to improve the scalability in long-horizon tasks . In this surrogate problem , the reward model is trained to predict the episodic return from a random subsequence of the agent trajectory , i.e. , we conduct a structural constraint that the learned proxy rewards can approximately reconstruct environmental trajectory return from a small subset of state-action pairs . This design enables us to conduct return decomposition effectively by mini-batch training . Our analysis shows that our surrogate loss function is an upper bound of the original loss of deterministic return decomposition , which gives a theoretical interpretation of this randomized implementation . We also present how the surrogate gap can be controlled and draw connections to another method called uniform reward redistribution . In experiments , we demonstrate substantial improvement of our proposed approach over baseline algorithms on a suite of MuJoCo benchmark tasks with episodic rewards . 2 BACKGROUND . 2.1 EPISODIC REINFORCEMENT LEARNING WITH TRAJECTORY FEEDBACK . In standard reinforcement learning settings , the environment model is usually formulated by a Markov decision process ( MDP ; Bellman , 1957 ) , defined as a tuple M = 〈S , A , P , R , µ〉 , where S and A denote the spaces of environment states and agent actions . P ( s′|s , a ) and R ( s , a ) denote the unknown environment transition and reward functions . µ denotes the initial state distribution . The goal of reinforcement learning is to find a policy π : S → A maximizing cumulative rewards . More specifically , a common objective is maximizing infinite-horizon discounted rewards based on a pre-defined discount factor γ as follows : ( standard objective ) J ( π ) = E [ ∞∑ t=0 γtR ( st , π ( st ) ) ∣∣∣∣∣ s0 ∼ µ , st+1 ∼ P ( · | st , π ( st ) ) ] . ( 1 ) In this paper , we consider the episodic reinforcement learning setting with trajectory feedback , in which the agent can only obtain one reward feedback at the end of each trajectory . Let τ denote an agent trajectory that contains all experienced states and behaved actions within an episode . We assume all trajectories terminate in finite steps . The episodic reward function Rep ( τ ) is defined on the trajectory space , which represents the overall performance of trajectory τ . The goal of episodic reinforcement learning is to maximize the expected trajectory return : ( episodic objective ) Jep ( π ) = E [ Rep ( τ ) ∣∣∣∣ s0 ∼ µ , at = π ( st ) , τ = 〈s0 , a0 , s1 , · · · , sT 〉 ] . ( 2 ) In general , the episodic-reward setting is a particular form of partially observable Markov decision processes ( POMDPs ) where the reward function is non-Markovian . The worst case may require the agent to enumerate the entire exponential-size trajectory space for recovering the episodic reward function . In practical problems , the episodic environmental feedback usually has structured representations . A common structural assumption is the existence of an underlying Markovian reward function R̂ ( s , a ) that approximates the episodic reward Rep ( τ ) by a sum-form decomposition , ( sum-decomposable episodic reward ) Rep ( τ ) ≈ R̂ep ( τ ) = T−1∑ t=0 R̂ ( st , at ) . ( 3 ) This structure is commonly considered by both theoretical ( Efroni et al. , 2021 ) and empirical studies ( Liu et al. , 2019 ; Raposo et al. , 2021 ) on long-horizon episodic rewards . It models the situations where the agent objective is measured by some metric with additivity properties , e.g. , the distance of robot running , the time cost of navigation , or the number of products produced in a time interval . 2.2 REWARD REDISTRIBUTION . The goal of reward redistribution is constructing a proxy reward function R̂ ( st , at ) that transforms the episodic-reward problem stated in Eq . ( 2 ) to a standard dense-reward setting . By replacing environmental rewards with such a Markovian proxy reward function R̂ ( st , at ) , the agent can be trained to optimize the discounted objective in Eq . ( 1 ) using any standard RL algorithms . Formally , the proxy rewards R̂ ( st , at ) form a sum-decomposable reward function R̂ep ( τ ) = ∑T−1 t=0 R̂ ( st , at ) that is expected to have high correlation to the environmental reward Rep ( τ ) . Here , we introduce two branches of existing reward redistribution methods , return decomposition and uniform reward redistribution , which are the most related to our proposed approach . We defer the discussions of other related work to section 5 . Return Decomposition . The idea of return decomposition is training a reward model that predicts the trajectory return with a given state-action sequence ( Arjona-Medina et al. , 2019 ) . In this paper , without further specification , we focus on the least-squares-based implementation of return decomposition ( Efroni et al. , 2021 ) . The reward redistribution is given by the learned reward model , i.e. , decomposing the environmental episodic reward Rep ( τ ) to a Markovian proxy reward function R̂ ( s , a ) . In practice , the reward modeling is formulated by optimizing the following loss function : LRD ( θ ) = E τ∼D [ ( Rep ( τ ) − T−1∑ t=0 R̂θ ( st , at ) ) 2 ] , ( 4 ) where R̂θ denotes the parameterized proxy reward function , θ denotes the parameters of the learned reward model , and D denotes the experience dataset collected by the agent . Assuming the sumdecomposable structure stated in Eq . ( 3 ) , R̂θ ( s , a ) is expected to asymptotically concentrate near the ground-truth underlying rewards R̂ ( s , a ) when Eq . ( 4 ) is properly optimized ( Efroni et al. , 2021 ) . One limitation of the least-squares-based return decomposition method specified by Eq . ( 4 ) is its scalability in terms of the computation costs . Note that the trajectory-wise episodic reward is the only environmental supervision for reward modeling . Computing the loss function LRD ( θ ) with a single episodic reward label requires to enumerate all state-action pairs along the whole trajectory . This computation procedure can be expensive in numerous situations , e.g. , when the task horizon T is quite long , or the state space S is high-dimensional . To address this practical barrier , recent works focus on designing reward redistribution mechanisms that can be easily integrated in complex tasks . We will discuss the implementation subtlety of existing methods in section 4 . Uniform Reward Redistribution . To pursue a simple but effective reward redistribution mechanism , IRCR ( Gangwani et al. , 2020 ) considers uniform reward redistribution which assumes all state-action pairs equally contribute to the return value . It is designed to redistribute rewards in the absence of any prior structure or information . More specifically , the proxy reward R̂IRCR ( s , a ) is computed by averaging episodic return values over all experienced trajectories containing ( s , a ) , R̂IRCR ( s , a ) = E τ∼D [ Rep ( τ ) | ( s , a ) ∈ τ ] . ( 5 ) In this paper , we will introduce a novel reward redistribution mechanism that bridges between return decomposition and uniform reward redistribution . 3 REWARD REDISTRIBUTION VIA RANDOMIZED RETURN DECOMPOSITION . In this section , we introduce our approach , randomized return decomposition ( RRD ) , which sets up a surrogate optimization problem of the least-squares-based return decomposition . The proposed surrogate objective allows us to conduct return decomposition on short subsequences of agent trajectories , which is scalable in long-horizon tasks . We provide analyses to characterize the algorithmic property of our surrogate objective function and discuss connections to existing methods . 3.1 RANDOMIZED RETURN DECOMPOSITION WITH MONTE-CARLO RETURN ESTIMATION . One practical barrier to apply least-squares-based return decomposition methods in long-horizon tasks is the computation costs of the regression loss in Eq . ( 4 ) , i.e. , it requires to enumerate all state- action pairs within the agent trajectory . To resolve this issue , we consider a randomized method that uses a Monte-Carlo estimator to compute the predicted episodic return R̂ep , θ ( τ ) as follows : R̂ep , θ ( τ ) = T−1∑ t=0 R̂θ ( st , at ) ︸ ︷︷ ︸ Deterministic Computation = E I∼ρT ( · ) [ T |I| ∑ t∈I R̂θ ( st , at ) ] ≈ T |I| ∑ t∈I R̂θ ( st , at ) ︸ ︷︷ ︸ Monte-Carlo Estimation , ( 6 ) where I denotes a subset of indices . ρT ( · ) denotes an unbiased sampling distribution where each index t has the same probability to be included in I . In this paper , without further specification , ρT ( · ) is constructed by uniformly sampling K distinct indices . ρT ( · ) = Uniform ( { I ⊆ ZT : |I| = K } ) , ( 7 ) whereK is a hyper-parameter . In this sampling distribution , each timestep t has the same probability to be covered by the sampled subsequence I ∼ ρT ( · ) so that it gives an unbiased Monte-Carlo estimation of the episodic summation R̂ep , θ ( τ ) . Randomized Return Decomposition . Based on the idea of using Monte-Carlo estimation shown in Eq . ( 6 ) , we introduce our approach , randomized return decomposition ( RRD ) , to improve the scalability of least-squares-based reward redistribution methods . The objective function of our approach is formulated by the randomized return decomposition loss LRand-RD ( θ ) stated in Eq . ( 8 ) , in which the parameterized proxy reward function R̂θ is trained to predict the episodic return Rep ( τ ) given a random subsequence of the agent trajectory . In other words , we integrate the Monte-Carlo estimator ( see Eq . ( 6 ) ) into the return decomposition loss to obtain the following surrogate loss function : LRand-RD ( θ ) = E τ∼D [ E I∼ρT ( · ) [ ( Rep ( τ ) − T |I| ∑ t∈I R̂θ ( st , at ) ) 2 ] ] . ( 8 ) In practice , the loss function LRand-RD ( θ ) can be estimated by sampling a mini-batch of trajectory subsequences instead of computing R̂θ ( st , at ) for the whole agent trajectory , and thus the implementation of randomized return decomposition is adaptive and flexible in long-horizon tasks .
This paper targets how to decompose delayed reward signals obtained at the end of a trajectory to a more immediate form of reward feedback. The authors introduce an algorithm, "Reward Distribution vis Randomized Return Decomposition" that serves as a proxy reward function for episodic reinforcement learning. The authors showcase extensive experiments showcasing improved performance over relevant baselines on common Mujoco benchmarks. The main contribution is to convert long horizon delayed reward problems to more short length sequences that can be trained upon with mini-batch gradient descent.
SP:64a07ca5ceb525ba6f708c05548e9d298e99a349
Learning Long-Term Reward Redistribution via Randomized Return Decomposition
1 INTRODUCTION . Scaling reinforcement learning ( RL ) algorithms to practical applications has become the focus of numerous recent studies , including resource management ( Mao et al. , 2016 ) , industrial control ( Hein et al. , 2017 ) , drug discovery ( Popova et al. , 2018 ) , and recommendation systems ( Chen et al. , 2018 ) . One of the challenges in these real-world problems is the sparse and delayed environmental rewards . For example , in the molecular structure design problem , the target molecule property can only be evaluated after completing the whole sequence of modification operations ( Zhou et al. , 2019b ) . The sparsity of environmental feedback would complicate the attribution of rewards on agent actions and therefore can hinder the efficiency of learning ( Rahmandad et al. , 2009 ) . In practice , it is a common choice to formulate the RL objective with a meticulously designed reward function instead of the sparse environmental rewards . The design of such a reward function is crucial to the performance of the learned polices . Most standard RL algorithms , such as temporal difference learning and policy gradient methods , prefer dense reward functions that can provide instant feedback for every step of environment transitions . Designing such dense reward functions is not a simple problem even with domain knowledge and human supervision . It has been widely observed in prior works that handcrafted heuristic reward functions may lead to unexpected and undesired behaviors ( Randløv & Alstrøm , 1998 ; Bottou et al. , 2013 ; Andrychowicz et al. , 2017 ) . The agent may find a shortcut solution that formally optimizes the given objective but deviates from the desired polices ( Dewey , 2014 ; Amodei et al. , 2016 ) . The reward designer can hardly anticipate all potential side effects of the designed reward function , which highlights the difficulty of reward engineering . To avoid the unintended behaviors induced by misspecified reward engineering , a common paradigm is considering the reward design as an online problem within the trial-and-error loop of reinforcement learning ( Sorg et al. , 2010 ) . This algorithmic framework contains two components , namely reward modeling and policy optimization . The agent first learns a proxy reward function from the experience data and then optimizes its policy based on the learned per-step rewards . By iterating this procedure and interacting with the environment , the agent is able to continuously refine its reward model so that the learned proxy reward function can better approximate the actual objective given by the environmental feedback . More specifically , this paradigm aims to reshape the sparse and delayed environmental rewards to a dense Markovian reward function while trying to avoid misspecifying the goal of given tasks . In this paper , we propose a novel reward redistribution algorithm based on a classical mechanism called return decomposition ( Arjona-Medina et al. , 2019 ) . Our method is built upon the leastsquares-based return decomposition ( Efroni et al. , 2021 ) whose basic idea is training a regression model that decomposes the trajectory return to the summation of per-step proxy rewards . This paradigm is a promising approach to redistributing sparse environmental feedback . Our proposed algorithm , randomized return decomposition ( RRD ) , establish a surrogate optimization of return decomposition to improve the scalability in long-horizon tasks . In this surrogate problem , the reward model is trained to predict the episodic return from a random subsequence of the agent trajectory , i.e. , we conduct a structural constraint that the learned proxy rewards can approximately reconstruct environmental trajectory return from a small subset of state-action pairs . This design enables us to conduct return decomposition effectively by mini-batch training . Our analysis shows that our surrogate loss function is an upper bound of the original loss of deterministic return decomposition , which gives a theoretical interpretation of this randomized implementation . We also present how the surrogate gap can be controlled and draw connections to another method called uniform reward redistribution . In experiments , we demonstrate substantial improvement of our proposed approach over baseline algorithms on a suite of MuJoCo benchmark tasks with episodic rewards . 2 BACKGROUND . 2.1 EPISODIC REINFORCEMENT LEARNING WITH TRAJECTORY FEEDBACK . In standard reinforcement learning settings , the environment model is usually formulated by a Markov decision process ( MDP ; Bellman , 1957 ) , defined as a tuple M = 〈S , A , P , R , µ〉 , where S and A denote the spaces of environment states and agent actions . P ( s′|s , a ) and R ( s , a ) denote the unknown environment transition and reward functions . µ denotes the initial state distribution . The goal of reinforcement learning is to find a policy π : S → A maximizing cumulative rewards . More specifically , a common objective is maximizing infinite-horizon discounted rewards based on a pre-defined discount factor γ as follows : ( standard objective ) J ( π ) = E [ ∞∑ t=0 γtR ( st , π ( st ) ) ∣∣∣∣∣ s0 ∼ µ , st+1 ∼ P ( · | st , π ( st ) ) ] . ( 1 ) In this paper , we consider the episodic reinforcement learning setting with trajectory feedback , in which the agent can only obtain one reward feedback at the end of each trajectory . Let τ denote an agent trajectory that contains all experienced states and behaved actions within an episode . We assume all trajectories terminate in finite steps . The episodic reward function Rep ( τ ) is defined on the trajectory space , which represents the overall performance of trajectory τ . The goal of episodic reinforcement learning is to maximize the expected trajectory return : ( episodic objective ) Jep ( π ) = E [ Rep ( τ ) ∣∣∣∣ s0 ∼ µ , at = π ( st ) , τ = 〈s0 , a0 , s1 , · · · , sT 〉 ] . ( 2 ) In general , the episodic-reward setting is a particular form of partially observable Markov decision processes ( POMDPs ) where the reward function is non-Markovian . The worst case may require the agent to enumerate the entire exponential-size trajectory space for recovering the episodic reward function . In practical problems , the episodic environmental feedback usually has structured representations . A common structural assumption is the existence of an underlying Markovian reward function R̂ ( s , a ) that approximates the episodic reward Rep ( τ ) by a sum-form decomposition , ( sum-decomposable episodic reward ) Rep ( τ ) ≈ R̂ep ( τ ) = T−1∑ t=0 R̂ ( st , at ) . ( 3 ) This structure is commonly considered by both theoretical ( Efroni et al. , 2021 ) and empirical studies ( Liu et al. , 2019 ; Raposo et al. , 2021 ) on long-horizon episodic rewards . It models the situations where the agent objective is measured by some metric with additivity properties , e.g. , the distance of robot running , the time cost of navigation , or the number of products produced in a time interval . 2.2 REWARD REDISTRIBUTION . The goal of reward redistribution is constructing a proxy reward function R̂ ( st , at ) that transforms the episodic-reward problem stated in Eq . ( 2 ) to a standard dense-reward setting . By replacing environmental rewards with such a Markovian proxy reward function R̂ ( st , at ) , the agent can be trained to optimize the discounted objective in Eq . ( 1 ) using any standard RL algorithms . Formally , the proxy rewards R̂ ( st , at ) form a sum-decomposable reward function R̂ep ( τ ) = ∑T−1 t=0 R̂ ( st , at ) that is expected to have high correlation to the environmental reward Rep ( τ ) . Here , we introduce two branches of existing reward redistribution methods , return decomposition and uniform reward redistribution , which are the most related to our proposed approach . We defer the discussions of other related work to section 5 . Return Decomposition . The idea of return decomposition is training a reward model that predicts the trajectory return with a given state-action sequence ( Arjona-Medina et al. , 2019 ) . In this paper , without further specification , we focus on the least-squares-based implementation of return decomposition ( Efroni et al. , 2021 ) . The reward redistribution is given by the learned reward model , i.e. , decomposing the environmental episodic reward Rep ( τ ) to a Markovian proxy reward function R̂ ( s , a ) . In practice , the reward modeling is formulated by optimizing the following loss function : LRD ( θ ) = E τ∼D [ ( Rep ( τ ) − T−1∑ t=0 R̂θ ( st , at ) ) 2 ] , ( 4 ) where R̂θ denotes the parameterized proxy reward function , θ denotes the parameters of the learned reward model , and D denotes the experience dataset collected by the agent . Assuming the sumdecomposable structure stated in Eq . ( 3 ) , R̂θ ( s , a ) is expected to asymptotically concentrate near the ground-truth underlying rewards R̂ ( s , a ) when Eq . ( 4 ) is properly optimized ( Efroni et al. , 2021 ) . One limitation of the least-squares-based return decomposition method specified by Eq . ( 4 ) is its scalability in terms of the computation costs . Note that the trajectory-wise episodic reward is the only environmental supervision for reward modeling . Computing the loss function LRD ( θ ) with a single episodic reward label requires to enumerate all state-action pairs along the whole trajectory . This computation procedure can be expensive in numerous situations , e.g. , when the task horizon T is quite long , or the state space S is high-dimensional . To address this practical barrier , recent works focus on designing reward redistribution mechanisms that can be easily integrated in complex tasks . We will discuss the implementation subtlety of existing methods in section 4 . Uniform Reward Redistribution . To pursue a simple but effective reward redistribution mechanism , IRCR ( Gangwani et al. , 2020 ) considers uniform reward redistribution which assumes all state-action pairs equally contribute to the return value . It is designed to redistribute rewards in the absence of any prior structure or information . More specifically , the proxy reward R̂IRCR ( s , a ) is computed by averaging episodic return values over all experienced trajectories containing ( s , a ) , R̂IRCR ( s , a ) = E τ∼D [ Rep ( τ ) | ( s , a ) ∈ τ ] . ( 5 ) In this paper , we will introduce a novel reward redistribution mechanism that bridges between return decomposition and uniform reward redistribution . 3 REWARD REDISTRIBUTION VIA RANDOMIZED RETURN DECOMPOSITION . In this section , we introduce our approach , randomized return decomposition ( RRD ) , which sets up a surrogate optimization problem of the least-squares-based return decomposition . The proposed surrogate objective allows us to conduct return decomposition on short subsequences of agent trajectories , which is scalable in long-horizon tasks . We provide analyses to characterize the algorithmic property of our surrogate objective function and discuss connections to existing methods . 3.1 RANDOMIZED RETURN DECOMPOSITION WITH MONTE-CARLO RETURN ESTIMATION . One practical barrier to apply least-squares-based return decomposition methods in long-horizon tasks is the computation costs of the regression loss in Eq . ( 4 ) , i.e. , it requires to enumerate all state- action pairs within the agent trajectory . To resolve this issue , we consider a randomized method that uses a Monte-Carlo estimator to compute the predicted episodic return R̂ep , θ ( τ ) as follows : R̂ep , θ ( τ ) = T−1∑ t=0 R̂θ ( st , at ) ︸ ︷︷ ︸ Deterministic Computation = E I∼ρT ( · ) [ T |I| ∑ t∈I R̂θ ( st , at ) ] ≈ T |I| ∑ t∈I R̂θ ( st , at ) ︸ ︷︷ ︸ Monte-Carlo Estimation , ( 6 ) where I denotes a subset of indices . ρT ( · ) denotes an unbiased sampling distribution where each index t has the same probability to be included in I . In this paper , without further specification , ρT ( · ) is constructed by uniformly sampling K distinct indices . ρT ( · ) = Uniform ( { I ⊆ ZT : |I| = K } ) , ( 7 ) whereK is a hyper-parameter . In this sampling distribution , each timestep t has the same probability to be covered by the sampled subsequence I ∼ ρT ( · ) so that it gives an unbiased Monte-Carlo estimation of the episodic summation R̂ep , θ ( τ ) . Randomized Return Decomposition . Based on the idea of using Monte-Carlo estimation shown in Eq . ( 6 ) , we introduce our approach , randomized return decomposition ( RRD ) , to improve the scalability of least-squares-based reward redistribution methods . The objective function of our approach is formulated by the randomized return decomposition loss LRand-RD ( θ ) stated in Eq . ( 8 ) , in which the parameterized proxy reward function R̂θ is trained to predict the episodic return Rep ( τ ) given a random subsequence of the agent trajectory . In other words , we integrate the Monte-Carlo estimator ( see Eq . ( 6 ) ) into the return decomposition loss to obtain the following surrogate loss function : LRand-RD ( θ ) = E τ∼D [ E I∼ρT ( · ) [ ( Rep ( τ ) − T |I| ∑ t∈I R̂θ ( st , at ) ) 2 ] ] . ( 8 ) In practice , the loss function LRand-RD ( θ ) can be estimated by sampling a mini-batch of trajectory subsequences instead of computing R̂θ ( st , at ) for the whole agent trajectory , and thus the implementation of randomized return decomposition is adaptive and flexible in long-horizon tasks .
The paper addresses the problem of credit assignment in delayed reward setting. It does this by providing a new mechanism for reward redistribution. The authors claim that the new mechanism makes reward redistribution more scalable. The authors predict the return of a trajectory by using only random sub-sequences in the trajectory. Then the prediction model is used for assigning reward for state-action pairs.
SP:64a07ca5ceb525ba6f708c05548e9d298e99a349
On Predicting Generalization using GANs
1 INTRODUCTION . Why do vastly overparametrized neural networks achieve impressive generalization performance across many domains , with very limited capacity control during training ? Despite some promising initial research , the mechanism behind generalization remains poorly understood . A host of papers have tried to adapt classical generalization theory to prove upper bounds of the following form on the difference between training and test error : test− train ≤ √ C |S| + tiny term ( 1 ) where S is the training dataset and C is a so-called complexity measure , typically involving some function of the training dataset as well as the trained net parameters ( e.g. , a geometric norm ) . Current upper bounds of this type are loose , and even vacuous . There is evidence that such classically derived bounds may be too loose ( Dziugaite & Roy , 2017 ) or that they may not correlate well with generalization ( Jiang et al. , 2019 ) . This has motivated a more principled empirical study of the effectiveness of generalization bounds . The general idea is to use machine learning to determine which network characteristics promote good generalization in practice and which do not —in other words , treat various deep net characteristics/norms/margins etc . as inputs to a machine learning model that uses them to predict the generalization error achieved by the net . This could help direct theorists to new types of complexity measures and motivate new theories . A recently started competition of Predicting Generalization in Deep Learning ( Jiang et al. , 2020 ) ( PGDL ) seeks to increase interest in such investigations , in an effort to uncover new and promising network characteristics and/or measures of network complexity that correlate with good generalization . As required in Jiang et al . ( 2020 ) , a complexity measure should depend on the trained model , optimizer , and training set , but not the held out test data . The first PGDL competition in 2020 did uncover quite a few measures that seemed to be predictive of good generalization but had not been identified by theory work . In this paper , we explore a very simple baseline for predicting generalization that had hitherto not received attention : train a Generative Adversarial Network ( GAN ) on the training dataset , and use performance on the synthetic data produced by the GAN to predict generalization . At first sight GANs may not appear to be an obvious choice for this task , due to their well known limitations . For instance , while the goal of GANs training is to find a generator that fools the discriminator net —in the sense that the discriminator has low probability of spotting a difference between GAN samples and the samples from the true distribution—in practice the discriminator is often able to discriminate very well at the end , demonstrating that it was not fooled . Also , GANs ’ generators are known to exhibit mode collapse i.e. , the generated distribution is a tiny subset of the true distribution . There is theory and experiments suggesting this may be difficult to avoid ( Arora et al. , 2018 ; Santurkar et al. , 2018 ; Bau et al. , 2019 ) . Given all these negative results about GANs , the surprising finding in the current paper is that GANs do allow for good estimates of test error ( and generalization error ) . This is verified for families of well-known GANs and datasets including primarily CIFAR-10/100 , Tiny ImageNet and wellknown deep neural classifier architectures . In particular , in sections 3.1 and 3.2 we evaluate on the PGDL and DEMOGEN benchmarks of predicting generalization and present strong results . In Section 4 and 5 , we also investigate reasons behind the surprising efficacy of GANs in predicting generalization as well as the effects of using data augmentation during GAN training . 2 RELATED WORK . Generalization Bounds Traditional approaches to predict generalization construct a generalization bound based on some notion of capacity such as parameter count , VC dimension , Rademacher complexity , etc . Neyshabur et al . ( 2018 ) provide a tighter generalization bound that decreases with increasing number of hidden units . Dziugaite & Roy ( 2017 ) reveal a way to compute nonvacuous PAC-Bayes generalization bounds . Recently , bounds based on knowledge distillation have also come to light ( Hsu et al. , 2020 ) . Despite progress in these approaches , a study conducted by Jiang et al . ( 2019 ) with extensive hyper-parameter search showed that current generalization bounds may not be effective , and the root cause of generalization remains elusive . Given the arduous nature of constructing such bounds , an interest in complexity measures has arisen . Predicting Generalization in Deep Learning The PGDL competition ( Jiang et al. , 2020 ) was held in NeuRIPS 2020 in an effort to encourage the discovery of empirical generalization measures following the seminal work of Jiang et al . ( 2018 ) . The winner of the PGDL competition Natekar & Sharma ( 2020 ) investigated properties of representations in intermediate layers to predict generalization . Kashyap et al . ( 2021 ) , the second place winner , experiment with robustness to flips , random erasing , random saturation , and other such natural augmentations . Afterwards , Jiang et al . ( 2021 ) interestingly find that generalization can be predicted by running SGD on the same architecture multiple times , and measuring the disagreement ratio between the different resulting networks on an unlabeled test set . There are also some pitfalls in predicting generalization , as highlighted by Dziugaite et al . ( 2020 ) . They find that distributional robustness over a family of environments is more applicable to neural networks than straight averaging . Limitations of GANs Arora et al . ( 2017 ) prove the lack of diversity enforcing in GAN ’ s training objective , and Arora et al . ( 2018 ) introduce the Birthday Paradox test to conclude that many popular GAN models in practice do learn a distribution with relatively small support . Santurkar et al . ( 2018 ) and Bau et al . ( 2019 ) investigate the extent to which GAN generated samples can match the distributional statistics of the original training data , and find that they have significant shortcomings . Ravuri & Vinyals ( 2019 ) find that GAN data is of limited use in training ResNet models , and find that neither inception score nor FID are predictive of generalization performance . Notably , despite the small support , Arora et al . ( 2018 ) reveal that GANs generate distinct images from their nearest neighbours in the training set . Later , Webster et al . ( 2019 ) use latent recovery to conclude more carefully that GANs do not memorize the training set . Theoretical Justification for Using GANs Arora et al . ( 2017 ) construct a generator that passes training against any bounded capacity discriminator but can only generate a small number of distinct data points either from the true data distribution or simply from the training set . For predicting generalization , it is crucial for the generator not to memorize training data . While Arora et al . ( 2017 ) do not answer why GANs do not memorize training data , a recent empirical study by Huang et al . ( 2021 ) demonstrates the difficulty of recovering input data by inverting gradients . Their work may cast light on how the generator could learn to generate data distinct from the training set when trained with gradient feedbacks from the discriminator . However , we are not aware of any theory that fully explains GANs ’ strength for predicting generalization despite limitations . 3 PREDICTING TEST PERFORMANCE USING GAN SAMPLES . We now precisely define what it means to predict test performance in our setting . We denote by Strain , Stest and Ssyn the training set , test set and the synthetic dataset generated by GANs . Given a classifier f trained on the training set Strain , we aim to predict its classification accuracy g ( f ) : = 1 |Stest| ∑ ( x , y ) ∈Stest 1 [ f ( x ) = y ] on a test set Stest . Our proposal is to train a conditional GAN model on the very same training set Strain , and then sample from the generator a synthetic dataset Ssyn of labeled examples . In the end , we simply use f ’ s accuracy on the synthetic dataset as our prediction for its test accuracy . Algorithm 1 formally describes this procedure . Algorithm 1 Predicting test performance Require : target classifier f , training set Strain , GAN training algorithm A 1 . Train a conditional GAN model using Strain : G , D = A ( Strain ) where G , D are the generator and discriminator networks . 2 . Generate a synthetic dataset by sampling from the generator G : Ssyn = { ( x̃1 , ỹ1 ) , . . . , ( x̃N , ỹN ) } where x̃i , ỹi = G ( zi , ỹi ) . The zi ’ s are drawn i.i.d . from G ’ s default input distribution . N and ỹi ’ are chosen so as to match statistics of the training set . Output : the synthetic accuracy ĝ ( f ) : = 1|Ssyn| ∑ ( x̃ , ỹ ) ∈Ssyn 1 [ f ( x̃ ) = ỹ ] as the prediction Remark . Any N ≥ |Strain| is a safe choice to ensure that ĝ ( f ) concentrates1around its mean Ez , ỹ [ 1 [ f ( G ( z , ỹ ) ) = ỹ ] ] and its deviation has negligible influence on the performance . 1the deviation is only O ( 1/ √ N ) by standard concentration bounds We demonstrate in Figure 1 that the test accuracy g ( f ) consistently resides in a small neighborhood of ĝ ( f ) for a diverse class of deep neural net classifiers trained on different datasets . For the choice of GAN architecture , we adopt the pre-trained BigGAN+DiffAug models ( Brock et al. , 2019 ; Zhao et al. , 2020 ) from the StudioGAN library2 . We evaluate on pretrained deep neural net classifiers with architectures ranging from VGG- ( 11 , 13 , 19 ) , ResNet- ( 18 , 34 , 50 ) , DenseNet ( 121 , 169 ) , ShuffleNet , PNASNet and MobileNet trained on CIFAR-10 and Tiny ImageNet with hyper-parameter setting ( learning rate , weight decay factor , learning rate schedule ) uniformly sampled from the grid { 10−1 , 10−2 } × { 5× 10−4 , 10−3 } × { CosineAnnealing , ExponentialDecay } . We use SGD with momentum 0.9 and batch size 128 and data augmention of horizontal flips for training all classifiers . 3.1 EVALUATION ON PGDL COMPETITION . We evaluate our proposed method on the tasks of NeurIPS 2020 Competition on Predicting Generalization of Deep Learning . The PGDL competition consists of 8 tasks3 , each containing a set of pre-trained deep net classifiers of similar architectures but with different hyper-parameter settings , as well as the training data . The tasks of PGDL are based on a wide range of datasets inlcuding CIFAR-10 , SVHN , CINIC-10 , Oxford Flowers , Oxford Pets and Fashion MNIST . For every task , the goal is to compute a scalar prediction for each classifier based on its parameters and the training data that correlates as much as possible with the actual generalization errors of the classifiers measured on a test set . The correlation score is measured by the so-called Conditional Mutual Information , which is designed to indicate whether the computed predictions contain all the information about the generalization errors such that knowing the hyper-parameters does not provide additional information , see ( Jiang et al. , 2020 ) for details . Since the goal of PGDL is to predict generalization gap instead of test accuracy , our proposed solution is a slight adaptation of Algorithm 1 . For each task , we first train a GAN model on the provided training dataset and sample from it a labeled synthetic dataset . Then for each classifier within the task , instead of the raw synthetic accuracy , we use as prediction the gap between training and synthetic accuracies . For all tasks , we use BigGAN+diffAug with the default4 implementation for CIFAR-10 from the StudioGAN library . We found that a subset of them ( Task 6 with Oxford Flowers and Task 7 with Oxford Pets ) were not well-suited for standard GAN training without much tweaking due to a small training set and highly uneven class sizes . We focused only on the subset of the tasks where GAN training worked out of the box , specifically Task 1 , 2 , 4 , 5 , 8 , and 9 . 2available at https : //github.com/POSTECH-CVLab/PyTorch-StudioGAN 3namely Task 1 , 2 , 4 , 5 , 6 , 7 , 8 , 9 , without 3 . 4Task 8 uses the single-channel 28×28 Fashion-MNIST dataset . For GAN training , we symmetrically zeropad the training images to 32 × 32 and convert to RGB by replicating the channel . To compute the synthetic accuracy , we convert the generated images back to single-channel and perform a center cropping . We report the results in Table 1 , where we observe that on tasks involving either CIFAR-10 or VGGlike classifiers , our proposed solution out-performs all of the solutions from the top 3 teams of the competition by a large margin . One potential reason may be that the default hyper-parameters of the BigGAN model have been engineered towards CIFAR-10 like datasets and VGG/ResNet-like discriminator networks . It is worth mentioning that we conducted absolutely zero hyper-parameter search for all tasks here . Especially for CIFAR-10 tasks , we directly take the pre-trained models from the StudioGAN library . It is likely that we may achieve even better scores with fine-tuned GAN hyper-parameters and optimized training procedure for each PGDL task , and we leave it to future work .
This paper investigates the task of using GAN’s samples as a substitute for the true test distribution for estimating the generalization. Experiments show that samples from GAN are a powerful substitute for the test set and the predictive power of the synthetic accuracy outperforms all prior methods include the winner of the 2020 PGDL competition, despite all the empirical and theoretical evidence that GANs are not good at approximating the true data distribution. The paper then performs a preliminary investigation on why samples from GANs are a good substitute for the test set and found that using a certain notion of perceptual similarity, samples from GAN’s are much closer to the test distribution than the training distribution despite being trained on the training data.
SP:c1be1b359071f27a2fa9ad30c8d5d28539277222
On Predicting Generalization using GANs
1 INTRODUCTION . Why do vastly overparametrized neural networks achieve impressive generalization performance across many domains , with very limited capacity control during training ? Despite some promising initial research , the mechanism behind generalization remains poorly understood . A host of papers have tried to adapt classical generalization theory to prove upper bounds of the following form on the difference between training and test error : test− train ≤ √ C |S| + tiny term ( 1 ) where S is the training dataset and C is a so-called complexity measure , typically involving some function of the training dataset as well as the trained net parameters ( e.g. , a geometric norm ) . Current upper bounds of this type are loose , and even vacuous . There is evidence that such classically derived bounds may be too loose ( Dziugaite & Roy , 2017 ) or that they may not correlate well with generalization ( Jiang et al. , 2019 ) . This has motivated a more principled empirical study of the effectiveness of generalization bounds . The general idea is to use machine learning to determine which network characteristics promote good generalization in practice and which do not —in other words , treat various deep net characteristics/norms/margins etc . as inputs to a machine learning model that uses them to predict the generalization error achieved by the net . This could help direct theorists to new types of complexity measures and motivate new theories . A recently started competition of Predicting Generalization in Deep Learning ( Jiang et al. , 2020 ) ( PGDL ) seeks to increase interest in such investigations , in an effort to uncover new and promising network characteristics and/or measures of network complexity that correlate with good generalization . As required in Jiang et al . ( 2020 ) , a complexity measure should depend on the trained model , optimizer , and training set , but not the held out test data . The first PGDL competition in 2020 did uncover quite a few measures that seemed to be predictive of good generalization but had not been identified by theory work . In this paper , we explore a very simple baseline for predicting generalization that had hitherto not received attention : train a Generative Adversarial Network ( GAN ) on the training dataset , and use performance on the synthetic data produced by the GAN to predict generalization . At first sight GANs may not appear to be an obvious choice for this task , due to their well known limitations . For instance , while the goal of GANs training is to find a generator that fools the discriminator net —in the sense that the discriminator has low probability of spotting a difference between GAN samples and the samples from the true distribution—in practice the discriminator is often able to discriminate very well at the end , demonstrating that it was not fooled . Also , GANs ’ generators are known to exhibit mode collapse i.e. , the generated distribution is a tiny subset of the true distribution . There is theory and experiments suggesting this may be difficult to avoid ( Arora et al. , 2018 ; Santurkar et al. , 2018 ; Bau et al. , 2019 ) . Given all these negative results about GANs , the surprising finding in the current paper is that GANs do allow for good estimates of test error ( and generalization error ) . This is verified for families of well-known GANs and datasets including primarily CIFAR-10/100 , Tiny ImageNet and wellknown deep neural classifier architectures . In particular , in sections 3.1 and 3.2 we evaluate on the PGDL and DEMOGEN benchmarks of predicting generalization and present strong results . In Section 4 and 5 , we also investigate reasons behind the surprising efficacy of GANs in predicting generalization as well as the effects of using data augmentation during GAN training . 2 RELATED WORK . Generalization Bounds Traditional approaches to predict generalization construct a generalization bound based on some notion of capacity such as parameter count , VC dimension , Rademacher complexity , etc . Neyshabur et al . ( 2018 ) provide a tighter generalization bound that decreases with increasing number of hidden units . Dziugaite & Roy ( 2017 ) reveal a way to compute nonvacuous PAC-Bayes generalization bounds . Recently , bounds based on knowledge distillation have also come to light ( Hsu et al. , 2020 ) . Despite progress in these approaches , a study conducted by Jiang et al . ( 2019 ) with extensive hyper-parameter search showed that current generalization bounds may not be effective , and the root cause of generalization remains elusive . Given the arduous nature of constructing such bounds , an interest in complexity measures has arisen . Predicting Generalization in Deep Learning The PGDL competition ( Jiang et al. , 2020 ) was held in NeuRIPS 2020 in an effort to encourage the discovery of empirical generalization measures following the seminal work of Jiang et al . ( 2018 ) . The winner of the PGDL competition Natekar & Sharma ( 2020 ) investigated properties of representations in intermediate layers to predict generalization . Kashyap et al . ( 2021 ) , the second place winner , experiment with robustness to flips , random erasing , random saturation , and other such natural augmentations . Afterwards , Jiang et al . ( 2021 ) interestingly find that generalization can be predicted by running SGD on the same architecture multiple times , and measuring the disagreement ratio between the different resulting networks on an unlabeled test set . There are also some pitfalls in predicting generalization , as highlighted by Dziugaite et al . ( 2020 ) . They find that distributional robustness over a family of environments is more applicable to neural networks than straight averaging . Limitations of GANs Arora et al . ( 2017 ) prove the lack of diversity enforcing in GAN ’ s training objective , and Arora et al . ( 2018 ) introduce the Birthday Paradox test to conclude that many popular GAN models in practice do learn a distribution with relatively small support . Santurkar et al . ( 2018 ) and Bau et al . ( 2019 ) investigate the extent to which GAN generated samples can match the distributional statistics of the original training data , and find that they have significant shortcomings . Ravuri & Vinyals ( 2019 ) find that GAN data is of limited use in training ResNet models , and find that neither inception score nor FID are predictive of generalization performance . Notably , despite the small support , Arora et al . ( 2018 ) reveal that GANs generate distinct images from their nearest neighbours in the training set . Later , Webster et al . ( 2019 ) use latent recovery to conclude more carefully that GANs do not memorize the training set . Theoretical Justification for Using GANs Arora et al . ( 2017 ) construct a generator that passes training against any bounded capacity discriminator but can only generate a small number of distinct data points either from the true data distribution or simply from the training set . For predicting generalization , it is crucial for the generator not to memorize training data . While Arora et al . ( 2017 ) do not answer why GANs do not memorize training data , a recent empirical study by Huang et al . ( 2021 ) demonstrates the difficulty of recovering input data by inverting gradients . Their work may cast light on how the generator could learn to generate data distinct from the training set when trained with gradient feedbacks from the discriminator . However , we are not aware of any theory that fully explains GANs ’ strength for predicting generalization despite limitations . 3 PREDICTING TEST PERFORMANCE USING GAN SAMPLES . We now precisely define what it means to predict test performance in our setting . We denote by Strain , Stest and Ssyn the training set , test set and the synthetic dataset generated by GANs . Given a classifier f trained on the training set Strain , we aim to predict its classification accuracy g ( f ) : = 1 |Stest| ∑ ( x , y ) ∈Stest 1 [ f ( x ) = y ] on a test set Stest . Our proposal is to train a conditional GAN model on the very same training set Strain , and then sample from the generator a synthetic dataset Ssyn of labeled examples . In the end , we simply use f ’ s accuracy on the synthetic dataset as our prediction for its test accuracy . Algorithm 1 formally describes this procedure . Algorithm 1 Predicting test performance Require : target classifier f , training set Strain , GAN training algorithm A 1 . Train a conditional GAN model using Strain : G , D = A ( Strain ) where G , D are the generator and discriminator networks . 2 . Generate a synthetic dataset by sampling from the generator G : Ssyn = { ( x̃1 , ỹ1 ) , . . . , ( x̃N , ỹN ) } where x̃i , ỹi = G ( zi , ỹi ) . The zi ’ s are drawn i.i.d . from G ’ s default input distribution . N and ỹi ’ are chosen so as to match statistics of the training set . Output : the synthetic accuracy ĝ ( f ) : = 1|Ssyn| ∑ ( x̃ , ỹ ) ∈Ssyn 1 [ f ( x̃ ) = ỹ ] as the prediction Remark . Any N ≥ |Strain| is a safe choice to ensure that ĝ ( f ) concentrates1around its mean Ez , ỹ [ 1 [ f ( G ( z , ỹ ) ) = ỹ ] ] and its deviation has negligible influence on the performance . 1the deviation is only O ( 1/ √ N ) by standard concentration bounds We demonstrate in Figure 1 that the test accuracy g ( f ) consistently resides in a small neighborhood of ĝ ( f ) for a diverse class of deep neural net classifiers trained on different datasets . For the choice of GAN architecture , we adopt the pre-trained BigGAN+DiffAug models ( Brock et al. , 2019 ; Zhao et al. , 2020 ) from the StudioGAN library2 . We evaluate on pretrained deep neural net classifiers with architectures ranging from VGG- ( 11 , 13 , 19 ) , ResNet- ( 18 , 34 , 50 ) , DenseNet ( 121 , 169 ) , ShuffleNet , PNASNet and MobileNet trained on CIFAR-10 and Tiny ImageNet with hyper-parameter setting ( learning rate , weight decay factor , learning rate schedule ) uniformly sampled from the grid { 10−1 , 10−2 } × { 5× 10−4 , 10−3 } × { CosineAnnealing , ExponentialDecay } . We use SGD with momentum 0.9 and batch size 128 and data augmention of horizontal flips for training all classifiers . 3.1 EVALUATION ON PGDL COMPETITION . We evaluate our proposed method on the tasks of NeurIPS 2020 Competition on Predicting Generalization of Deep Learning . The PGDL competition consists of 8 tasks3 , each containing a set of pre-trained deep net classifiers of similar architectures but with different hyper-parameter settings , as well as the training data . The tasks of PGDL are based on a wide range of datasets inlcuding CIFAR-10 , SVHN , CINIC-10 , Oxford Flowers , Oxford Pets and Fashion MNIST . For every task , the goal is to compute a scalar prediction for each classifier based on its parameters and the training data that correlates as much as possible with the actual generalization errors of the classifiers measured on a test set . The correlation score is measured by the so-called Conditional Mutual Information , which is designed to indicate whether the computed predictions contain all the information about the generalization errors such that knowing the hyper-parameters does not provide additional information , see ( Jiang et al. , 2020 ) for details . Since the goal of PGDL is to predict generalization gap instead of test accuracy , our proposed solution is a slight adaptation of Algorithm 1 . For each task , we first train a GAN model on the provided training dataset and sample from it a labeled synthetic dataset . Then for each classifier within the task , instead of the raw synthetic accuracy , we use as prediction the gap between training and synthetic accuracies . For all tasks , we use BigGAN+diffAug with the default4 implementation for CIFAR-10 from the StudioGAN library . We found that a subset of them ( Task 6 with Oxford Flowers and Task 7 with Oxford Pets ) were not well-suited for standard GAN training without much tweaking due to a small training set and highly uneven class sizes . We focused only on the subset of the tasks where GAN training worked out of the box , specifically Task 1 , 2 , 4 , 5 , 8 , and 9 . 2available at https : //github.com/POSTECH-CVLab/PyTorch-StudioGAN 3namely Task 1 , 2 , 4 , 5 , 6 , 7 , 8 , 9 , without 3 . 4Task 8 uses the single-channel 28×28 Fashion-MNIST dataset . For GAN training , we symmetrically zeropad the training images to 32 × 32 and convert to RGB by replicating the channel . To compute the synthetic accuracy , we convert the generated images back to single-channel and perform a center cropping . We report the results in Table 1 , where we observe that on tasks involving either CIFAR-10 or VGGlike classifiers , our proposed solution out-performs all of the solutions from the top 3 teams of the competition by a large margin . One potential reason may be that the default hyper-parameters of the BigGAN model have been engineered towards CIFAR-10 like datasets and VGG/ResNet-like discriminator networks . It is worth mentioning that we conducted absolutely zero hyper-parameter search for all tasks here . Especially for CIFAR-10 tasks , we directly take the pre-trained models from the StudioGAN library . It is likely that we may achieve even better scores with fine-tuned GAN hyper-parameters and optimized training procedure for each PGDL task , and we leave it to future work .
This work studies generalization prediction with synthetic data produced by GANs. Specifically the training accuracy gap between synthetic and given data is proposed as a measure for generalization. The authors show strong improvement over other PGDL and DEMOGEN results. A further empirical finding is made on the greater similarity between test and synthetic samples than test and train samples, as measured by FID. A variety of GAN architectures are explored.
SP:c1be1b359071f27a2fa9ad30c8d5d28539277222
On Predicting Generalization using GANs
1 INTRODUCTION . Why do vastly overparametrized neural networks achieve impressive generalization performance across many domains , with very limited capacity control during training ? Despite some promising initial research , the mechanism behind generalization remains poorly understood . A host of papers have tried to adapt classical generalization theory to prove upper bounds of the following form on the difference between training and test error : test− train ≤ √ C |S| + tiny term ( 1 ) where S is the training dataset and C is a so-called complexity measure , typically involving some function of the training dataset as well as the trained net parameters ( e.g. , a geometric norm ) . Current upper bounds of this type are loose , and even vacuous . There is evidence that such classically derived bounds may be too loose ( Dziugaite & Roy , 2017 ) or that they may not correlate well with generalization ( Jiang et al. , 2019 ) . This has motivated a more principled empirical study of the effectiveness of generalization bounds . The general idea is to use machine learning to determine which network characteristics promote good generalization in practice and which do not —in other words , treat various deep net characteristics/norms/margins etc . as inputs to a machine learning model that uses them to predict the generalization error achieved by the net . This could help direct theorists to new types of complexity measures and motivate new theories . A recently started competition of Predicting Generalization in Deep Learning ( Jiang et al. , 2020 ) ( PGDL ) seeks to increase interest in such investigations , in an effort to uncover new and promising network characteristics and/or measures of network complexity that correlate with good generalization . As required in Jiang et al . ( 2020 ) , a complexity measure should depend on the trained model , optimizer , and training set , but not the held out test data . The first PGDL competition in 2020 did uncover quite a few measures that seemed to be predictive of good generalization but had not been identified by theory work . In this paper , we explore a very simple baseline for predicting generalization that had hitherto not received attention : train a Generative Adversarial Network ( GAN ) on the training dataset , and use performance on the synthetic data produced by the GAN to predict generalization . At first sight GANs may not appear to be an obvious choice for this task , due to their well known limitations . For instance , while the goal of GANs training is to find a generator that fools the discriminator net —in the sense that the discriminator has low probability of spotting a difference between GAN samples and the samples from the true distribution—in practice the discriminator is often able to discriminate very well at the end , demonstrating that it was not fooled . Also , GANs ’ generators are known to exhibit mode collapse i.e. , the generated distribution is a tiny subset of the true distribution . There is theory and experiments suggesting this may be difficult to avoid ( Arora et al. , 2018 ; Santurkar et al. , 2018 ; Bau et al. , 2019 ) . Given all these negative results about GANs , the surprising finding in the current paper is that GANs do allow for good estimates of test error ( and generalization error ) . This is verified for families of well-known GANs and datasets including primarily CIFAR-10/100 , Tiny ImageNet and wellknown deep neural classifier architectures . In particular , in sections 3.1 and 3.2 we evaluate on the PGDL and DEMOGEN benchmarks of predicting generalization and present strong results . In Section 4 and 5 , we also investigate reasons behind the surprising efficacy of GANs in predicting generalization as well as the effects of using data augmentation during GAN training . 2 RELATED WORK . Generalization Bounds Traditional approaches to predict generalization construct a generalization bound based on some notion of capacity such as parameter count , VC dimension , Rademacher complexity , etc . Neyshabur et al . ( 2018 ) provide a tighter generalization bound that decreases with increasing number of hidden units . Dziugaite & Roy ( 2017 ) reveal a way to compute nonvacuous PAC-Bayes generalization bounds . Recently , bounds based on knowledge distillation have also come to light ( Hsu et al. , 2020 ) . Despite progress in these approaches , a study conducted by Jiang et al . ( 2019 ) with extensive hyper-parameter search showed that current generalization bounds may not be effective , and the root cause of generalization remains elusive . Given the arduous nature of constructing such bounds , an interest in complexity measures has arisen . Predicting Generalization in Deep Learning The PGDL competition ( Jiang et al. , 2020 ) was held in NeuRIPS 2020 in an effort to encourage the discovery of empirical generalization measures following the seminal work of Jiang et al . ( 2018 ) . The winner of the PGDL competition Natekar & Sharma ( 2020 ) investigated properties of representations in intermediate layers to predict generalization . Kashyap et al . ( 2021 ) , the second place winner , experiment with robustness to flips , random erasing , random saturation , and other such natural augmentations . Afterwards , Jiang et al . ( 2021 ) interestingly find that generalization can be predicted by running SGD on the same architecture multiple times , and measuring the disagreement ratio between the different resulting networks on an unlabeled test set . There are also some pitfalls in predicting generalization , as highlighted by Dziugaite et al . ( 2020 ) . They find that distributional robustness over a family of environments is more applicable to neural networks than straight averaging . Limitations of GANs Arora et al . ( 2017 ) prove the lack of diversity enforcing in GAN ’ s training objective , and Arora et al . ( 2018 ) introduce the Birthday Paradox test to conclude that many popular GAN models in practice do learn a distribution with relatively small support . Santurkar et al . ( 2018 ) and Bau et al . ( 2019 ) investigate the extent to which GAN generated samples can match the distributional statistics of the original training data , and find that they have significant shortcomings . Ravuri & Vinyals ( 2019 ) find that GAN data is of limited use in training ResNet models , and find that neither inception score nor FID are predictive of generalization performance . Notably , despite the small support , Arora et al . ( 2018 ) reveal that GANs generate distinct images from their nearest neighbours in the training set . Later , Webster et al . ( 2019 ) use latent recovery to conclude more carefully that GANs do not memorize the training set . Theoretical Justification for Using GANs Arora et al . ( 2017 ) construct a generator that passes training against any bounded capacity discriminator but can only generate a small number of distinct data points either from the true data distribution or simply from the training set . For predicting generalization , it is crucial for the generator not to memorize training data . While Arora et al . ( 2017 ) do not answer why GANs do not memorize training data , a recent empirical study by Huang et al . ( 2021 ) demonstrates the difficulty of recovering input data by inverting gradients . Their work may cast light on how the generator could learn to generate data distinct from the training set when trained with gradient feedbacks from the discriminator . However , we are not aware of any theory that fully explains GANs ’ strength for predicting generalization despite limitations . 3 PREDICTING TEST PERFORMANCE USING GAN SAMPLES . We now precisely define what it means to predict test performance in our setting . We denote by Strain , Stest and Ssyn the training set , test set and the synthetic dataset generated by GANs . Given a classifier f trained on the training set Strain , we aim to predict its classification accuracy g ( f ) : = 1 |Stest| ∑ ( x , y ) ∈Stest 1 [ f ( x ) = y ] on a test set Stest . Our proposal is to train a conditional GAN model on the very same training set Strain , and then sample from the generator a synthetic dataset Ssyn of labeled examples . In the end , we simply use f ’ s accuracy on the synthetic dataset as our prediction for its test accuracy . Algorithm 1 formally describes this procedure . Algorithm 1 Predicting test performance Require : target classifier f , training set Strain , GAN training algorithm A 1 . Train a conditional GAN model using Strain : G , D = A ( Strain ) where G , D are the generator and discriminator networks . 2 . Generate a synthetic dataset by sampling from the generator G : Ssyn = { ( x̃1 , ỹ1 ) , . . . , ( x̃N , ỹN ) } where x̃i , ỹi = G ( zi , ỹi ) . The zi ’ s are drawn i.i.d . from G ’ s default input distribution . N and ỹi ’ are chosen so as to match statistics of the training set . Output : the synthetic accuracy ĝ ( f ) : = 1|Ssyn| ∑ ( x̃ , ỹ ) ∈Ssyn 1 [ f ( x̃ ) = ỹ ] as the prediction Remark . Any N ≥ |Strain| is a safe choice to ensure that ĝ ( f ) concentrates1around its mean Ez , ỹ [ 1 [ f ( G ( z , ỹ ) ) = ỹ ] ] and its deviation has negligible influence on the performance . 1the deviation is only O ( 1/ √ N ) by standard concentration bounds We demonstrate in Figure 1 that the test accuracy g ( f ) consistently resides in a small neighborhood of ĝ ( f ) for a diverse class of deep neural net classifiers trained on different datasets . For the choice of GAN architecture , we adopt the pre-trained BigGAN+DiffAug models ( Brock et al. , 2019 ; Zhao et al. , 2020 ) from the StudioGAN library2 . We evaluate on pretrained deep neural net classifiers with architectures ranging from VGG- ( 11 , 13 , 19 ) , ResNet- ( 18 , 34 , 50 ) , DenseNet ( 121 , 169 ) , ShuffleNet , PNASNet and MobileNet trained on CIFAR-10 and Tiny ImageNet with hyper-parameter setting ( learning rate , weight decay factor , learning rate schedule ) uniformly sampled from the grid { 10−1 , 10−2 } × { 5× 10−4 , 10−3 } × { CosineAnnealing , ExponentialDecay } . We use SGD with momentum 0.9 and batch size 128 and data augmention of horizontal flips for training all classifiers . 3.1 EVALUATION ON PGDL COMPETITION . We evaluate our proposed method on the tasks of NeurIPS 2020 Competition on Predicting Generalization of Deep Learning . The PGDL competition consists of 8 tasks3 , each containing a set of pre-trained deep net classifiers of similar architectures but with different hyper-parameter settings , as well as the training data . The tasks of PGDL are based on a wide range of datasets inlcuding CIFAR-10 , SVHN , CINIC-10 , Oxford Flowers , Oxford Pets and Fashion MNIST . For every task , the goal is to compute a scalar prediction for each classifier based on its parameters and the training data that correlates as much as possible with the actual generalization errors of the classifiers measured on a test set . The correlation score is measured by the so-called Conditional Mutual Information , which is designed to indicate whether the computed predictions contain all the information about the generalization errors such that knowing the hyper-parameters does not provide additional information , see ( Jiang et al. , 2020 ) for details . Since the goal of PGDL is to predict generalization gap instead of test accuracy , our proposed solution is a slight adaptation of Algorithm 1 . For each task , we first train a GAN model on the provided training dataset and sample from it a labeled synthetic dataset . Then for each classifier within the task , instead of the raw synthetic accuracy , we use as prediction the gap between training and synthetic accuracies . For all tasks , we use BigGAN+diffAug with the default4 implementation for CIFAR-10 from the StudioGAN library . We found that a subset of them ( Task 6 with Oxford Flowers and Task 7 with Oxford Pets ) were not well-suited for standard GAN training without much tweaking due to a small training set and highly uneven class sizes . We focused only on the subset of the tasks where GAN training worked out of the box , specifically Task 1 , 2 , 4 , 5 , 8 , and 9 . 2available at https : //github.com/POSTECH-CVLab/PyTorch-StudioGAN 3namely Task 1 , 2 , 4 , 5 , 6 , 7 , 8 , 9 , without 3 . 4Task 8 uses the single-channel 28×28 Fashion-MNIST dataset . For GAN training , we symmetrically zeropad the training images to 32 × 32 and convert to RGB by replicating the channel . To compute the synthetic accuracy , we convert the generated images back to single-channel and perform a center cropping . We report the results in Table 1 , where we observe that on tasks involving either CIFAR-10 or VGGlike classifiers , our proposed solution out-performs all of the solutions from the top 3 teams of the competition by a large margin . One potential reason may be that the default hyper-parameters of the BigGAN model have been engineered towards CIFAR-10 like datasets and VGG/ResNet-like discriminator networks . It is worth mentioning that we conducted absolutely zero hyper-parameter search for all tasks here . Especially for CIFAR-10 tasks , we directly take the pre-trained models from the StudioGAN library . It is likely that we may achieve even better scores with fine-tuned GAN hyper-parameters and optimized training procedure for each PGDL task , and we leave it to future work .
The paper considers the problem of predicting the test performance of neural networks, given only the training set and model hyperparameters. While there have been many methods proposed for this, the paper considers the simple baseline of generating synthetic test samples from a GAN and computing error using these samples. This baseline appears to outperform all or almost all existing methods on a variety of tasks, including a recent competition on predicting generalization.
SP:c1be1b359071f27a2fa9ad30c8d5d28539277222
Second-Order Rewards For Successor Features
1 INTRODUCTION . Recently , Reinforcement Learning ( RL ) algorithms have achieved superhuman performance in several challenging domains , such as Atari ( Mnih et al. , 2015 ) , Go ( Silver et al. , 2016 ) , and Starcraft II ( Vinyals et al. , 2019 ) . The main driver of these successes has been the use of deep neural networks , which are a class of powerful non-linear function approximators , with RL algorithms ( LeCun et al. , 2015 ) . However , this class of Deep Reinforcement Learning ( Deep RL ) algorithms require immense amounts of data within an environment , often ranging from tens to hundreds of millions of samples ( Arulkumaran et al. , 2017 ) . Furthermore , commonly used algorithms often have difficulty in transferring a learned policy between related tasks , such as where the environmental dynamics remain constant , but the goal changes . In this case , the model must either be retrained completely or fine-tuned on the new task , in both cases requiring millions of additional samples . If the state dynamics are constant , but the reward structure varies between tasks , it is wasteful to retrain the entire model . A more pragmatic approach would be to decompose the RL agent ’ s policy such that separate functions can learn the state dynamics and the reward structure ; doing so enables reuse of the dynamics model and only requires learning the reward component . Successor features ( Dayan , 1993 ) do precisely this ; a model-free policy ’ s action-value function is expressed as the dot product between a vector of expected discounted future state occupancies , the successor features , and another vector representing the immediate reward in each of those successor states . The factorization follows from the formulation of the reward as the dot product between a state representation vector and a learned parameter vector , that is a linear product . Therefore , transfer to a new task requires relearning only the reward parameters instead of the entire model and amounts to the supervised learning problem of predicting the current state ’ s immediate reward . As the reward function of the successor feature framework is linear , it is fair to question whether the model can always accurately predict the reward . As no assumptions are made about the state representation , theoretically it is possible to enable perfect recovery of any reward function if given predictive state representation Barreto et al . ( 2017 ) . The state representation , within the successor feature framework , is learned end-to-end by a state encoder to perform well in state reconstruction and reward prediction tasks . The state encoder , given a large enough set of parameters , should have enough representational power to disentangle the factors that are useful for reward prediction by a linear model . However , because of how the encoder is trained , its parameters are utilized for both state reconstruction and reward prediction tasks ; while the reward model parameters are only used for reward prediction . If the encoder learns a sub-optimal state representation for reward prediction , say because of a highly complex environment , the reward model might be unable to compensate with its limited set of parameters correctly to predict the reward . Eysenbach et al . ( 2018 ) and Hansen et al . ( 2019 ) have shown , within the successor feature framework , that there is no strong guarantee that the state encoder is always able to learn features that enable accurate modelling of the reward . In this paper , a novel extension to the successor feature framework is proposed , where the rewards are modelled with a second-order function . The second-order function , which follows naturally from the original linear variant , gives a stronger guarantee on performance of the model due to both its representational structure and extra parameters . This is especially true in cases where the encoder learns state representations that are less than optimal where a linear model does not have enough representational power to compensate . While , in cases where the encoder can learn sufficient represents for both reconstruction and reward tasks , the second-order function still provides many added benefits . In particular , the additional parameters of the reward model should lessen the representation load of the encoder with regards to the reward tasks allowing more of its representational capacity to be dedicated towards modelling the environment in a task agnostic manner . Further benefits , via a new term emerging after derivation , include a representational form of environmental stochasticity and the ability to use directed exploration during transfer instead of relying on a purely random approach for exploration , such as -greedy . Following this , the contributions of this research are as follows : • A novel formulation of successor features that uses a second-order reward function . This formulation increases the representational power of the reward function while decreasing the representational load on the state encoder providing stronger guarantees on performance . • Under the new reward formulation , a second term appears that models the future expected auto-correlation matrix of the state features . • We provide preliminary results that show the second term can be used for guided exploration during transfer instead of relying on -greedy exploration . After the introduction of relevant background material in Section 2 , we introduce the successor feature framework with a non-linear reward function in Section 3 , Section 4 provides experimental support and provides an analysis of the new term in the decomposition . The paper concludes with a final discussion and possible avenues for future work in Section 5 . 2 BACKGROUND . 2.1 REINFORCEMENT LEARNING . Consider the interaction between an agent and an environment modelled by a Markov decision process ( MDP ) ( Puterman , 2014 ) . An MDP is defined as a set of states S , a set of actionsA , a reward function R : S → R , a discount factor γ ∈ [ 0 , 1 ] , and a transition function T : S ×A → [ 0 , 1 ] . The transition function gives the next-state distribution upon taking action a in state s and is often referred to as the dynamics of the MDP . The objective of the agent in RL is to find a policy π , a mapping from states to actions , which maximizes the expected discounted sum of rewards within the environment . One solution to this problem is to rely on learning a value function , where the action-value function of a policy π is defined as : Qπ ( s , a ) = Eπ [ ∞∑ t=0 γtR ( st ) |St = s , At = a ] where Eπ [ . . . ] denotes the expected value when following the policy π . The policy is learned using an alternating process of policy evaluation , given the action-value of a particular policy and policy improvement , which derives a new policy that is greedy with respect to Qπ ( s , a ) ( Puterman , 2014 ) . 2.2 SUCCESSOR FEATURES . Successor Features ( SF ) offer a decomposition of the Q-value function and have been mentioned under various names and interpretations ( Dayan , 1993 ; Kulkarni et al. , 2016 ; Barreto et al. , 2017 ; Machado et al. , 2017 ) . This decomposition follows from the assumption that the reward function can be approximately represented as a linear combination of learned features φ ( s ; θφ ) extracted by a neural network with parameters θφ and a reward weight vector w. As such , the expected one-step reward can be computed as : r ( s , a ) = φ ( s , a ; θφ ) > w . Following from this , the Q function can be rewritten as : Q ( s , a ) = Eπ [ rt+1 + γrt+2 + . . . |St = s , At = a ] = Eπ [ φ ( at+1 , st+1 ; θφ ) > w + φ ( at+2 , st+2 ; θφ ) > w + . . . |St = s , At = a ] Q ( s , a ) = ψπ ( s , a ) > · w where ψπ ( s , a ) are referred to as the successor features under policy π . The ith component of ψ ( s , a ) provides the expected discounted sum of φ ( i ) t when following policy π starting from state s and action a . It is assumed that the features φ ( s ; θφ ) are representative of the state s , such that ψ ( . ) can be turned into a function ψπ ( φ ( st ; θφ ) , at ) . For brevity , φ ( st ; θφ ) is referred to simply as φt and ψπ ( s , a ) as ψ ( s , a ) . The decomposition neatly separates the Q-function into two learning problems , for ψπ and w : estimating the features under the current policy dynamics and estimating the reward given a state . Because the decomposition still has the same form as the Q-function , the successor features are computed using a Bellman equation update in which the reward function is replaced by φt : ψπ ( φt , at ) = φt + γE [ ψπ ( φt+1 , at+1 ) ] such that approximate successor features can be learned using an RL method , such as QLearning ( Szepesvári , 2009 ) . Following from this , the approximation of the reward vector w becomes a supervised learning problem . Often , this weight is learned using ordinary least squares from the sampled environmental data . One benefit of having a decoupled representation is that only the relevant function must be relearned when either the dynamics or the reward changes . Therefore , if the task changes , but the environmental dynamics remain constant , only the reward vector parameters w must be relearned , which are minimal compared to the total number of parameters in the full model . 3 MODEL , ARCHITECTURE , AND TRAINING . A natural extension to the Successor Feature framework begins by adjusting the fundamental structure of how the reward is represented . In this work , a second-order extension is proposed that improves the flexibility of the reward function while providing other benefits . This paper shows that by improving the representational power of the reward component , with a non-linear function of the state , it provides a stronger guarantee of the framework ’ s performance in such cases by developing a more robust reward component . This section discusses our change to the successor feature framework , which adjusts the reward function , from a linear function , to a non-linear function . First , a discussion of the new decomposition is given with the full derivation provided in Appendix A . Then experimental support for this change will be presented and analyzed to examine what the new term in the decomposition learns . 3.1 NON-LINEAR REWARD FUNCTION . The successor feature framework builds upon functional representation of the current reward rt as a linear combination of the current state representation φt ( s ) ∈ Rz and a learned reward vector w ∈ Rz , such that rt = φt ( s ) > w . In this paper we extend the reward model by changing this linear reward model to one with the following form : rt = φt ( s ) > o + φt ( s ) > Aφt ( s ) ( 1 ) where { φt ( s ) , o } ∈ Rz , and A ∈ Rz×z . Both o and A are learnable parameters modelling the reward structure of the environment . Equation 1 shows that the formulation introduces a non-linear transformation with respect to φt ( s ) . From here on , we use φt instead of φt ( s ) for brevity . With a slight abuse of notation , we can see the original formulation leads to this if w is replaced with o+Aφ : rt = φ > ( o+Aφ ) . The state-action value function Q ( s , a ) , under this new reward structure , can be derived to yield : Qπ ( st , a ) = ψ π ( st , a ) > o + βtr ( AΛπ ( st , a ) ) ( 2 ) where β ∈ { 0 , 1 } controls the inclusion of Λ and tr is the trace operator . It can now be shown that ψ and Λ satisfy the Bellman equation ( Bellman , 1966 ) : ψπ ( st , a ) = Eπ [ φt+1 + γψ ( st+1 , π ( st+1 ) ) |St = s , At = a ] ( 3 ) Λπ ( st , a ) = Eπ [ φt+1φ > t+1 + γΛ ( st+1 , π ( st+1 ) ) |St = s , At = a ] ( 4 ) where for ψ and Λ , φ and φφ > respectively play the role of rewards . In addition to ψ , it is now necessary to model Λ , which outputs an Rz×z matrix per action . The quantity φtφ > t can be interpreted as an auto-correlation matrix of the state features . We can see that this form allows the Λ term to model some form of future expected stochasticity of the environment . For example , the diagonal of Λ will model a second order moment capturing each feature ’ s change with respect to itself φ1 . We provide analysis and further discussion of Λ in Section 4.5 .
The authors take the successor feature framework that separately models enivronmental dynamics and reward to use a second order reward learning formulation over the standard linear model. This allows a non-linear relationship to more easily form between features and rewards lessening the burden of a the feature encoder to learn "good" features for the RL task at hand. The authors showcase experiments where the designed new quadratic reward modeler performs better than standard RL systems
SP:9dbd0f4c9afb080a2bd6ea696b7919d7e77ea3e8
Second-Order Rewards For Successor Features
1 INTRODUCTION . Recently , Reinforcement Learning ( RL ) algorithms have achieved superhuman performance in several challenging domains , such as Atari ( Mnih et al. , 2015 ) , Go ( Silver et al. , 2016 ) , and Starcraft II ( Vinyals et al. , 2019 ) . The main driver of these successes has been the use of deep neural networks , which are a class of powerful non-linear function approximators , with RL algorithms ( LeCun et al. , 2015 ) . However , this class of Deep Reinforcement Learning ( Deep RL ) algorithms require immense amounts of data within an environment , often ranging from tens to hundreds of millions of samples ( Arulkumaran et al. , 2017 ) . Furthermore , commonly used algorithms often have difficulty in transferring a learned policy between related tasks , such as where the environmental dynamics remain constant , but the goal changes . In this case , the model must either be retrained completely or fine-tuned on the new task , in both cases requiring millions of additional samples . If the state dynamics are constant , but the reward structure varies between tasks , it is wasteful to retrain the entire model . A more pragmatic approach would be to decompose the RL agent ’ s policy such that separate functions can learn the state dynamics and the reward structure ; doing so enables reuse of the dynamics model and only requires learning the reward component . Successor features ( Dayan , 1993 ) do precisely this ; a model-free policy ’ s action-value function is expressed as the dot product between a vector of expected discounted future state occupancies , the successor features , and another vector representing the immediate reward in each of those successor states . The factorization follows from the formulation of the reward as the dot product between a state representation vector and a learned parameter vector , that is a linear product . Therefore , transfer to a new task requires relearning only the reward parameters instead of the entire model and amounts to the supervised learning problem of predicting the current state ’ s immediate reward . As the reward function of the successor feature framework is linear , it is fair to question whether the model can always accurately predict the reward . As no assumptions are made about the state representation , theoretically it is possible to enable perfect recovery of any reward function if given predictive state representation Barreto et al . ( 2017 ) . The state representation , within the successor feature framework , is learned end-to-end by a state encoder to perform well in state reconstruction and reward prediction tasks . The state encoder , given a large enough set of parameters , should have enough representational power to disentangle the factors that are useful for reward prediction by a linear model . However , because of how the encoder is trained , its parameters are utilized for both state reconstruction and reward prediction tasks ; while the reward model parameters are only used for reward prediction . If the encoder learns a sub-optimal state representation for reward prediction , say because of a highly complex environment , the reward model might be unable to compensate with its limited set of parameters correctly to predict the reward . Eysenbach et al . ( 2018 ) and Hansen et al . ( 2019 ) have shown , within the successor feature framework , that there is no strong guarantee that the state encoder is always able to learn features that enable accurate modelling of the reward . In this paper , a novel extension to the successor feature framework is proposed , where the rewards are modelled with a second-order function . The second-order function , which follows naturally from the original linear variant , gives a stronger guarantee on performance of the model due to both its representational structure and extra parameters . This is especially true in cases where the encoder learns state representations that are less than optimal where a linear model does not have enough representational power to compensate . While , in cases where the encoder can learn sufficient represents for both reconstruction and reward tasks , the second-order function still provides many added benefits . In particular , the additional parameters of the reward model should lessen the representation load of the encoder with regards to the reward tasks allowing more of its representational capacity to be dedicated towards modelling the environment in a task agnostic manner . Further benefits , via a new term emerging after derivation , include a representational form of environmental stochasticity and the ability to use directed exploration during transfer instead of relying on a purely random approach for exploration , such as -greedy . Following this , the contributions of this research are as follows : • A novel formulation of successor features that uses a second-order reward function . This formulation increases the representational power of the reward function while decreasing the representational load on the state encoder providing stronger guarantees on performance . • Under the new reward formulation , a second term appears that models the future expected auto-correlation matrix of the state features . • We provide preliminary results that show the second term can be used for guided exploration during transfer instead of relying on -greedy exploration . After the introduction of relevant background material in Section 2 , we introduce the successor feature framework with a non-linear reward function in Section 3 , Section 4 provides experimental support and provides an analysis of the new term in the decomposition . The paper concludes with a final discussion and possible avenues for future work in Section 5 . 2 BACKGROUND . 2.1 REINFORCEMENT LEARNING . Consider the interaction between an agent and an environment modelled by a Markov decision process ( MDP ) ( Puterman , 2014 ) . An MDP is defined as a set of states S , a set of actionsA , a reward function R : S → R , a discount factor γ ∈ [ 0 , 1 ] , and a transition function T : S ×A → [ 0 , 1 ] . The transition function gives the next-state distribution upon taking action a in state s and is often referred to as the dynamics of the MDP . The objective of the agent in RL is to find a policy π , a mapping from states to actions , which maximizes the expected discounted sum of rewards within the environment . One solution to this problem is to rely on learning a value function , where the action-value function of a policy π is defined as : Qπ ( s , a ) = Eπ [ ∞∑ t=0 γtR ( st ) |St = s , At = a ] where Eπ [ . . . ] denotes the expected value when following the policy π . The policy is learned using an alternating process of policy evaluation , given the action-value of a particular policy and policy improvement , which derives a new policy that is greedy with respect to Qπ ( s , a ) ( Puterman , 2014 ) . 2.2 SUCCESSOR FEATURES . Successor Features ( SF ) offer a decomposition of the Q-value function and have been mentioned under various names and interpretations ( Dayan , 1993 ; Kulkarni et al. , 2016 ; Barreto et al. , 2017 ; Machado et al. , 2017 ) . This decomposition follows from the assumption that the reward function can be approximately represented as a linear combination of learned features φ ( s ; θφ ) extracted by a neural network with parameters θφ and a reward weight vector w. As such , the expected one-step reward can be computed as : r ( s , a ) = φ ( s , a ; θφ ) > w . Following from this , the Q function can be rewritten as : Q ( s , a ) = Eπ [ rt+1 + γrt+2 + . . . |St = s , At = a ] = Eπ [ φ ( at+1 , st+1 ; θφ ) > w + φ ( at+2 , st+2 ; θφ ) > w + . . . |St = s , At = a ] Q ( s , a ) = ψπ ( s , a ) > · w where ψπ ( s , a ) are referred to as the successor features under policy π . The ith component of ψ ( s , a ) provides the expected discounted sum of φ ( i ) t when following policy π starting from state s and action a . It is assumed that the features φ ( s ; θφ ) are representative of the state s , such that ψ ( . ) can be turned into a function ψπ ( φ ( st ; θφ ) , at ) . For brevity , φ ( st ; θφ ) is referred to simply as φt and ψπ ( s , a ) as ψ ( s , a ) . The decomposition neatly separates the Q-function into two learning problems , for ψπ and w : estimating the features under the current policy dynamics and estimating the reward given a state . Because the decomposition still has the same form as the Q-function , the successor features are computed using a Bellman equation update in which the reward function is replaced by φt : ψπ ( φt , at ) = φt + γE [ ψπ ( φt+1 , at+1 ) ] such that approximate successor features can be learned using an RL method , such as QLearning ( Szepesvári , 2009 ) . Following from this , the approximation of the reward vector w becomes a supervised learning problem . Often , this weight is learned using ordinary least squares from the sampled environmental data . One benefit of having a decoupled representation is that only the relevant function must be relearned when either the dynamics or the reward changes . Therefore , if the task changes , but the environmental dynamics remain constant , only the reward vector parameters w must be relearned , which are minimal compared to the total number of parameters in the full model . 3 MODEL , ARCHITECTURE , AND TRAINING . A natural extension to the Successor Feature framework begins by adjusting the fundamental structure of how the reward is represented . In this work , a second-order extension is proposed that improves the flexibility of the reward function while providing other benefits . This paper shows that by improving the representational power of the reward component , with a non-linear function of the state , it provides a stronger guarantee of the framework ’ s performance in such cases by developing a more robust reward component . This section discusses our change to the successor feature framework , which adjusts the reward function , from a linear function , to a non-linear function . First , a discussion of the new decomposition is given with the full derivation provided in Appendix A . Then experimental support for this change will be presented and analyzed to examine what the new term in the decomposition learns . 3.1 NON-LINEAR REWARD FUNCTION . The successor feature framework builds upon functional representation of the current reward rt as a linear combination of the current state representation φt ( s ) ∈ Rz and a learned reward vector w ∈ Rz , such that rt = φt ( s ) > w . In this paper we extend the reward model by changing this linear reward model to one with the following form : rt = φt ( s ) > o + φt ( s ) > Aφt ( s ) ( 1 ) where { φt ( s ) , o } ∈ Rz , and A ∈ Rz×z . Both o and A are learnable parameters modelling the reward structure of the environment . Equation 1 shows that the formulation introduces a non-linear transformation with respect to φt ( s ) . From here on , we use φt instead of φt ( s ) for brevity . With a slight abuse of notation , we can see the original formulation leads to this if w is replaced with o+Aφ : rt = φ > ( o+Aφ ) . The state-action value function Q ( s , a ) , under this new reward structure , can be derived to yield : Qπ ( st , a ) = ψ π ( st , a ) > o + βtr ( AΛπ ( st , a ) ) ( 2 ) where β ∈ { 0 , 1 } controls the inclusion of Λ and tr is the trace operator . It can now be shown that ψ and Λ satisfy the Bellman equation ( Bellman , 1966 ) : ψπ ( st , a ) = Eπ [ φt+1 + γψ ( st+1 , π ( st+1 ) ) |St = s , At = a ] ( 3 ) Λπ ( st , a ) = Eπ [ φt+1φ > t+1 + γΛ ( st+1 , π ( st+1 ) ) |St = s , At = a ] ( 4 ) where for ψ and Λ , φ and φφ > respectively play the role of rewards . In addition to ψ , it is now necessary to model Λ , which outputs an Rz×z matrix per action . The quantity φtφ > t can be interpreted as an auto-correlation matrix of the state features . We can see that this form allows the Λ term to model some form of future expected stochasticity of the environment . For example , the diagonal of Λ will model a second order moment capturing each feature ’ s change with respect to itself φ1 . We provide analysis and further discussion of Λ in Section 4.5 .
The paper provides a new idea for deep reinforcement learning with successor features (SF). The existing SF framework assumes a linear reward model which requires learning predictive and informative state representations to capture reward signals. To reduce the burden of the encoder for learning meaningful state features, this paper extends the linear framework by proposing an additional quadratic term in the reward model, leading to an SF framework with 2nd-order rewards. Since the representation power for modeling rewards is greatly improved, the encoder-decoder can focus more on capturing the dynamics of the environment. Empirically, the 2nd-order SF algorithm outperformed the linear SF baseline, especially when rewards are defined by applying nonlinear transformation of state observations.
SP:9dbd0f4c9afb080a2bd6ea696b7919d7e77ea3e8
Second-Order Rewards For Successor Features
1 INTRODUCTION . Recently , Reinforcement Learning ( RL ) algorithms have achieved superhuman performance in several challenging domains , such as Atari ( Mnih et al. , 2015 ) , Go ( Silver et al. , 2016 ) , and Starcraft II ( Vinyals et al. , 2019 ) . The main driver of these successes has been the use of deep neural networks , which are a class of powerful non-linear function approximators , with RL algorithms ( LeCun et al. , 2015 ) . However , this class of Deep Reinforcement Learning ( Deep RL ) algorithms require immense amounts of data within an environment , often ranging from tens to hundreds of millions of samples ( Arulkumaran et al. , 2017 ) . Furthermore , commonly used algorithms often have difficulty in transferring a learned policy between related tasks , such as where the environmental dynamics remain constant , but the goal changes . In this case , the model must either be retrained completely or fine-tuned on the new task , in both cases requiring millions of additional samples . If the state dynamics are constant , but the reward structure varies between tasks , it is wasteful to retrain the entire model . A more pragmatic approach would be to decompose the RL agent ’ s policy such that separate functions can learn the state dynamics and the reward structure ; doing so enables reuse of the dynamics model and only requires learning the reward component . Successor features ( Dayan , 1993 ) do precisely this ; a model-free policy ’ s action-value function is expressed as the dot product between a vector of expected discounted future state occupancies , the successor features , and another vector representing the immediate reward in each of those successor states . The factorization follows from the formulation of the reward as the dot product between a state representation vector and a learned parameter vector , that is a linear product . Therefore , transfer to a new task requires relearning only the reward parameters instead of the entire model and amounts to the supervised learning problem of predicting the current state ’ s immediate reward . As the reward function of the successor feature framework is linear , it is fair to question whether the model can always accurately predict the reward . As no assumptions are made about the state representation , theoretically it is possible to enable perfect recovery of any reward function if given predictive state representation Barreto et al . ( 2017 ) . The state representation , within the successor feature framework , is learned end-to-end by a state encoder to perform well in state reconstruction and reward prediction tasks . The state encoder , given a large enough set of parameters , should have enough representational power to disentangle the factors that are useful for reward prediction by a linear model . However , because of how the encoder is trained , its parameters are utilized for both state reconstruction and reward prediction tasks ; while the reward model parameters are only used for reward prediction . If the encoder learns a sub-optimal state representation for reward prediction , say because of a highly complex environment , the reward model might be unable to compensate with its limited set of parameters correctly to predict the reward . Eysenbach et al . ( 2018 ) and Hansen et al . ( 2019 ) have shown , within the successor feature framework , that there is no strong guarantee that the state encoder is always able to learn features that enable accurate modelling of the reward . In this paper , a novel extension to the successor feature framework is proposed , where the rewards are modelled with a second-order function . The second-order function , which follows naturally from the original linear variant , gives a stronger guarantee on performance of the model due to both its representational structure and extra parameters . This is especially true in cases where the encoder learns state representations that are less than optimal where a linear model does not have enough representational power to compensate . While , in cases where the encoder can learn sufficient represents for both reconstruction and reward tasks , the second-order function still provides many added benefits . In particular , the additional parameters of the reward model should lessen the representation load of the encoder with regards to the reward tasks allowing more of its representational capacity to be dedicated towards modelling the environment in a task agnostic manner . Further benefits , via a new term emerging after derivation , include a representational form of environmental stochasticity and the ability to use directed exploration during transfer instead of relying on a purely random approach for exploration , such as -greedy . Following this , the contributions of this research are as follows : • A novel formulation of successor features that uses a second-order reward function . This formulation increases the representational power of the reward function while decreasing the representational load on the state encoder providing stronger guarantees on performance . • Under the new reward formulation , a second term appears that models the future expected auto-correlation matrix of the state features . • We provide preliminary results that show the second term can be used for guided exploration during transfer instead of relying on -greedy exploration . After the introduction of relevant background material in Section 2 , we introduce the successor feature framework with a non-linear reward function in Section 3 , Section 4 provides experimental support and provides an analysis of the new term in the decomposition . The paper concludes with a final discussion and possible avenues for future work in Section 5 . 2 BACKGROUND . 2.1 REINFORCEMENT LEARNING . Consider the interaction between an agent and an environment modelled by a Markov decision process ( MDP ) ( Puterman , 2014 ) . An MDP is defined as a set of states S , a set of actionsA , a reward function R : S → R , a discount factor γ ∈ [ 0 , 1 ] , and a transition function T : S ×A → [ 0 , 1 ] . The transition function gives the next-state distribution upon taking action a in state s and is often referred to as the dynamics of the MDP . The objective of the agent in RL is to find a policy π , a mapping from states to actions , which maximizes the expected discounted sum of rewards within the environment . One solution to this problem is to rely on learning a value function , where the action-value function of a policy π is defined as : Qπ ( s , a ) = Eπ [ ∞∑ t=0 γtR ( st ) |St = s , At = a ] where Eπ [ . . . ] denotes the expected value when following the policy π . The policy is learned using an alternating process of policy evaluation , given the action-value of a particular policy and policy improvement , which derives a new policy that is greedy with respect to Qπ ( s , a ) ( Puterman , 2014 ) . 2.2 SUCCESSOR FEATURES . Successor Features ( SF ) offer a decomposition of the Q-value function and have been mentioned under various names and interpretations ( Dayan , 1993 ; Kulkarni et al. , 2016 ; Barreto et al. , 2017 ; Machado et al. , 2017 ) . This decomposition follows from the assumption that the reward function can be approximately represented as a linear combination of learned features φ ( s ; θφ ) extracted by a neural network with parameters θφ and a reward weight vector w. As such , the expected one-step reward can be computed as : r ( s , a ) = φ ( s , a ; θφ ) > w . Following from this , the Q function can be rewritten as : Q ( s , a ) = Eπ [ rt+1 + γrt+2 + . . . |St = s , At = a ] = Eπ [ φ ( at+1 , st+1 ; θφ ) > w + φ ( at+2 , st+2 ; θφ ) > w + . . . |St = s , At = a ] Q ( s , a ) = ψπ ( s , a ) > · w where ψπ ( s , a ) are referred to as the successor features under policy π . The ith component of ψ ( s , a ) provides the expected discounted sum of φ ( i ) t when following policy π starting from state s and action a . It is assumed that the features φ ( s ; θφ ) are representative of the state s , such that ψ ( . ) can be turned into a function ψπ ( φ ( st ; θφ ) , at ) . For brevity , φ ( st ; θφ ) is referred to simply as φt and ψπ ( s , a ) as ψ ( s , a ) . The decomposition neatly separates the Q-function into two learning problems , for ψπ and w : estimating the features under the current policy dynamics and estimating the reward given a state . Because the decomposition still has the same form as the Q-function , the successor features are computed using a Bellman equation update in which the reward function is replaced by φt : ψπ ( φt , at ) = φt + γE [ ψπ ( φt+1 , at+1 ) ] such that approximate successor features can be learned using an RL method , such as QLearning ( Szepesvári , 2009 ) . Following from this , the approximation of the reward vector w becomes a supervised learning problem . Often , this weight is learned using ordinary least squares from the sampled environmental data . One benefit of having a decoupled representation is that only the relevant function must be relearned when either the dynamics or the reward changes . Therefore , if the task changes , but the environmental dynamics remain constant , only the reward vector parameters w must be relearned , which are minimal compared to the total number of parameters in the full model . 3 MODEL , ARCHITECTURE , AND TRAINING . A natural extension to the Successor Feature framework begins by adjusting the fundamental structure of how the reward is represented . In this work , a second-order extension is proposed that improves the flexibility of the reward function while providing other benefits . This paper shows that by improving the representational power of the reward component , with a non-linear function of the state , it provides a stronger guarantee of the framework ’ s performance in such cases by developing a more robust reward component . This section discusses our change to the successor feature framework , which adjusts the reward function , from a linear function , to a non-linear function . First , a discussion of the new decomposition is given with the full derivation provided in Appendix A . Then experimental support for this change will be presented and analyzed to examine what the new term in the decomposition learns . 3.1 NON-LINEAR REWARD FUNCTION . The successor feature framework builds upon functional representation of the current reward rt as a linear combination of the current state representation φt ( s ) ∈ Rz and a learned reward vector w ∈ Rz , such that rt = φt ( s ) > w . In this paper we extend the reward model by changing this linear reward model to one with the following form : rt = φt ( s ) > o + φt ( s ) > Aφt ( s ) ( 1 ) where { φt ( s ) , o } ∈ Rz , and A ∈ Rz×z . Both o and A are learnable parameters modelling the reward structure of the environment . Equation 1 shows that the formulation introduces a non-linear transformation with respect to φt ( s ) . From here on , we use φt instead of φt ( s ) for brevity . With a slight abuse of notation , we can see the original formulation leads to this if w is replaced with o+Aφ : rt = φ > ( o+Aφ ) . The state-action value function Q ( s , a ) , under this new reward structure , can be derived to yield : Qπ ( st , a ) = ψ π ( st , a ) > o + βtr ( AΛπ ( st , a ) ) ( 2 ) where β ∈ { 0 , 1 } controls the inclusion of Λ and tr is the trace operator . It can now be shown that ψ and Λ satisfy the Bellman equation ( Bellman , 1966 ) : ψπ ( st , a ) = Eπ [ φt+1 + γψ ( st+1 , π ( st+1 ) ) |St = s , At = a ] ( 3 ) Λπ ( st , a ) = Eπ [ φt+1φ > t+1 + γΛ ( st+1 , π ( st+1 ) ) |St = s , At = a ] ( 4 ) where for ψ and Λ , φ and φφ > respectively play the role of rewards . In addition to ψ , it is now necessary to model Λ , which outputs an Rz×z matrix per action . The quantity φtφ > t can be interpreted as an auto-correlation matrix of the state features . We can see that this form allows the Λ term to model some form of future expected stochasticity of the environment . For example , the diagonal of Λ will model a second order moment capturing each feature ’ s change with respect to itself φ1 . We provide analysis and further discussion of Λ in Section 4.5 .
Successor features decomposes the policy into two components: one modelling the environmental dynamics and the other, the rewards. The paper describes an extension to the successor features framework where the rewards are modelled using a second order function. The extension provides a more robust reward component. Under this formulation a second term appears that models the expected auto-correlation matrix of the state features and can be used for guided exploration during transfer. The authors provide experimental results is three domains with comparison with the linear approach.
SP:9dbd0f4c9afb080a2bd6ea696b7919d7e77ea3e8
Towards Coherent and Consistent Use of Entities in Narrative Generation
Large pre-trained language models ( LMs ) have demonstrated impressive capabilities in generating long , fluent text ; however , there is little to no analysis on their ability to maintain entity coherence and consistency . In this work , we focus on the end task of narrative generation and systematically analyse the long-range entity coherence and consistency in generated stories . First , we propose a set of automatic metrics for measuring model performance in terms of entity usage . Given these metrics , we quantify the limitations of current LMs . Next , we propose augmenting a pre-trained LM with a dynamic entity memory in an end-to-end manner by using an auxiliary entity-related loss for guiding the reads and writes to the memory . We demonstrate that the dynamic entity memory increases entity coherence according to both automatic and human judgment and helps preserving entity-related information especially in settings with a limited context window . Finally , we also validate that our automatic metrics are correlated with human ratings and serve as a good indicator of the quality of generated stories . 1 INTRODUCTION . Large pre-trained language models ( LMs ) ( such as GPT-2 ( Radford et al. , 2019 ) , GPT-3 ( Brown et al. , 2020 ) , and models based on the Transformer-XL architecture ( Dai et al. , 2019 ) ) have radically improved text generation , producing seemingly fluent text – Clark et al . ( 2021 ) even showed that non-expert human judges can not distinguish between machine-written and human-authored texts , based on surface cues . Assuming the quality of generated text as given , most recent efforts have then focused on trying to control generation with a desired topic , factual information , or specific style ( Keskar et al. , 2019 ; Dathathri et al. , 2019 ; Shin et al. , 2020 ; Li & Liang , 2021 ) . However , anecdotally , there are still common failure cases of machine generated text in terms of entity coherence and consistency , which are fundamental properties of language . In this work , we specifically focus on the task of narrative generation in order to analyse and improve entity coherence and consistency . Entities play a central role in narratives , since they guide the plot , and all events revolve around them ( Fludernik , 2002 ; Jannidis , 2009 ; Frow , 2014 ; Bamman et al. , 2013 ) . Despite the importance of entities , recent work has mainly emphasised on controlling the topic of the generated stories using outlines , keywords or other relevant knowledge ( Xu et al. , 2020 ; Rashkin et al. , 2020 ; Fan et al. , 2019 ; Goldfarb-Tarrant et al. , 2020 ) . At the same time , entity-related structure in narrative generation has been largely understudied for large-scale pre-trained LMs . First , we propose a set of metrics for automatically measuring entity coherence and consistency . Based on these metrics , we observe that the current LMs fail to follow the patterns of entity usage we find in human-written narratives . Overall , the generated stories present significantly lower coherence and consistency , and this is especially evident for stories with complex events and many named entities . We further validate these observations by performing a human evaluation study , showing that our automatic metrics correlate with human judgment of entity coherence . Next , in order to improve these properties in narrative generation , we propose augmenting a pretrained LM with a dynamic entity memory . Motivated by prior work on language modeling ( Clark et al. , 2018 ; Ji et al. , 2017 ) , which uses dynamic entity representations for improving generation on smaller RNN-based models , we augment the LM with an entity memory and cross-attention blocks at each layer of the model for attending to entities that participate in the narrative . In contrast with prior work , we introduce an end-to-end trainable network with soft attention for performing reads and writes to the memory instead of separately training models to predict entity detection and reference . We also relax the hard constraints of Clark et al . ( 2018 ) and Ji et al . ( 2017 ) , who only condition on one entity per step and update an entity representation only when encountering one of its mentions . Instead , in order to increase both efficiency in the context of transformerbased networks and flexibility of the entity-token mapping , we instead perform soft reads from the entity memory based on a cross-attention mechanism . Thus , our model can condition on multiple relevant entities , and update all slots depending on the cross-attention scores after regular intervals within the narrative . Moreover , we exploit token-level entity annotations in order to regularize the cross-attention scores and better guide the reads and writes to the entity memory . We perform experiments on two narrative datasets , WritingPrompts ( Fan et al. , 2018 ) and WikiPlots,1 and find that utilizing an entity memory especially increases entity coherence according to both automatic metrics and human judges . Moreover , we experiment with different scenarios , where the LM has access to a limited narrative context ( i.e. , varying smaller context windows ) , in order to simulate model behavior in settings with much longer narratives , such as books or screenplays . Since narratives of this length can not fit into the LM ’ s short-term memory , we investigate the loss of entity-related information as we move to later narrative sections . By measuring perplexity and uncertainty on entity mentions on the original stories , we find that the dynamic entity memory is able to preserve significantly more entity-related information in limited context settings . 2 TASK FORMULATION . This work aims at the exploration of entity coherence and consistency in the context of narrative generation . Entities play a central role in narratives and are crucial for the development and quality of the story ( Jannidis , 2009 ; Frow , 2014 ; Bamman et al. , 2013 ) . According to Fludernik ( 2002 ) , there can even be narratives without plot , but not without a human experiencer in their center . Narrative theories have also studied character archetypes with specific attributes and actions as a means for analysing them ( Fludernik , 2002 ; Jung , 2014 ) . We formulate the task of entity-driven generation as conditional text generation on a set of given entities . Specifically , we identify and provide the gold entities that participate in a narrative via an entity prompt . Each entity may consist of more than one token and different entities are separated with a special separator token . Examples of entity prompts are presented in Figure 1a and details about their construction are given in Section 4.3 . Our objective is to investigate the patterns of entity usage in generated stories in comparison with human-written ones . More formally , we consider a LM that is conditioned on an entity prompt P and learns the distribution p ( x|P ) for generating narratives . The LM is trained on sequences of raw narrative text prepended with the corresponding entity prompts . The LM operates autoregressively ; that is , given P and the context generated so far x≤t = { x0 , x1 , ... , xt } , the LM computes a distribution for the next word in the narrative . Next , we define metrics for automatically measuring entity coherence and consistency in both human-written and generated stories . We evaluate the proposed metrics against human ratings in Section 5.3 . 1https : //github.com/markriedl/WikiPlots Entity coherence Various local entity coherence metrics have been suggested in literature , such as distance-based clustering and linkage coefficients ( Lioma et al. , 2016 ) and local entity coherence ( Barzilay & Lapata , 2008 ; Mesgar & Strube , 2014 ; Guinaudeau & Strube , 2013 ) . However , current LMs present high local coherence when compared with human-written stories , giving the impression that coherence has been achieved . In contrast , during preliminary analysis of longer narratives , we observed that LMs still struggle with maintaining long-range entity coherence ( see Figure 1b for a short incoherent example and Tables 7 , 8 , and 9 of the Appendix for longer examples of real generated text ) . Our main observation from generated stories is that LMs tend to drop the initial protagonists after a while and instead introduce new , irrelevant entities ( details in Section 5 ) . For quantifying this observation , we propose a new metric . We consider the protagonists of the narrative ( i.e . the entities with the most mentions ) and divide the narrative into L equal sections . Next , we compute the maximum span of mentions for each protagonist i as the maximum interval of sections where i appears in : Ci = sli − sfi . Here , sfi and sli are the indices of the sections containing the first and last mentions respectively of entity i . Entity consistency Another important aspect that we evaluate in the context of entity usage is the attributes that are given to each entity throughout the narrative ( see Figure 1b for an inconsistent example ) . Traditionally , narratives use archetypes for the protagonists ( e.g. , the “ hero ” and the “ trickster ” ; Fludernik 2002 ; Jung 2014 ) with rich and diverse features , personalities and consistent actions . As a measure of how well-developed and consistent each entity is within the narrative , we measure attribute consistency . Specifically , given all mentions per entity in a story , we consider as the attributes of the entity all verbs and adjectives that appear in the same sentence as each of its mentions . Next , we compute the percentage of unique attributes Ui for the ith entity as follows : Ui = | ⋃N j=1 , i∈Ej Aj | − ∣∣⋃N j=1 , i∈Ej Aj ⋂ ⋃N j=1 , i/∈Ej Aj ∣∣ | ⋃N j=1 , i∈Ej Aj | ( 1 ) where N is the number of sentences in the story , Ej are the entities that are mentioned in the jth sentence , Aj is the set of all attributes that appear in the jth sentence , and | · | is the size of the set . 3 METHOD . Our base LM is a pre-trained Transformer-XL ( T-XL ) model ( Dai et al. , 2019 ) conditioned on P . The T-XL LM allows us to consider an extended context window within the narrative when computing token representations in self-attention by using a cache memory , where all intermediate representations of the M tokens prior to the current context are stored and used for as context . In this work , we propose augmenting the pre-trained base LM with an entity memory ( MNEMELM ) . For attending to the entity memory , we add new , randomly initialized cross-attention blocks in parallel with self-attention per layer resembling the architecture of adapters2 ( Houlsby et al. , 2019 ) . We propose using the entity memory together with the prompt for richer entity representations and to better preserve entity-related information over a long time horizon . This addresses two limitations of prompts : 1 . They do not allow for more meaningful entity representations . For example , given a named entity such as “ Sarah King ” , the tokens from the prompt do not provide any information related to who Sarah King is , or which the attributes of Sarah King are within the context of the narrative . In contrast , our dynamic entity memory can store attributes of the entity as they appear in the text , which offers more information beyond the surface form . 2 . LMs eventually forget about the prompt when given long enough narratives ( i.e . the prompt will fall out of the short-term memory of the LM ) . In contrast , our method can efficiently store entity-related information in a fixed-size memory and independently of the current context window . We demonstrate this empirically in Section 5.1 . Memory initialization We first initialize the entity memory based on the information given in the prompt P . Specifically , each memory slot Mj , j ∈ [ 1 , Z ] represents one of the Z − 1 entities that participate in the narrative or corresponds to non-entity information ( i.e . the Zth slot is reserved for entity-irrelevant information ) . Each of the entity-related slots is initialized based on the prompt 2In contrast to adapters , we find that just training the new parameters is insufficient for narrative generation . tokens that correspond to this entity ( i.e . tokens allocated within two special separator tokens ) . For contextualizing the entity tokens before the memory initialization , we process the prompt via the LM and consider the output token-level embeddings . Next , the final representation for the jth slot is : Mj = 1K ∑K k=1 yk , where K is the number of tokens that correspond to the j th entity and yk is the output embedding of the kth token . Conditioning on a dynamic entity memory ( D-MNEMELM ) Each slot Mj = [ Kj , Vj ] of the entity memory contains a static key Kj ( i.e . a fixed surface entity representation ) and a dynamic value Vj ( i.e . a frequently updated representation based on narrative context ) , initialised as described above . To update the memory , we divide the narrative into equal-length chunks , update the entity memory after processing each chunk , and use the T-XL memory to store the previous chunks . At each layer of the pre-trained LM , we add a new , randomly initialized cross-attention block that operates in parallel with the pre-trained self-attention one . The cross-attention block takes as input the representation xi of the ith token ( either an embedding or intermediate representation ) and all memory slots M = [ K , V ] , and computes an entity-aware representation ei as follows : ait = softmax ( W tQxiW t KM T √ dM ) , t ∈ [ 1 , H ] ( 2 ) Mattit =W t MaitM ei =WE [ M att i1 ; ... ; M att iH ] ( 3 ) where H is the number of attention heads in cross-attention , [ · ; · ] denotes the concatenation operation , ait ∈ RZ , and ei ∈ Rdh . Next , we combine the entity-aware hidden representations ei with the self-attended hidden representations hi via a gating mechanism : gi = σ ( WR [ hi ; ei ] ) h ′ i = ( 1− gi ) hi + giei ( 4 ) We use the final representation h′ as the output of the modified attention block . After processing each chunk in the narrative , we compute a weighted average representation of the current chunk per memory slot given the cross-attention weights of the final layer aijt for token i , slot j and head t , and update the memory value Vj accordingly via a gating mechanism : hj = softmax ( max H t=1aijt/τ ) h ( 5 ) wj = max T i=1max H t=1aijt gj = sigmoid ( WU [ hj , Vj ] ) ( 6 ) V ′j = ( 1− wjgj ) Vj + wjgjhj , ( 7 ) where τ is a temperature hyperparameter , wj is the maximum contribution of the jth memory slot to the current chunk across all tokens T and heads H for the last layer , gj is a gate vector for updating the slot , and M ′j is the new updated value of the memory slot . Note that in addition to the gate value gj that the model computes , we also include an extra weight wj for updating the memory slots . This is used to discourage the model from updating all slots at each step and reflects which entities were used the most during reading from the memory . We also consider a variation of our model ( S-MNEMELM ) with a static entity memory . For this variation , we only consider the static keys per memory slot and do not perform any updates . Regularization of cross-attention scores Finally , although the soft attention during reading and writing to the memory allows the model to explore all entity slots , we still guide the reads and writes via an auxiliary regularization loss in the objective function . Specifically , we want to encourage the model to attend to the correct entities per token during reading from the memory , and update those slots when writing to the memory . We label every token in the context ( i.e . in the same sentence ) of an entity mention with that entity ; if a context contains multiple entities , we allow multiple labels . Given the entity labels per token i , we construct a few-hot distribution qi over all entities that participate in the narrative by attributing equal probabilities to all entities assigned to token i . Next , we minimize the per-token KL divergence loss DKL between the computed cross-attention weights aitl , where t ∈ [ 1 , H ] , l ∈ [ 1 , L ] , H the number of attention heads , and L the number of layers , and the ground-truth distribution qi for the ith token . Hence , our extra regularization loss is : R = DKL ( aitl||qi ) , and our final objective is the weighted sum of the individual losses : L = 1 T T∑ i=1 ( − log p ( xi|x < i ; P ) + λ 1 LH L∑ l=1 H∑ t=1 DKL ( aitl||qi ) ) ( 8 )
This work focuses on improving the long-range entity coherence and consistency when generating long narrative stories. The authors proposed two metrics to measure the entity coherence and consistency in terms of entity usage in generated narratives. They also propose to augment a pre-trained LM with a dynamic entity memory and cross-attention to improve the entity usage.
SP:257bc56056a757059d452f410ed4554d0e66eeb3
Towards Coherent and Consistent Use of Entities in Narrative Generation
Large pre-trained language models ( LMs ) have demonstrated impressive capabilities in generating long , fluent text ; however , there is little to no analysis on their ability to maintain entity coherence and consistency . In this work , we focus on the end task of narrative generation and systematically analyse the long-range entity coherence and consistency in generated stories . First , we propose a set of automatic metrics for measuring model performance in terms of entity usage . Given these metrics , we quantify the limitations of current LMs . Next , we propose augmenting a pre-trained LM with a dynamic entity memory in an end-to-end manner by using an auxiliary entity-related loss for guiding the reads and writes to the memory . We demonstrate that the dynamic entity memory increases entity coherence according to both automatic and human judgment and helps preserving entity-related information especially in settings with a limited context window . Finally , we also validate that our automatic metrics are correlated with human ratings and serve as a good indicator of the quality of generated stories . 1 INTRODUCTION . Large pre-trained language models ( LMs ) ( such as GPT-2 ( Radford et al. , 2019 ) , GPT-3 ( Brown et al. , 2020 ) , and models based on the Transformer-XL architecture ( Dai et al. , 2019 ) ) have radically improved text generation , producing seemingly fluent text – Clark et al . ( 2021 ) even showed that non-expert human judges can not distinguish between machine-written and human-authored texts , based on surface cues . Assuming the quality of generated text as given , most recent efforts have then focused on trying to control generation with a desired topic , factual information , or specific style ( Keskar et al. , 2019 ; Dathathri et al. , 2019 ; Shin et al. , 2020 ; Li & Liang , 2021 ) . However , anecdotally , there are still common failure cases of machine generated text in terms of entity coherence and consistency , which are fundamental properties of language . In this work , we specifically focus on the task of narrative generation in order to analyse and improve entity coherence and consistency . Entities play a central role in narratives , since they guide the plot , and all events revolve around them ( Fludernik , 2002 ; Jannidis , 2009 ; Frow , 2014 ; Bamman et al. , 2013 ) . Despite the importance of entities , recent work has mainly emphasised on controlling the topic of the generated stories using outlines , keywords or other relevant knowledge ( Xu et al. , 2020 ; Rashkin et al. , 2020 ; Fan et al. , 2019 ; Goldfarb-Tarrant et al. , 2020 ) . At the same time , entity-related structure in narrative generation has been largely understudied for large-scale pre-trained LMs . First , we propose a set of metrics for automatically measuring entity coherence and consistency . Based on these metrics , we observe that the current LMs fail to follow the patterns of entity usage we find in human-written narratives . Overall , the generated stories present significantly lower coherence and consistency , and this is especially evident for stories with complex events and many named entities . We further validate these observations by performing a human evaluation study , showing that our automatic metrics correlate with human judgment of entity coherence . Next , in order to improve these properties in narrative generation , we propose augmenting a pretrained LM with a dynamic entity memory . Motivated by prior work on language modeling ( Clark et al. , 2018 ; Ji et al. , 2017 ) , which uses dynamic entity representations for improving generation on smaller RNN-based models , we augment the LM with an entity memory and cross-attention blocks at each layer of the model for attending to entities that participate in the narrative . In contrast with prior work , we introduce an end-to-end trainable network with soft attention for performing reads and writes to the memory instead of separately training models to predict entity detection and reference . We also relax the hard constraints of Clark et al . ( 2018 ) and Ji et al . ( 2017 ) , who only condition on one entity per step and update an entity representation only when encountering one of its mentions . Instead , in order to increase both efficiency in the context of transformerbased networks and flexibility of the entity-token mapping , we instead perform soft reads from the entity memory based on a cross-attention mechanism . Thus , our model can condition on multiple relevant entities , and update all slots depending on the cross-attention scores after regular intervals within the narrative . Moreover , we exploit token-level entity annotations in order to regularize the cross-attention scores and better guide the reads and writes to the entity memory . We perform experiments on two narrative datasets , WritingPrompts ( Fan et al. , 2018 ) and WikiPlots,1 and find that utilizing an entity memory especially increases entity coherence according to both automatic metrics and human judges . Moreover , we experiment with different scenarios , where the LM has access to a limited narrative context ( i.e. , varying smaller context windows ) , in order to simulate model behavior in settings with much longer narratives , such as books or screenplays . Since narratives of this length can not fit into the LM ’ s short-term memory , we investigate the loss of entity-related information as we move to later narrative sections . By measuring perplexity and uncertainty on entity mentions on the original stories , we find that the dynamic entity memory is able to preserve significantly more entity-related information in limited context settings . 2 TASK FORMULATION . This work aims at the exploration of entity coherence and consistency in the context of narrative generation . Entities play a central role in narratives and are crucial for the development and quality of the story ( Jannidis , 2009 ; Frow , 2014 ; Bamman et al. , 2013 ) . According to Fludernik ( 2002 ) , there can even be narratives without plot , but not without a human experiencer in their center . Narrative theories have also studied character archetypes with specific attributes and actions as a means for analysing them ( Fludernik , 2002 ; Jung , 2014 ) . We formulate the task of entity-driven generation as conditional text generation on a set of given entities . Specifically , we identify and provide the gold entities that participate in a narrative via an entity prompt . Each entity may consist of more than one token and different entities are separated with a special separator token . Examples of entity prompts are presented in Figure 1a and details about their construction are given in Section 4.3 . Our objective is to investigate the patterns of entity usage in generated stories in comparison with human-written ones . More formally , we consider a LM that is conditioned on an entity prompt P and learns the distribution p ( x|P ) for generating narratives . The LM is trained on sequences of raw narrative text prepended with the corresponding entity prompts . The LM operates autoregressively ; that is , given P and the context generated so far x≤t = { x0 , x1 , ... , xt } , the LM computes a distribution for the next word in the narrative . Next , we define metrics for automatically measuring entity coherence and consistency in both human-written and generated stories . We evaluate the proposed metrics against human ratings in Section 5.3 . 1https : //github.com/markriedl/WikiPlots Entity coherence Various local entity coherence metrics have been suggested in literature , such as distance-based clustering and linkage coefficients ( Lioma et al. , 2016 ) and local entity coherence ( Barzilay & Lapata , 2008 ; Mesgar & Strube , 2014 ; Guinaudeau & Strube , 2013 ) . However , current LMs present high local coherence when compared with human-written stories , giving the impression that coherence has been achieved . In contrast , during preliminary analysis of longer narratives , we observed that LMs still struggle with maintaining long-range entity coherence ( see Figure 1b for a short incoherent example and Tables 7 , 8 , and 9 of the Appendix for longer examples of real generated text ) . Our main observation from generated stories is that LMs tend to drop the initial protagonists after a while and instead introduce new , irrelevant entities ( details in Section 5 ) . For quantifying this observation , we propose a new metric . We consider the protagonists of the narrative ( i.e . the entities with the most mentions ) and divide the narrative into L equal sections . Next , we compute the maximum span of mentions for each protagonist i as the maximum interval of sections where i appears in : Ci = sli − sfi . Here , sfi and sli are the indices of the sections containing the first and last mentions respectively of entity i . Entity consistency Another important aspect that we evaluate in the context of entity usage is the attributes that are given to each entity throughout the narrative ( see Figure 1b for an inconsistent example ) . Traditionally , narratives use archetypes for the protagonists ( e.g. , the “ hero ” and the “ trickster ” ; Fludernik 2002 ; Jung 2014 ) with rich and diverse features , personalities and consistent actions . As a measure of how well-developed and consistent each entity is within the narrative , we measure attribute consistency . Specifically , given all mentions per entity in a story , we consider as the attributes of the entity all verbs and adjectives that appear in the same sentence as each of its mentions . Next , we compute the percentage of unique attributes Ui for the ith entity as follows : Ui = | ⋃N j=1 , i∈Ej Aj | − ∣∣⋃N j=1 , i∈Ej Aj ⋂ ⋃N j=1 , i/∈Ej Aj ∣∣ | ⋃N j=1 , i∈Ej Aj | ( 1 ) where N is the number of sentences in the story , Ej are the entities that are mentioned in the jth sentence , Aj is the set of all attributes that appear in the jth sentence , and | · | is the size of the set . 3 METHOD . Our base LM is a pre-trained Transformer-XL ( T-XL ) model ( Dai et al. , 2019 ) conditioned on P . The T-XL LM allows us to consider an extended context window within the narrative when computing token representations in self-attention by using a cache memory , where all intermediate representations of the M tokens prior to the current context are stored and used for as context . In this work , we propose augmenting the pre-trained base LM with an entity memory ( MNEMELM ) . For attending to the entity memory , we add new , randomly initialized cross-attention blocks in parallel with self-attention per layer resembling the architecture of adapters2 ( Houlsby et al. , 2019 ) . We propose using the entity memory together with the prompt for richer entity representations and to better preserve entity-related information over a long time horizon . This addresses two limitations of prompts : 1 . They do not allow for more meaningful entity representations . For example , given a named entity such as “ Sarah King ” , the tokens from the prompt do not provide any information related to who Sarah King is , or which the attributes of Sarah King are within the context of the narrative . In contrast , our dynamic entity memory can store attributes of the entity as they appear in the text , which offers more information beyond the surface form . 2 . LMs eventually forget about the prompt when given long enough narratives ( i.e . the prompt will fall out of the short-term memory of the LM ) . In contrast , our method can efficiently store entity-related information in a fixed-size memory and independently of the current context window . We demonstrate this empirically in Section 5.1 . Memory initialization We first initialize the entity memory based on the information given in the prompt P . Specifically , each memory slot Mj , j ∈ [ 1 , Z ] represents one of the Z − 1 entities that participate in the narrative or corresponds to non-entity information ( i.e . the Zth slot is reserved for entity-irrelevant information ) . Each of the entity-related slots is initialized based on the prompt 2In contrast to adapters , we find that just training the new parameters is insufficient for narrative generation . tokens that correspond to this entity ( i.e . tokens allocated within two special separator tokens ) . For contextualizing the entity tokens before the memory initialization , we process the prompt via the LM and consider the output token-level embeddings . Next , the final representation for the jth slot is : Mj = 1K ∑K k=1 yk , where K is the number of tokens that correspond to the j th entity and yk is the output embedding of the kth token . Conditioning on a dynamic entity memory ( D-MNEMELM ) Each slot Mj = [ Kj , Vj ] of the entity memory contains a static key Kj ( i.e . a fixed surface entity representation ) and a dynamic value Vj ( i.e . a frequently updated representation based on narrative context ) , initialised as described above . To update the memory , we divide the narrative into equal-length chunks , update the entity memory after processing each chunk , and use the T-XL memory to store the previous chunks . At each layer of the pre-trained LM , we add a new , randomly initialized cross-attention block that operates in parallel with the pre-trained self-attention one . The cross-attention block takes as input the representation xi of the ith token ( either an embedding or intermediate representation ) and all memory slots M = [ K , V ] , and computes an entity-aware representation ei as follows : ait = softmax ( W tQxiW t KM T √ dM ) , t ∈ [ 1 , H ] ( 2 ) Mattit =W t MaitM ei =WE [ M att i1 ; ... ; M att iH ] ( 3 ) where H is the number of attention heads in cross-attention , [ · ; · ] denotes the concatenation operation , ait ∈ RZ , and ei ∈ Rdh . Next , we combine the entity-aware hidden representations ei with the self-attended hidden representations hi via a gating mechanism : gi = σ ( WR [ hi ; ei ] ) h ′ i = ( 1− gi ) hi + giei ( 4 ) We use the final representation h′ as the output of the modified attention block . After processing each chunk in the narrative , we compute a weighted average representation of the current chunk per memory slot given the cross-attention weights of the final layer aijt for token i , slot j and head t , and update the memory value Vj accordingly via a gating mechanism : hj = softmax ( max H t=1aijt/τ ) h ( 5 ) wj = max T i=1max H t=1aijt gj = sigmoid ( WU [ hj , Vj ] ) ( 6 ) V ′j = ( 1− wjgj ) Vj + wjgjhj , ( 7 ) where τ is a temperature hyperparameter , wj is the maximum contribution of the jth memory slot to the current chunk across all tokens T and heads H for the last layer , gj is a gate vector for updating the slot , and M ′j is the new updated value of the memory slot . Note that in addition to the gate value gj that the model computes , we also include an extra weight wj for updating the memory slots . This is used to discourage the model from updating all slots at each step and reflects which entities were used the most during reading from the memory . We also consider a variation of our model ( S-MNEMELM ) with a static entity memory . For this variation , we only consider the static keys per memory slot and do not perform any updates . Regularization of cross-attention scores Finally , although the soft attention during reading and writing to the memory allows the model to explore all entity slots , we still guide the reads and writes via an auxiliary regularization loss in the objective function . Specifically , we want to encourage the model to attend to the correct entities per token during reading from the memory , and update those slots when writing to the memory . We label every token in the context ( i.e . in the same sentence ) of an entity mention with that entity ; if a context contains multiple entities , we allow multiple labels . Given the entity labels per token i , we construct a few-hot distribution qi over all entities that participate in the narrative by attributing equal probabilities to all entities assigned to token i . Next , we minimize the per-token KL divergence loss DKL between the computed cross-attention weights aitl , where t ∈ [ 1 , H ] , l ∈ [ 1 , L ] , H the number of attention heads , and L the number of layers , and the ground-truth distribution qi for the ith token . Hence , our extra regularization loss is : R = DKL ( aitl||qi ) , and our final objective is the weighted sum of the individual losses : L = 1 T T∑ i=1 ( − log p ( xi|x < i ; P ) + λ 1 LH L∑ l=1 H∑ t=1 DKL ( aitl||qi ) ) ( 8 )
In this paper, the main contributions are 1)analyze the entity coherence of pretrained LMs by leveraging some existing metrics and also four newly proposed metrics 2) propose a new generative model to have a higher quality generated narratives from entity coherence and consistency perspectives. Authors develop a model by adding a dynamic entity memory to the existing pretrained LMs. The cross attention between input text and entity memory alongside the self-attention coming from pretrained-LM helps to not forget the previous entities and their attributes during generating narratives.
SP:257bc56056a757059d452f410ed4554d0e66eeb3
Towards Coherent and Consistent Use of Entities in Narrative Generation
Large pre-trained language models ( LMs ) have demonstrated impressive capabilities in generating long , fluent text ; however , there is little to no analysis on their ability to maintain entity coherence and consistency . In this work , we focus on the end task of narrative generation and systematically analyse the long-range entity coherence and consistency in generated stories . First , we propose a set of automatic metrics for measuring model performance in terms of entity usage . Given these metrics , we quantify the limitations of current LMs . Next , we propose augmenting a pre-trained LM with a dynamic entity memory in an end-to-end manner by using an auxiliary entity-related loss for guiding the reads and writes to the memory . We demonstrate that the dynamic entity memory increases entity coherence according to both automatic and human judgment and helps preserving entity-related information especially in settings with a limited context window . Finally , we also validate that our automatic metrics are correlated with human ratings and serve as a good indicator of the quality of generated stories . 1 INTRODUCTION . Large pre-trained language models ( LMs ) ( such as GPT-2 ( Radford et al. , 2019 ) , GPT-3 ( Brown et al. , 2020 ) , and models based on the Transformer-XL architecture ( Dai et al. , 2019 ) ) have radically improved text generation , producing seemingly fluent text – Clark et al . ( 2021 ) even showed that non-expert human judges can not distinguish between machine-written and human-authored texts , based on surface cues . Assuming the quality of generated text as given , most recent efforts have then focused on trying to control generation with a desired topic , factual information , or specific style ( Keskar et al. , 2019 ; Dathathri et al. , 2019 ; Shin et al. , 2020 ; Li & Liang , 2021 ) . However , anecdotally , there are still common failure cases of machine generated text in terms of entity coherence and consistency , which are fundamental properties of language . In this work , we specifically focus on the task of narrative generation in order to analyse and improve entity coherence and consistency . Entities play a central role in narratives , since they guide the plot , and all events revolve around them ( Fludernik , 2002 ; Jannidis , 2009 ; Frow , 2014 ; Bamman et al. , 2013 ) . Despite the importance of entities , recent work has mainly emphasised on controlling the topic of the generated stories using outlines , keywords or other relevant knowledge ( Xu et al. , 2020 ; Rashkin et al. , 2020 ; Fan et al. , 2019 ; Goldfarb-Tarrant et al. , 2020 ) . At the same time , entity-related structure in narrative generation has been largely understudied for large-scale pre-trained LMs . First , we propose a set of metrics for automatically measuring entity coherence and consistency . Based on these metrics , we observe that the current LMs fail to follow the patterns of entity usage we find in human-written narratives . Overall , the generated stories present significantly lower coherence and consistency , and this is especially evident for stories with complex events and many named entities . We further validate these observations by performing a human evaluation study , showing that our automatic metrics correlate with human judgment of entity coherence . Next , in order to improve these properties in narrative generation , we propose augmenting a pretrained LM with a dynamic entity memory . Motivated by prior work on language modeling ( Clark et al. , 2018 ; Ji et al. , 2017 ) , which uses dynamic entity representations for improving generation on smaller RNN-based models , we augment the LM with an entity memory and cross-attention blocks at each layer of the model for attending to entities that participate in the narrative . In contrast with prior work , we introduce an end-to-end trainable network with soft attention for performing reads and writes to the memory instead of separately training models to predict entity detection and reference . We also relax the hard constraints of Clark et al . ( 2018 ) and Ji et al . ( 2017 ) , who only condition on one entity per step and update an entity representation only when encountering one of its mentions . Instead , in order to increase both efficiency in the context of transformerbased networks and flexibility of the entity-token mapping , we instead perform soft reads from the entity memory based on a cross-attention mechanism . Thus , our model can condition on multiple relevant entities , and update all slots depending on the cross-attention scores after regular intervals within the narrative . Moreover , we exploit token-level entity annotations in order to regularize the cross-attention scores and better guide the reads and writes to the entity memory . We perform experiments on two narrative datasets , WritingPrompts ( Fan et al. , 2018 ) and WikiPlots,1 and find that utilizing an entity memory especially increases entity coherence according to both automatic metrics and human judges . Moreover , we experiment with different scenarios , where the LM has access to a limited narrative context ( i.e. , varying smaller context windows ) , in order to simulate model behavior in settings with much longer narratives , such as books or screenplays . Since narratives of this length can not fit into the LM ’ s short-term memory , we investigate the loss of entity-related information as we move to later narrative sections . By measuring perplexity and uncertainty on entity mentions on the original stories , we find that the dynamic entity memory is able to preserve significantly more entity-related information in limited context settings . 2 TASK FORMULATION . This work aims at the exploration of entity coherence and consistency in the context of narrative generation . Entities play a central role in narratives and are crucial for the development and quality of the story ( Jannidis , 2009 ; Frow , 2014 ; Bamman et al. , 2013 ) . According to Fludernik ( 2002 ) , there can even be narratives without plot , but not without a human experiencer in their center . Narrative theories have also studied character archetypes with specific attributes and actions as a means for analysing them ( Fludernik , 2002 ; Jung , 2014 ) . We formulate the task of entity-driven generation as conditional text generation on a set of given entities . Specifically , we identify and provide the gold entities that participate in a narrative via an entity prompt . Each entity may consist of more than one token and different entities are separated with a special separator token . Examples of entity prompts are presented in Figure 1a and details about their construction are given in Section 4.3 . Our objective is to investigate the patterns of entity usage in generated stories in comparison with human-written ones . More formally , we consider a LM that is conditioned on an entity prompt P and learns the distribution p ( x|P ) for generating narratives . The LM is trained on sequences of raw narrative text prepended with the corresponding entity prompts . The LM operates autoregressively ; that is , given P and the context generated so far x≤t = { x0 , x1 , ... , xt } , the LM computes a distribution for the next word in the narrative . Next , we define metrics for automatically measuring entity coherence and consistency in both human-written and generated stories . We evaluate the proposed metrics against human ratings in Section 5.3 . 1https : //github.com/markriedl/WikiPlots Entity coherence Various local entity coherence metrics have been suggested in literature , such as distance-based clustering and linkage coefficients ( Lioma et al. , 2016 ) and local entity coherence ( Barzilay & Lapata , 2008 ; Mesgar & Strube , 2014 ; Guinaudeau & Strube , 2013 ) . However , current LMs present high local coherence when compared with human-written stories , giving the impression that coherence has been achieved . In contrast , during preliminary analysis of longer narratives , we observed that LMs still struggle with maintaining long-range entity coherence ( see Figure 1b for a short incoherent example and Tables 7 , 8 , and 9 of the Appendix for longer examples of real generated text ) . Our main observation from generated stories is that LMs tend to drop the initial protagonists after a while and instead introduce new , irrelevant entities ( details in Section 5 ) . For quantifying this observation , we propose a new metric . We consider the protagonists of the narrative ( i.e . the entities with the most mentions ) and divide the narrative into L equal sections . Next , we compute the maximum span of mentions for each protagonist i as the maximum interval of sections where i appears in : Ci = sli − sfi . Here , sfi and sli are the indices of the sections containing the first and last mentions respectively of entity i . Entity consistency Another important aspect that we evaluate in the context of entity usage is the attributes that are given to each entity throughout the narrative ( see Figure 1b for an inconsistent example ) . Traditionally , narratives use archetypes for the protagonists ( e.g. , the “ hero ” and the “ trickster ” ; Fludernik 2002 ; Jung 2014 ) with rich and diverse features , personalities and consistent actions . As a measure of how well-developed and consistent each entity is within the narrative , we measure attribute consistency . Specifically , given all mentions per entity in a story , we consider as the attributes of the entity all verbs and adjectives that appear in the same sentence as each of its mentions . Next , we compute the percentage of unique attributes Ui for the ith entity as follows : Ui = | ⋃N j=1 , i∈Ej Aj | − ∣∣⋃N j=1 , i∈Ej Aj ⋂ ⋃N j=1 , i/∈Ej Aj ∣∣ | ⋃N j=1 , i∈Ej Aj | ( 1 ) where N is the number of sentences in the story , Ej are the entities that are mentioned in the jth sentence , Aj is the set of all attributes that appear in the jth sentence , and | · | is the size of the set . 3 METHOD . Our base LM is a pre-trained Transformer-XL ( T-XL ) model ( Dai et al. , 2019 ) conditioned on P . The T-XL LM allows us to consider an extended context window within the narrative when computing token representations in self-attention by using a cache memory , where all intermediate representations of the M tokens prior to the current context are stored and used for as context . In this work , we propose augmenting the pre-trained base LM with an entity memory ( MNEMELM ) . For attending to the entity memory , we add new , randomly initialized cross-attention blocks in parallel with self-attention per layer resembling the architecture of adapters2 ( Houlsby et al. , 2019 ) . We propose using the entity memory together with the prompt for richer entity representations and to better preserve entity-related information over a long time horizon . This addresses two limitations of prompts : 1 . They do not allow for more meaningful entity representations . For example , given a named entity such as “ Sarah King ” , the tokens from the prompt do not provide any information related to who Sarah King is , or which the attributes of Sarah King are within the context of the narrative . In contrast , our dynamic entity memory can store attributes of the entity as they appear in the text , which offers more information beyond the surface form . 2 . LMs eventually forget about the prompt when given long enough narratives ( i.e . the prompt will fall out of the short-term memory of the LM ) . In contrast , our method can efficiently store entity-related information in a fixed-size memory and independently of the current context window . We demonstrate this empirically in Section 5.1 . Memory initialization We first initialize the entity memory based on the information given in the prompt P . Specifically , each memory slot Mj , j ∈ [ 1 , Z ] represents one of the Z − 1 entities that participate in the narrative or corresponds to non-entity information ( i.e . the Zth slot is reserved for entity-irrelevant information ) . Each of the entity-related slots is initialized based on the prompt 2In contrast to adapters , we find that just training the new parameters is insufficient for narrative generation . tokens that correspond to this entity ( i.e . tokens allocated within two special separator tokens ) . For contextualizing the entity tokens before the memory initialization , we process the prompt via the LM and consider the output token-level embeddings . Next , the final representation for the jth slot is : Mj = 1K ∑K k=1 yk , where K is the number of tokens that correspond to the j th entity and yk is the output embedding of the kth token . Conditioning on a dynamic entity memory ( D-MNEMELM ) Each slot Mj = [ Kj , Vj ] of the entity memory contains a static key Kj ( i.e . a fixed surface entity representation ) and a dynamic value Vj ( i.e . a frequently updated representation based on narrative context ) , initialised as described above . To update the memory , we divide the narrative into equal-length chunks , update the entity memory after processing each chunk , and use the T-XL memory to store the previous chunks . At each layer of the pre-trained LM , we add a new , randomly initialized cross-attention block that operates in parallel with the pre-trained self-attention one . The cross-attention block takes as input the representation xi of the ith token ( either an embedding or intermediate representation ) and all memory slots M = [ K , V ] , and computes an entity-aware representation ei as follows : ait = softmax ( W tQxiW t KM T √ dM ) , t ∈ [ 1 , H ] ( 2 ) Mattit =W t MaitM ei =WE [ M att i1 ; ... ; M att iH ] ( 3 ) where H is the number of attention heads in cross-attention , [ · ; · ] denotes the concatenation operation , ait ∈ RZ , and ei ∈ Rdh . Next , we combine the entity-aware hidden representations ei with the self-attended hidden representations hi via a gating mechanism : gi = σ ( WR [ hi ; ei ] ) h ′ i = ( 1− gi ) hi + giei ( 4 ) We use the final representation h′ as the output of the modified attention block . After processing each chunk in the narrative , we compute a weighted average representation of the current chunk per memory slot given the cross-attention weights of the final layer aijt for token i , slot j and head t , and update the memory value Vj accordingly via a gating mechanism : hj = softmax ( max H t=1aijt/τ ) h ( 5 ) wj = max T i=1max H t=1aijt gj = sigmoid ( WU [ hj , Vj ] ) ( 6 ) V ′j = ( 1− wjgj ) Vj + wjgjhj , ( 7 ) where τ is a temperature hyperparameter , wj is the maximum contribution of the jth memory slot to the current chunk across all tokens T and heads H for the last layer , gj is a gate vector for updating the slot , and M ′j is the new updated value of the memory slot . Note that in addition to the gate value gj that the model computes , we also include an extra weight wj for updating the memory slots . This is used to discourage the model from updating all slots at each step and reflects which entities were used the most during reading from the memory . We also consider a variation of our model ( S-MNEMELM ) with a static entity memory . For this variation , we only consider the static keys per memory slot and do not perform any updates . Regularization of cross-attention scores Finally , although the soft attention during reading and writing to the memory allows the model to explore all entity slots , we still guide the reads and writes via an auxiliary regularization loss in the objective function . Specifically , we want to encourage the model to attend to the correct entities per token during reading from the memory , and update those slots when writing to the memory . We label every token in the context ( i.e . in the same sentence ) of an entity mention with that entity ; if a context contains multiple entities , we allow multiple labels . Given the entity labels per token i , we construct a few-hot distribution qi over all entities that participate in the narrative by attributing equal probabilities to all entities assigned to token i . Next , we minimize the per-token KL divergence loss DKL between the computed cross-attention weights aitl , where t ∈ [ 1 , H ] , l ∈ [ 1 , L ] , H the number of attention heads , and L the number of layers , and the ground-truth distribution qi for the ith token . Hence , our extra regularization loss is : R = DKL ( aitl||qi ) , and our final objective is the weighted sum of the individual losses : L = 1 T T∑ i=1 ( − log p ( xi|x < i ; P ) + λ 1 LH L∑ l=1 H∑ t=1 DKL ( aitl||qi ) ) ( 8 )
The authors of this paper propose to tackle the problem of coherency and the consistent use of entities for the task of narrative generation. To achieve this, the authors propose an approach of augmenting pretrained language models with entity memory and cross attention blocks that places an emphasis on the entities in the narrative. The proposed approach is evaluated on the WritingPrompts and the WikiPlots datasets. From an evaluation perspective, the authors propose two new evaluation metrics for measuring entity coherence and consistency. To measure entity coherence, the authors propose dividing the narrative into L equal sections and computing the maximum interval span of each entity as the difference between first and last mention respectively. Similarly for entity consistency, the authors propose measuring entity consistency through the concept of measuring attribute consistency within the narrative. Contributions: 1. A new approach of augmenting language models with entity memory that helps in entity consistency and coherence across narrative generation tasks 2. Two new metrics to evaluate consistency and coherency in the generated outputs.
SP:257bc56056a757059d452f410ed4554d0e66eeb3