paper_name
stringlengths
11
170
text
stringlengths
8.07k
307k
summary
stringlengths
152
6.16k
paper_id
stringlengths
43
43
Neural Topic Model via Optimal Transport
1 INTRODUCTION . As an unsupervised approach , topic modelling has enjoyed great success in automatic text analysis . In general , a topic model aims to discover a set of latent topics from a collection of documents , each of which describes an interpretable semantic concept . Topic models like Latent Dirichlet Allocation ( LDA ) ( Blei et al. , 2003 ) and its hierarchical/Bayesian extensions , e.g. , in Blei et al . ( 2010 ) ; Paisley et al . ( 2015 ) ; Gan et al . ( 2015 ) ; Zhou et al . ( 2016 ) have achieved impressive performance for document analysis . Recently , the developments of Variational AutoEncoders ( VAEs ) and Autoencoding Variational Inference ( AVI ) ( Kingma & Welling , 2013 ; Rezende et al. , 2014 ) have facilitated the proposal of Neural Topic Models ( NTMs ) such as in Miao et al . ( 2016 ) ; Srivastava & Sutton ( 2017 ) ; Krishnan et al . ( 2018 ) ; Burkhardt & Kramer ( 2019 ) . Inspired by VAE , many NTMs use an encoder that takes the Bag-of-Words ( BoW ) representation of a document as input and approximates the posterior distribution of the latent topics . The posterior samples are further input into a decoder to reconstruct the BoW representation . Compared with conventional topic models , NTMs usually enjoy better flexibility and scalability , which are important for the applications on large-scale data . Despite the promising performance and recent popularity , there are several shortcomings for existing NTMs , which could hinder their usefulness and further extensions . i ) The training and inference processes of NTMs are typically complex due to the prior and posterior constructions of latent topics . To encourage topic sparsity and smoothness , Dirichlet ( Burkhardt & Kramer , 2019 ) or gamma ( Zhang et al. , 2018 ) distributions are usually used as the prior and posterior of topics , but reparameterisation is inapplicable to them , thus , complex sampling schemes or approximations have to be used , which could limit the model flexibility . ii ) A desideratum of a topic model is to generate better topical representations of documents with more coherent and diverse topics ; but for many existing NTMs , it is hard to achieve good document representation and coherent/diverse topics at the same time . This is because the objective of NTMs is to achieve lower reconstruction error , which usually means topics are less coherent and diverse , as observed and analysed in Srivastava & Sutton ( 2017 ) ; Burkhardt & Kramer ( 2019 ) . iii ) It is well-known that topic models degrade their performance severely on short documents such as tweets , news headlines and product reviews , as each individual document contains insufficient word co-occurrence information . This issue can be exacerbated for NTMs because of the use of the encoder and decoder networks , which are usually more vulnerable to data sparsity . To address the above shortcomings for NTMs , we in this paper propose a neural topic model , which is built upon a novel Optimal Transport ( OT ) framework derived from a new view of topic modelling . For a document , we consider its content to be encoded by two representations : the observed representation , x , a distribution over all the words in the vocabulary and the latent representation , z , a distribution over all the topics . x can be obtained by normalising a document ’ s word count vector while z needs to be learned by a model . For a document collection , the vocabulary size ( i.e. , the number of unique words ) can be very large but one individual document usually consists of a tiny subset of the words . Therefore , x is a sparse and low-level representation of the semantic information of a document . As the number of topics is much smaller than the vocabulary size , z is the relatively dense and high-level representation of the same content . Therefore , the learning of a topic model can be viewed as the process of learning the distribution z to be as close to the distribution x as possible . Accordingly , it is crucial to investigate how to measure the distance between two distributions with different supports ( i.e. , words to x and topics to z ) . As optimal transport is a powerful tool for measuring the distance travelled in transporting the mass in one distribution to match another given a specific cost function , and recent development on computational OT ( e.g. , in Cuturi ( 2013 ) ; Frogner et al . ( 2015 ) ; Seguy et al . ( 2018 ) ; Peyré et al . ( 2019 ) ) has shown the promising feasibility to efficiently compute OT for large-scale problems , it is natural for us to develop a new NTM based on the minimisation of OT . Specifically , our model leverages an encoder that outputs topic distribution z of a document by taking its word count vector as input like standard NTMs , but we minimise the OT distance between x and z , which are two discrete distributions on the support of words and topics , respectively . Notably , the cost function of the OT distance specifies the weights between topics and words , which we define as the distance in an embedding space . To represent their semantics , all the topics and words are embedded in this space . By leveraging the pretrained word embeddings , the cost function is then a function of topic embeddings , which will be learned jointly with the encoder . With the advanced properties of OT on modelling geometric structures on spaces of probability distributions , our model is able to achieve a better balance between obtaining good document representation and generating coherent/diverse topics . In addition , our model eases the burden of designing complex sampling schemes for the posterior of NTMs . More interestingly , our model is a natural way of incorporating pretrained word embeddings , which have been demonstrated to alleviate the issue of insufficient word co-occurrence information in short texts ( Zhao et al. , 2017 ; Dieng et al. , 2020 ) . With extensive experiments , our model can be shown to enjoy the state-of-the-art performance in terms of both topic quality and document representations for both regular and short texts . 2 BACKGROUND . In this section , we recap the essential background of neural topic models and optimal transport . 2.1 NEURAL TOPIC MODELS . Most of existing NTMs can be viewed as the extensions of the framework of VAEs where the latent variables can be interpreted as topics . Suppose the document collection to be analysed has V unique words ( i.e. , vocabulary size ) . Each document consists of a word count vector denoted as x ∈ NV and a latent distribution over K topics : z ∈ RK . An NTM assumes that z for a document is generated from a prior distribution p ( z ) and x is generated by the conditional distribution pφ ( x|z ) that is modelled by a decoder φ . The model ’ s goal is to infer the topic distribution given the word counts , i.e. , to calculate the posterior p ( z|x ) , which is approximated by the variational distribution qθ ( z|x ) modelled by an encoder θ . Similar to VAEs , the training objective of NTMs is the maximisation of the Evidence Lower BOund ( ELBO ) : max θ , φ ( Eqθ ( z|x ) [ log pφ ( x|z ) ] −KL [ qθ ( z|x ) ‖ p ( z ) ] ) . ( 1 ) The first term above is the expected log-likelihood or reconstruction error . As x is a count-valued vector , it is usually assumed to be generated from the multinomial distribution : pφ ( x|z ) : = Multi ( φ ( z ) ) , where φ ( z ) is a probability vector output from the decoder . Therefore , the expected log-likelihood is proportional to xT log φ ( z ) . The second term is the Kullback–Leibler ( KL ) divergence that regularises qθ ( z|x ) to be close to its prior p ( z ) . To interpret topics with words , φ ( z ) is usually constructed by a single-layer network ( Srivastava & Sutton , 2017 ) : φ ( z ) : = softmax ( Wz ) , where W ∈ RV×K indicates the weights between topics and words . Different NTMs may vary in the prior and the posterior of z , for example , the model in Miao et al . ( 2017 ) applies Gaussian distributions for them and Srivastava & Sutton ( 2017 ) ; Burkhardt & Kramer ( 2019 ) show that Dirichlet is a better choice . However , reparameterisation can not be directly applied to a Dirichlet , so various approximations and sampling schemes have been proposed . 2.2 OPTIMAL TRANSPORT . OT distances have been widely used for the comparison of probabilities . Here we limit our discussion to OT for discrete distributions , although it applies for continuous distributions as well . Specifically , let us consider two probability vectors r ∈ ∆Dr and c ∈ ∆Dc , where ∆D denotes a D − 1 simplex . The OT distance1 between the two probability vectors can be defined as : dM ( r , c ) : = min P∈U ( r , c ) 〈P , M〉 , ( 2 ) where 〈· , ·〉 denotes the Frobenius dot-product ; M ∈ RDr×Dc≥0 is the cost matrix/function of the transport ; P ∈ RDr×Dc > 0 is the transport matrix/plan ; U ( r , c ) denotes the transport polytope of r and c , which is the polyhedral set of Dr × Dc matrices : U ( r , c ) : = { P ∈ RDr×Dc > 0 |P1Dc = r , PT1Dr = c } ; and 1D is the D dimensional vector of ones . Intuitively , if we consider two discrete random variables X ∼ Categorical ( r ) and Y ∼ Categorical ( c ) , the transport matrix P is a joint probability of ( X , Y ) , i.e. , p ( X = i , Y = j ) = pij and U ( r , c ) is the set of all the joint probabilities . The above optimal transport distance can be computed by finding the optimal transport matrix P∗ . It is also noteworthy that the Wasserstein distance can be viewed as a specific case of the OT distances . As directly optimising Eq . ( 2 ) can be time-consuming for large-scale problems , a regularised optimal transport distance with an entropic constraint is introduced in Cuturi ( 2013 ) , named the Sinkhorn distance : dM , α ( r , c ) : = min P∈Uα ( r , c ) 〈P , M〉 , ( 3 ) where Uα ( r , c ) : = { P ∈ U ( r , c ) |h ( P ) ≥ h ( r ) + h ( c ) − α } , h ( · ) is the entropy function , and α ∈ [ 0 , ∞ ) . To compute the Sinkhorn distance , a Lagrange multiplier is introduced for the entropy constraint to minimise Eq . ( 3 ) , resulting in the Sinkhorn algorithm , widely-used for discrete OT problems .
The paper proposes a neural topic model derived from the perspective of optimal transport (OT). Topic embeddings are learned as part of the training process and is used to construct the cost matrix of the transport. The cost function based on the OT distance is further improved by combining with the cross-entropy loss and by using the Sinkhorn distance to replace the OT distance.
SP:a020f6bca5d85f83d595e5b724e32394009dcd7e
Memformer: The Memory-Augmented Transformer
1 INTRODUCTION . Memory has a fundamental role in human cognition . Humans perceive and encode sensory information into a compressed representation in neurons , and later our brains can effectively retrieve past information to accomplish various tasks . The formation of memories involves complex cognitive processes . Modeling and studying the behavior of human memory is still a challenging research problem in many academic areas . Many researchers have attempted to incorporate memory systems in artificial neural networks . Early works like recurrent neural networks ( RNN ) ( Rumelhart et al. , 1988 ) , including LSTM ( Hochreiter & Schmidhuber , 1997 ) model temporal sequences with their internal compressed state vector as memory . Although RNNs are theoretically Turing-complete , they are limited in preserving the longterm information due to the memory bottleneck . To alleviate the limitation , more powerful memory network architectures such as Neural Turing Machine ( NTM ) ( Graves et al. , 2014 ) , Differential Neural Computer ( DNC ) ( Graves et al. , 2016 ) have been proposed by leveraging a large external memory . However , due to their complex memory addressing mechanism , they are not widely used in NLP . More recently , Vaswani et al . ( 2017 ) proposes Transformer by ditching the use of memory and recurrence . Instead , it maintains all O ( N2 ) dependencies in the sequence with self-attention ( Bahdanau et al. , 2015 ) . Transformer and its followers have achieved great success in various NLP tasks . Nevertheless , the quadratic complexity can be extremely costly when the input sequence is long . Some works address the limitations of self-attention , including Reformer , Sparse Transformer , Longformer , Linformer , etc ( Child et al. , 2019 ; Kitaev et al. , 2020 ; Wang et al. , 2020 ) . They successfully reduce the complexity of self-attention and can process longer sequences . However , the space cost still scales with sequence length , which can not be fully eliminated without memory and recurrence . Transformer-XL ( Dai et al. , 2019 ) re-introduces the concept of memory and recurrence . It caches each layer ’ s hidden states of self-attention into a fixed size queue and re-uses them in the later attention computation . However , the memory as raw hidden states can not effectively compress high-level information . Transformer-XL in practice needs a huge memory size to perform well . Compressive Transformer ( Rae et al. , 2020 ) improves upon Transformer-XL by further compressing its memories into fewer vectors via a compression network . However , as mentioned in the papers , both Transformer-XL and Compressive Transformer still have a theoretical maximum temporal range due to the uni-directional self-attention constraint . In this work , we propose Memformer , which includes a more efficient memory system with a Transformer encoder-decoder architecture . The resulting model has a theoretically unlimited temporal range of memorization . We also improve the relative positional encoding in Transformer-XL with a simplified version . As the traditional back-propagation through time ( BPTT ) has an unaffordable memory cost for our model , we introduce a new optimization scheme , memory replay backpropagation ( MRBP ) , to significantly reduce the memory cost of training recurrent neural networks with large memory . We show that Memformer is compatible with different self-supervised tasks and can further improve its performance on language modeling . Our main contributions can be summarized as follows : ( 1 ) We introduce a new optimization scheme for training recurrent neural networks with large memory and long temporal range . ( 2 ) We propose Memformer , a Transformer-based model , which outperforms the previous Transformer-XL and Compressive Transformer on WikiText-103 language modeling . ( 3 ) We show that Memformer is compatible with a wide range of self-supervised tasks other than autoregressive language modeling . 2 METHODS . 2.1 SIMPLIFIED RELATIVE POSITIONAL ENCODING . The standard attention mechanism involves the dot product between the query vector qi and the key vector kj , where Wq , Wk , Wv are the projection matrices to produce the query , key , and value . TransformerXL proposes a new type of relative positional encoding method . The attention computation is decomposed into four parts : ( a ) content-based addressing , ( b ) content dependent positional bias , ( c ) global content bias , and ( d ) global positional bias . The relative positional embedding Ri−j provides the positional information between every pair of xi and xj . The equation is defined below . u and v are trainable parameters . Ai , j = E > xiW > q WrExj︸ ︷︷ ︸ ( a ) +E > xiW > q WrRi−j︸ ︷︷ ︸ ( b ) +u > WkExj︸ ︷︷ ︸ ( c ) + v > WrRi−j︸ ︷︷ ︸ ( d ) . ( 1 ) However , we observe that ( c ) and ( d ) can be simplified by introducing a bias term to the original query and key projection . Thus , we re-formalize the self-attention , as shown in Eq . 3 . The product of bq and Kx is equivalent to the term ( c ) global content bias . For the term ( d ) , since v , Wr , and Ri−j are all trainable parameters , it can be simplified into the product between bq and bk , which has a similar effect to the global attention bias . Different from Transformer-XL that only injects positional information in the attention computation , our attention mechanism shown in Eq . 4 attends over the positional information and accumulate the results to have more robust output representations . Qx = WqEx + bq ; Kx = WkEx + bk ; Vx = WvEx + bv ( 2 ) Ai , j = Q > xiKxj +Q > xiRi−j ( 3 ) Hx = ∑ j Ai , j ( Vxj +Ri−j ) ( 4 ) 2.2 MEMFORMER . This section explains the details of Memformer . We first talk about the language model background and a new way of formulating language generation with text continuation . Then we describe an instance of such formulation , which is our proposed Memformer model . After that , we introduce the multi-task training setting . Finally , we describe the newly proposed optimization scheme , memory reply back-propagation to tackle the memory cost problem . 2.2.1 BACKGROUND : STANDARD LANGUAGE MODEL . To understand Memformer better , we first study the standard language model . Given a document of N tokens x = ( x1 , x2 , . . . , xN ) , an standard language model learns the joint probability of the document by taking the product of each token ’ s probability conditioned to the previous tokens , which is defined as P ( x ) = ∏ t P ( xt|x1 : t ) . Figure 1a and 1b are the standard language models . They autoregressively predict the next token by feeding the previous generated tokens into the model . An extension of Figure 1a is to incorporate relative positional encoding and cache the past hidden states . Then this model would be equivalent to Transformer-XL . Figure 1b is an assumed language model with memory . Self-attention module now attends not only to its token inputs but also to the memory Mt at time t. After all the tokens in the segment are processed , the model summarizes the computed hidden states in the segment and produce the next timestep ’ s memory Mt+1 . Each layer has its own individual memory representation . One limitation for this model is that the read and write operations on memory may not have enough capacity to retain important information due to the uni-directional attention . 2.2.2 ENCODER-DECODER LANGUAGE MODEL . To address this capacity issue of uni-directional attention , we introduce a more powerful architecture shown in Figure 1c , where we have an encoder-decoder and a memory system . If a document is split into T segments of length L , for each segment st , we define st = [ xt,1 , xt,2 , . . . xt , L ] . The encoder ’ s role is to encode the segment st and inject the information into the memory Mt , while it also retrieves past information from the previous timestep ’ s memory Mt−1 . The final output of the encoder will be fed into the decoder ’ s cross attention layers to predict the token probabilities of the next timestep ’ s segment st+1 as standard language modeling . The definition is as below : Mt = Encoder ( st , Mt−1 ) ( 5 ) P ( st ) = ∏ n=1 : L PDecoder ( xt , n |xt , < n , Mt−1 ) ( 6 ) P ( x ) = ∏ t=1 : T PModel ( st|s < t ) ( 7 ) At each timestep , the process can be deemed as a text continuation task . Given a text segment as the input , the model needs to continue that segment by generating the next text segment . Since the memory stores all the past information , we can autoregressively generate all the text segments in a document . In this fashion , the model can behave as a language model . 2.2.3 MEMFORMER ENCODER-DECODER . To implement the encoder-decoder language model , we propose Memformer Encoder-Decoder . The model incorporates a Transformer encoder-decoder and a memory system . The encoder is equipped with two new modules : Memory Cross Attention ( Figure 2b ) and Memory Slot Attention ( Figure 2c ) to read from or write to the memory respectively . The encoder is fully responsible for encoding and retrieving past information via memory . The decoder then takes the last layer ’ s outputs from the encoder and feeds them into the cross attention module similar to the standard Transformer . For the text continuation task , we let the encoder take the input of the current timestep ’ s text segment , and let the decoder generate the next timestep ’ s segment tokens . Figure 2a shows the detailed structure . Figure 2b demonstrates how Memory Cross Attention module extracts information from the memory Mt with the current segment ’ s tokens X . Each input token ’ s hidden state is projected into queries , while the memory hidden states are projected into key-value pairs . Then the input hidden states will attend over the projected memory key-value pairs to produce the final outputs . This module can effectively retrieve past information from memory Mt given the current text segment . Memory Slot Attention in Figure 2c produces the next timestep ’ s memory Mt+1 . This module takes the inputs of the previous timestep ’ s memory Mt and the encoder ’ s final hidden states . It then projects the memory into queries , keys , and values , while the encoder outputs are into keys and values . Since each memory slot should not be interfering with other memory slots , we design a special type of sparse attention pattern ( details shown in Figure 2c ) . Thus , each slot in the memory can only attend over itself and the encoder outputs . This is to preserve the information in each slot longer over the time horizon . For example , if one slot only attends itself , then the information in that slot will not change in the next timestep . 2.3 MULTI-TASK SELF-SUPERVISED LEARNING . Unlike existing models built either for denoising objectives or language modeling , Memformer can accomplish both types of tasks . This flexibility helps the model learn better representations of the document and strengthen the memory of past information . To avoid conflicts of different tasks , we use separate special tokens for each task . In this work , we only experiment with three self-supervised tasks . We believe that our model is flexible with many other self-supervised tasks to further improve performance . We randomly sample the following three tasks with a probability [ 0.6 , 0.3 , 0.1 ] during training . Text Continuation This is the primary task , as our goal is for language modeling . Given the current timestep ’ s text segment , the model needs to generate the tokens in the next timestep ’ s segment . Text Infilling This task is inspired by BART ( Lewis et al. , 2020 ) . We mask some text spans in a document . The span length is drawn from a Poisson distribution ( λ = 3.5 ) . The span is replaced with a “ [ mask ] ” token . The model needs to predict these masked tokens . Text Recall Reverse of the text continuation task , Text Recall needs to predict the previous text segment given the current timestep ’ s segment . This task aims to directly help the model to better preserve the past information .
This paper proposes a new style transformer with external memory, which is updated and used through an attention mechanism. They also propose a new algorithm to train the memory, Memory Replay Back-Propagation (MRBP). The memory consists of key-value pair data and is recurrently updated after the segment encoding. Through this memory, it can attend the past knowledge without the limitation of the maximum temporal range. The MRBP algorithm trains the memory through the local back-propagation of loss to reduce memory overhead.
SP:1ea373170ff80da65268e36e30370f2116fa4ed3
Memformer: The Memory-Augmented Transformer
1 INTRODUCTION . Memory has a fundamental role in human cognition . Humans perceive and encode sensory information into a compressed representation in neurons , and later our brains can effectively retrieve past information to accomplish various tasks . The formation of memories involves complex cognitive processes . Modeling and studying the behavior of human memory is still a challenging research problem in many academic areas . Many researchers have attempted to incorporate memory systems in artificial neural networks . Early works like recurrent neural networks ( RNN ) ( Rumelhart et al. , 1988 ) , including LSTM ( Hochreiter & Schmidhuber , 1997 ) model temporal sequences with their internal compressed state vector as memory . Although RNNs are theoretically Turing-complete , they are limited in preserving the longterm information due to the memory bottleneck . To alleviate the limitation , more powerful memory network architectures such as Neural Turing Machine ( NTM ) ( Graves et al. , 2014 ) , Differential Neural Computer ( DNC ) ( Graves et al. , 2016 ) have been proposed by leveraging a large external memory . However , due to their complex memory addressing mechanism , they are not widely used in NLP . More recently , Vaswani et al . ( 2017 ) proposes Transformer by ditching the use of memory and recurrence . Instead , it maintains all O ( N2 ) dependencies in the sequence with self-attention ( Bahdanau et al. , 2015 ) . Transformer and its followers have achieved great success in various NLP tasks . Nevertheless , the quadratic complexity can be extremely costly when the input sequence is long . Some works address the limitations of self-attention , including Reformer , Sparse Transformer , Longformer , Linformer , etc ( Child et al. , 2019 ; Kitaev et al. , 2020 ; Wang et al. , 2020 ) . They successfully reduce the complexity of self-attention and can process longer sequences . However , the space cost still scales with sequence length , which can not be fully eliminated without memory and recurrence . Transformer-XL ( Dai et al. , 2019 ) re-introduces the concept of memory and recurrence . It caches each layer ’ s hidden states of self-attention into a fixed size queue and re-uses them in the later attention computation . However , the memory as raw hidden states can not effectively compress high-level information . Transformer-XL in practice needs a huge memory size to perform well . Compressive Transformer ( Rae et al. , 2020 ) improves upon Transformer-XL by further compressing its memories into fewer vectors via a compression network . However , as mentioned in the papers , both Transformer-XL and Compressive Transformer still have a theoretical maximum temporal range due to the uni-directional self-attention constraint . In this work , we propose Memformer , which includes a more efficient memory system with a Transformer encoder-decoder architecture . The resulting model has a theoretically unlimited temporal range of memorization . We also improve the relative positional encoding in Transformer-XL with a simplified version . As the traditional back-propagation through time ( BPTT ) has an unaffordable memory cost for our model , we introduce a new optimization scheme , memory replay backpropagation ( MRBP ) , to significantly reduce the memory cost of training recurrent neural networks with large memory . We show that Memformer is compatible with different self-supervised tasks and can further improve its performance on language modeling . Our main contributions can be summarized as follows : ( 1 ) We introduce a new optimization scheme for training recurrent neural networks with large memory and long temporal range . ( 2 ) We propose Memformer , a Transformer-based model , which outperforms the previous Transformer-XL and Compressive Transformer on WikiText-103 language modeling . ( 3 ) We show that Memformer is compatible with a wide range of self-supervised tasks other than autoregressive language modeling . 2 METHODS . 2.1 SIMPLIFIED RELATIVE POSITIONAL ENCODING . The standard attention mechanism involves the dot product between the query vector qi and the key vector kj , where Wq , Wk , Wv are the projection matrices to produce the query , key , and value . TransformerXL proposes a new type of relative positional encoding method . The attention computation is decomposed into four parts : ( a ) content-based addressing , ( b ) content dependent positional bias , ( c ) global content bias , and ( d ) global positional bias . The relative positional embedding Ri−j provides the positional information between every pair of xi and xj . The equation is defined below . u and v are trainable parameters . Ai , j = E > xiW > q WrExj︸ ︷︷ ︸ ( a ) +E > xiW > q WrRi−j︸ ︷︷ ︸ ( b ) +u > WkExj︸ ︷︷ ︸ ( c ) + v > WrRi−j︸ ︷︷ ︸ ( d ) . ( 1 ) However , we observe that ( c ) and ( d ) can be simplified by introducing a bias term to the original query and key projection . Thus , we re-formalize the self-attention , as shown in Eq . 3 . The product of bq and Kx is equivalent to the term ( c ) global content bias . For the term ( d ) , since v , Wr , and Ri−j are all trainable parameters , it can be simplified into the product between bq and bk , which has a similar effect to the global attention bias . Different from Transformer-XL that only injects positional information in the attention computation , our attention mechanism shown in Eq . 4 attends over the positional information and accumulate the results to have more robust output representations . Qx = WqEx + bq ; Kx = WkEx + bk ; Vx = WvEx + bv ( 2 ) Ai , j = Q > xiKxj +Q > xiRi−j ( 3 ) Hx = ∑ j Ai , j ( Vxj +Ri−j ) ( 4 ) 2.2 MEMFORMER . This section explains the details of Memformer . We first talk about the language model background and a new way of formulating language generation with text continuation . Then we describe an instance of such formulation , which is our proposed Memformer model . After that , we introduce the multi-task training setting . Finally , we describe the newly proposed optimization scheme , memory reply back-propagation to tackle the memory cost problem . 2.2.1 BACKGROUND : STANDARD LANGUAGE MODEL . To understand Memformer better , we first study the standard language model . Given a document of N tokens x = ( x1 , x2 , . . . , xN ) , an standard language model learns the joint probability of the document by taking the product of each token ’ s probability conditioned to the previous tokens , which is defined as P ( x ) = ∏ t P ( xt|x1 : t ) . Figure 1a and 1b are the standard language models . They autoregressively predict the next token by feeding the previous generated tokens into the model . An extension of Figure 1a is to incorporate relative positional encoding and cache the past hidden states . Then this model would be equivalent to Transformer-XL . Figure 1b is an assumed language model with memory . Self-attention module now attends not only to its token inputs but also to the memory Mt at time t. After all the tokens in the segment are processed , the model summarizes the computed hidden states in the segment and produce the next timestep ’ s memory Mt+1 . Each layer has its own individual memory representation . One limitation for this model is that the read and write operations on memory may not have enough capacity to retain important information due to the uni-directional attention . 2.2.2 ENCODER-DECODER LANGUAGE MODEL . To address this capacity issue of uni-directional attention , we introduce a more powerful architecture shown in Figure 1c , where we have an encoder-decoder and a memory system . If a document is split into T segments of length L , for each segment st , we define st = [ xt,1 , xt,2 , . . . xt , L ] . The encoder ’ s role is to encode the segment st and inject the information into the memory Mt , while it also retrieves past information from the previous timestep ’ s memory Mt−1 . The final output of the encoder will be fed into the decoder ’ s cross attention layers to predict the token probabilities of the next timestep ’ s segment st+1 as standard language modeling . The definition is as below : Mt = Encoder ( st , Mt−1 ) ( 5 ) P ( st ) = ∏ n=1 : L PDecoder ( xt , n |xt , < n , Mt−1 ) ( 6 ) P ( x ) = ∏ t=1 : T PModel ( st|s < t ) ( 7 ) At each timestep , the process can be deemed as a text continuation task . Given a text segment as the input , the model needs to continue that segment by generating the next text segment . Since the memory stores all the past information , we can autoregressively generate all the text segments in a document . In this fashion , the model can behave as a language model . 2.2.3 MEMFORMER ENCODER-DECODER . To implement the encoder-decoder language model , we propose Memformer Encoder-Decoder . The model incorporates a Transformer encoder-decoder and a memory system . The encoder is equipped with two new modules : Memory Cross Attention ( Figure 2b ) and Memory Slot Attention ( Figure 2c ) to read from or write to the memory respectively . The encoder is fully responsible for encoding and retrieving past information via memory . The decoder then takes the last layer ’ s outputs from the encoder and feeds them into the cross attention module similar to the standard Transformer . For the text continuation task , we let the encoder take the input of the current timestep ’ s text segment , and let the decoder generate the next timestep ’ s segment tokens . Figure 2a shows the detailed structure . Figure 2b demonstrates how Memory Cross Attention module extracts information from the memory Mt with the current segment ’ s tokens X . Each input token ’ s hidden state is projected into queries , while the memory hidden states are projected into key-value pairs . Then the input hidden states will attend over the projected memory key-value pairs to produce the final outputs . This module can effectively retrieve past information from memory Mt given the current text segment . Memory Slot Attention in Figure 2c produces the next timestep ’ s memory Mt+1 . This module takes the inputs of the previous timestep ’ s memory Mt and the encoder ’ s final hidden states . It then projects the memory into queries , keys , and values , while the encoder outputs are into keys and values . Since each memory slot should not be interfering with other memory slots , we design a special type of sparse attention pattern ( details shown in Figure 2c ) . Thus , each slot in the memory can only attend over itself and the encoder outputs . This is to preserve the information in each slot longer over the time horizon . For example , if one slot only attends itself , then the information in that slot will not change in the next timestep . 2.3 MULTI-TASK SELF-SUPERVISED LEARNING . Unlike existing models built either for denoising objectives or language modeling , Memformer can accomplish both types of tasks . This flexibility helps the model learn better representations of the document and strengthen the memory of past information . To avoid conflicts of different tasks , we use separate special tokens for each task . In this work , we only experiment with three self-supervised tasks . We believe that our model is flexible with many other self-supervised tasks to further improve performance . We randomly sample the following three tasks with a probability [ 0.6 , 0.3 , 0.1 ] during training . Text Continuation This is the primary task , as our goal is for language modeling . Given the current timestep ’ s text segment , the model needs to generate the tokens in the next timestep ’ s segment . Text Infilling This task is inspired by BART ( Lewis et al. , 2020 ) . We mask some text spans in a document . The span length is drawn from a Poisson distribution ( λ = 3.5 ) . The span is replaced with a “ [ mask ] ” token . The model needs to predict these masked tokens . Text Recall Reverse of the text continuation task , Text Recall needs to predict the previous text segment given the current timestep ’ s segment . This task aims to directly help the model to better preserve the past information .
The paper presents a new model for the task of language modeling especially suited for longer sequences. This new model dubbed as Memformer consists of Transformer encoder-decoder and a memory module to store the past information from the encoder outputs. The encoder bidirectionally attends to the immediate previous sequence/segment information and to the memory module, which is designed to capture useful information from the past history of the full sequence. The idea is that by bidirectionally attending simultaneously to the previous input segment and to a memory module, the decoder should be able to improve its generation capabilities.
SP:1ea373170ff80da65268e36e30370f2116fa4ed3
Diffeomorphic Template Transformers
1 INTRODUCTION . The success of Convolutional Neural Networks ( CNNs ) in many modeling tasks is often attributed to their depth and inductive bias . An important inductive bias in CNNs is spatial symmetry ( e.g . translational equivariance ) which are embedded in the architecture through weight-sharing constraints . Alternatively , spatial transformers constrain networks through predicted spatial affine or thin-platespline transformations . In this work , we investigate a special type of spatial transformer , where the transformations are limited to flexible diffeomorphisms . Diffeomorphisms belong to the group of homeomorphisms that preserve topology by design , and thereby guarantee that relations between structures remain , i.e . connected ( sub- ) regions to stay connected . We propose to use such diffeomorphic spatial transformer in a template transformer setting ( Lee et al. , 2019 ) , where a prior shape is deformed to the output of the model . Here a neural network is used to predict the deformation of the shape , rather than the output itself . By introducing a diffeomorphic mapping of a prior shape , and carefully choosing properties of the prior shape , we can enforce desirable properties on the output , such as a smooth decision boundary or a constraint on the number of connected components . To obtain flexible diffeomorphic transformations , we use a technique known as scaling-and-squaring which has been successfully applied in the context of image registration in prior work ( Dalca et al. , 2018 ) , but has received relatively little attention in other areas in machine learning . In an attempt to increase flexibility of the flow , we try to approximate a time-dependent parameterisation using Baker-Campbell-Hausdorff ( BCH ) formula , rather than a stationary field . Hereby , diffeomorphic constraints are directly built into the architecture itself , not requiring any changes to the loss function . Experimentally , we first validate the diffeomorphic spatial transformer to learn data-invariances in a MNIST handwritten digits classification task , as proposed by ( Jaderberg et al. , 2015 ) to evaluate the original spatial transformer . The results show that better results can be achieved by employing diffeomorphic transformations . Additionally , we explore the use of diffeomorphic mappings in a spatial template transformer set-up for 3D medical breast tissue segmentation . We find that the diffeomorphic spatial transformer is able to deform simple prior shapes , such as a normally distributed energy , into high-quality predictive probability densities . We are successful in limiting the number of connected components in the output and achieve competitive performance measured by quantitative metrics compared to direct estimation of class probabilities . 2 RELATED WORK . Spatial Transformers were introduced by Jaderberg et al . ( 2015 ) as a learnable module that deform an input image , and can be incorporated into CNNs for various tasks . In Spatial Transformer Networks ( STNs ) , the module is used to learn data invariances in order to do better in image classification tasks . The work focuses on simple linear transformations ( e.g . translations , rotations , affine ) but also allows for more flexible mappings such as thin plate spline ( TPS ) transformations . The use of spatial transformations in template transformer setting was first proposed by Lee et al . ( 2019 ) , but does not use diffeomorphisms and requires defining a discrete image as shape prior . In the field of image registration , diffeomorphisms have been actively studied and have been succesfully applied in a variety of methods including LDDMM by Beg et al . ( 2005 ) , Diffeomorphic Demons by Vercauteren et al . ( 2009 ) , and SyN by Avants et al . ( 2008 ) . More recently , efforts have been made to fuse such diffeomorphic image registration approaches with neural networks ( Dalca et al . ( 2018 ) , Haskins et al . ( 2020 ) ) . It is well known that although these models mathematically describe diffeomorphisms , transformations are not always diffeomorphic ; in practice and negative Jacobian determinants can still occur due to approximation errors . To reduce such errors , additional regularisation is often applied ( Bro-Nielsen and Gramkow ( 1996 ) , Ashburner ( 2007 ) , Dalca et al . ( 2018 ) ) , but typically requries careful tuning . Image registration has also been applied to perform segmentation by deforming a basis template commonly referred to as an ’ atlas ’ onto a target image ( Rohlfing et al . ( 2005 ) , Fortunati et al . ( 2013 ) ) , for instance by combining ( e.g . averaging ) manually labelled training annotations ( Gee et al. , 1993 ) . There have been some studies that investigated how to obtain smoother segmentation boundaries in neural-based image registration . For instance , Monteiro et al . ( 2020 ) proposed to model spatial correlation by modeling joint distributions over entire label maps , in contrast to pixel-wise estimates . In other work , post-processing steps have been applied in order to smooth predictions or to enforce topological constraints ( Chlebus et al . ( 2018 ) , Jafari et al . ( 2016 ) ) . There have been some studies that try to enforce more consistent topology during training of neural network , but often use a soft constraint that required alteration of the loss function , such as in Hu et al . ( 2019 ) , and GAN-based approaches which in addition require a separately trained discriminator model Sekuboyina et al . ( 2018 ) . Lastly , there have been some studies in which diffeomorphisms in context of spatial transformer networks were investigated . In Skafte Detlefsen et al . ( 2018 ) , subsequent layers of spatial transformer layers with piece-wise affine transformations ( PCAB ) were used to construct a diffeomorphic neural network , but requires a tessellation strategy ( Freifeld et al . ( 2015 ) , Freifeld et al . ( 2017 ) ) . In Deep Diffeomorphic Normalizing Flows ( Salman et al . ( 2018 ) ) a neural network is used to predict diffeomorphic transformations as normalizing flow but to obtain more expressive posteriors for variational inference . 3 DIFFEOMORPHIC SPATIAL TRANSFORMERS . The Spatial Transformer is a learnable module which explicitly allows for spatial manipulation of data within a neural network . The module takes an input feature map U passed through a learnable function which regresses the transformation parameters θ . A spatial grid G over the output is transformed to an output grid Tθ ( G ) , which is applied to the input U to produce the output O . In the original spatial transformer , θ could represent arbitrary parameterised mappings such as a simple rotation , translation or affine transformation matrices . We propose flexible transformations in the group of diffeomorphisms Tθ ∈ D , which preserve topology , by continuity and continuity of the inverse . In Section 4 , we will describe how we can use a diffeomorphic spatial transformer to warp a shape prior , as illustrated in Figure 1 , in a template transformer setting illustrated in Figure 2 . Diffeomorphic Transformation Let us define the diffeomorphic mapping φ = ψ ( 1 ) v ∈ D using an ordinary differential equation ( ODE ) : ∂ψ ( t ) v ( x ) ∂t = v ( ψ ( t ) v ( x ) ) ( 1 ) where v is a stationary velocity field , ψ ( 0 ) v = Id is the identity transformation and t is time . By integrating over unit time we obtain ψ ( 1 ) v , the time 1 flow of the stationary velocity field v. The most basic way to solve an ordinary differential equation from some initial point x0 is Euler ’ s method , in which the trajectory is approximated by taking small discrete steps and adding the difference to the running approximation in time . The method is straightforward to implement , but may take many steps to converge to good approximations . In this work , we will use a technique known as scaling-and-squaring ( Moler and Van Loan , 2003 ) , which allows for fast exponentiation of stationary velocity fields and thus the solution to the ODE defined in Equation 1 . Scaling-and-Squaring To solve the ODE from Equation 1 , with a stationary velocity field v and the solution is the matrix exponential φ = exp ( v ) , we use is the scaling-and-squaring method ( Moler and Van Loan ( 2003 ) , Arsigny et al . ( 2006 ) ) . The method is very similar to Euler ’ s method , but is typically more efficient by exploiting the relation exp ( v ) = exp ( v/2T ) 2 T with T ∈ N together with the fact that exp ( v ) can be well approximated by a Padé or Taylor approximation near the origin ( i.e . for small ||v|| ) . The main idea is to pick a certain step size T such that ||v||/2T < 0.5 and divide the diagonal values in v by the power integral 2T to obtain the approximation for exp ( v/2T ) ≈ Id+v/2T and then squaring ( self-composing ) it T times to find obtain approximate solution for exp ( v ) . Algorithm 1 : Approximating φ = exp ( v ) using scaling-and-squaring Result : φ = exp ( v ) T ← ceil ( log2 ( max ( ||v|| ) + 1 ) φ0 ← v/2T for t = 1 to T do φt ← φt−1 ◦ φt−1 end The approach can efficiently be implemented in existing numerical differentiation frameworks such as PyTorch or Tensorflow by element-wise dividing the vector components in velocity field v by 2T and then self-composing the resulting field 2T times using the linear grid sampling operation defined in Section 3.1 Spatial Sampling To perform a spatial transformation on the input feature map , a sampler takes a set of sampling points Tθ ( G ) , along with an input feature map U = I with input image I to produce output O . In case of template transformer , explained in Section 4 , the input feature map would be a concatenation U = I ◦ S of an input image with some prior shape S. We follow the general sampling framework described in Jaderberg et al . ( 2015 ) , defined for arbitrary sampling kernels of which the ( sub ) gradients can be computed , and the 3D trilinear interpolation in particular : Oci = H∑ h W∑ w D∑ d Ichwd max ( 0 , 1− |yci − h| ) max ( 0 , 1− |xci − w| ) max ( 0 , 1− |zci − d| ) ( 2 ) This procedure should be differentiable with respect to both the sampling grid coordinates and the input feature map by using partial ( sub ) gradients , allowing it to be used in conjunction with backpropagation . 1For our experiments , we utilized the F.grid_sample function in PyTorch 1.6 to perform grid sampling . Baker–Campbell–Hausdorff formula Instead of parameterising our flow by a single stationary velocity field , we might also think of a piece-wise time-dependent sequence of vector fields . By parameterising the deformation as a time-dependent sequence of velocities we hope improve predictive performance by sequentially modeling larger movements first and detailed refinements thereafter . Composing multiple diffeomorphic transformations will also yield a diffeomorphic transformation , as the space of diffeomorphic transformations D is an algebraic group that is closed under the composition operation . The scaling-and-squaring algorithm offers an efficient way to find diffeomorphic transformations from a stationary vector field , but can not straightforwardly be applied to such time-dependent parameterisations . To address this , we can combine two timepoints , now A and B for simplicity of notation , to form the Lie exponential mapping : exp ( Z ) = exp ( A ) exp ( B ) ( 3 ) and apply the Baker-Campbell-Hausdorff ( BCH ) formula up to a certain order to approximate Z = bch ( A , B ) = ∞∑ n=1 zn ( A , B ) = A+B + 1 2 [ A , B ] + 1 12 [ A , [ A , B ] ] − 1 12 [ B , [ A , B ] ] + · · · ( 4 ) where [ · , · ] is the Lie bracket . We apply the formula to approximate the logarithm of matrix exponentials of two noncommutative velocity fields Z = log ( exp ( A ) exp ( B ) ) and then use scaling-andsquaring one time to find the exponential exp ( Z ) . Binary Tree Composition Naive composition of the T diffeomorphic transformations would result into a long chain of composition operations Φ = ( ( ( ( ( ( φ1◦φ2 ) ◦φ3 ) ◦φ4 ) ◦φ5 ) · · · ) · · ·◦φT−1 ) ◦φT ) . To reduce possible interpolation errors in the resampling from growing as a result of such repetitive composing , we compose the field using a binary tree scheme Φ = ( ( ( φ1 ◦ φ2 ) ◦ ( φ3 ◦ φ4 ) ) ◦ ( · · · ◦ ( φT−1 ◦ φT ) ) ) . Treating the composition scheme as a tree structure , the depth now scales in an order of complexity O ( T ) compared to O ( log ( T ) ) when using naive composition , reducing the maximum number of times an BCH approximation is repetitively applied to a single timepoint .
The authors present a modification to spatial transformer networks that restricts the transformations to the group of diffeomorphisms. When combined with shape priors, this imposes topological constraints on the mappings produced by the network. These are important considerations in applications such as segmentation tasks where we expect there to be constraints on, for example, the number of connected components. The authors demonstrate the effectiveness of their approach in MNIST experiments and a breast tissue segmentation task.
SP:f010fddc7ee6523ff0afa0ea2b9e1a55027b09de
Diffeomorphic Template Transformers
1 INTRODUCTION . The success of Convolutional Neural Networks ( CNNs ) in many modeling tasks is often attributed to their depth and inductive bias . An important inductive bias in CNNs is spatial symmetry ( e.g . translational equivariance ) which are embedded in the architecture through weight-sharing constraints . Alternatively , spatial transformers constrain networks through predicted spatial affine or thin-platespline transformations . In this work , we investigate a special type of spatial transformer , where the transformations are limited to flexible diffeomorphisms . Diffeomorphisms belong to the group of homeomorphisms that preserve topology by design , and thereby guarantee that relations between structures remain , i.e . connected ( sub- ) regions to stay connected . We propose to use such diffeomorphic spatial transformer in a template transformer setting ( Lee et al. , 2019 ) , where a prior shape is deformed to the output of the model . Here a neural network is used to predict the deformation of the shape , rather than the output itself . By introducing a diffeomorphic mapping of a prior shape , and carefully choosing properties of the prior shape , we can enforce desirable properties on the output , such as a smooth decision boundary or a constraint on the number of connected components . To obtain flexible diffeomorphic transformations , we use a technique known as scaling-and-squaring which has been successfully applied in the context of image registration in prior work ( Dalca et al. , 2018 ) , but has received relatively little attention in other areas in machine learning . In an attempt to increase flexibility of the flow , we try to approximate a time-dependent parameterisation using Baker-Campbell-Hausdorff ( BCH ) formula , rather than a stationary field . Hereby , diffeomorphic constraints are directly built into the architecture itself , not requiring any changes to the loss function . Experimentally , we first validate the diffeomorphic spatial transformer to learn data-invariances in a MNIST handwritten digits classification task , as proposed by ( Jaderberg et al. , 2015 ) to evaluate the original spatial transformer . The results show that better results can be achieved by employing diffeomorphic transformations . Additionally , we explore the use of diffeomorphic mappings in a spatial template transformer set-up for 3D medical breast tissue segmentation . We find that the diffeomorphic spatial transformer is able to deform simple prior shapes , such as a normally distributed energy , into high-quality predictive probability densities . We are successful in limiting the number of connected components in the output and achieve competitive performance measured by quantitative metrics compared to direct estimation of class probabilities . 2 RELATED WORK . Spatial Transformers were introduced by Jaderberg et al . ( 2015 ) as a learnable module that deform an input image , and can be incorporated into CNNs for various tasks . In Spatial Transformer Networks ( STNs ) , the module is used to learn data invariances in order to do better in image classification tasks . The work focuses on simple linear transformations ( e.g . translations , rotations , affine ) but also allows for more flexible mappings such as thin plate spline ( TPS ) transformations . The use of spatial transformations in template transformer setting was first proposed by Lee et al . ( 2019 ) , but does not use diffeomorphisms and requires defining a discrete image as shape prior . In the field of image registration , diffeomorphisms have been actively studied and have been succesfully applied in a variety of methods including LDDMM by Beg et al . ( 2005 ) , Diffeomorphic Demons by Vercauteren et al . ( 2009 ) , and SyN by Avants et al . ( 2008 ) . More recently , efforts have been made to fuse such diffeomorphic image registration approaches with neural networks ( Dalca et al . ( 2018 ) , Haskins et al . ( 2020 ) ) . It is well known that although these models mathematically describe diffeomorphisms , transformations are not always diffeomorphic ; in practice and negative Jacobian determinants can still occur due to approximation errors . To reduce such errors , additional regularisation is often applied ( Bro-Nielsen and Gramkow ( 1996 ) , Ashburner ( 2007 ) , Dalca et al . ( 2018 ) ) , but typically requries careful tuning . Image registration has also been applied to perform segmentation by deforming a basis template commonly referred to as an ’ atlas ’ onto a target image ( Rohlfing et al . ( 2005 ) , Fortunati et al . ( 2013 ) ) , for instance by combining ( e.g . averaging ) manually labelled training annotations ( Gee et al. , 1993 ) . There have been some studies that investigated how to obtain smoother segmentation boundaries in neural-based image registration . For instance , Monteiro et al . ( 2020 ) proposed to model spatial correlation by modeling joint distributions over entire label maps , in contrast to pixel-wise estimates . In other work , post-processing steps have been applied in order to smooth predictions or to enforce topological constraints ( Chlebus et al . ( 2018 ) , Jafari et al . ( 2016 ) ) . There have been some studies that try to enforce more consistent topology during training of neural network , but often use a soft constraint that required alteration of the loss function , such as in Hu et al . ( 2019 ) , and GAN-based approaches which in addition require a separately trained discriminator model Sekuboyina et al . ( 2018 ) . Lastly , there have been some studies in which diffeomorphisms in context of spatial transformer networks were investigated . In Skafte Detlefsen et al . ( 2018 ) , subsequent layers of spatial transformer layers with piece-wise affine transformations ( PCAB ) were used to construct a diffeomorphic neural network , but requires a tessellation strategy ( Freifeld et al . ( 2015 ) , Freifeld et al . ( 2017 ) ) . In Deep Diffeomorphic Normalizing Flows ( Salman et al . ( 2018 ) ) a neural network is used to predict diffeomorphic transformations as normalizing flow but to obtain more expressive posteriors for variational inference . 3 DIFFEOMORPHIC SPATIAL TRANSFORMERS . The Spatial Transformer is a learnable module which explicitly allows for spatial manipulation of data within a neural network . The module takes an input feature map U passed through a learnable function which regresses the transformation parameters θ . A spatial grid G over the output is transformed to an output grid Tθ ( G ) , which is applied to the input U to produce the output O . In the original spatial transformer , θ could represent arbitrary parameterised mappings such as a simple rotation , translation or affine transformation matrices . We propose flexible transformations in the group of diffeomorphisms Tθ ∈ D , which preserve topology , by continuity and continuity of the inverse . In Section 4 , we will describe how we can use a diffeomorphic spatial transformer to warp a shape prior , as illustrated in Figure 1 , in a template transformer setting illustrated in Figure 2 . Diffeomorphic Transformation Let us define the diffeomorphic mapping φ = ψ ( 1 ) v ∈ D using an ordinary differential equation ( ODE ) : ∂ψ ( t ) v ( x ) ∂t = v ( ψ ( t ) v ( x ) ) ( 1 ) where v is a stationary velocity field , ψ ( 0 ) v = Id is the identity transformation and t is time . By integrating over unit time we obtain ψ ( 1 ) v , the time 1 flow of the stationary velocity field v. The most basic way to solve an ordinary differential equation from some initial point x0 is Euler ’ s method , in which the trajectory is approximated by taking small discrete steps and adding the difference to the running approximation in time . The method is straightforward to implement , but may take many steps to converge to good approximations . In this work , we will use a technique known as scaling-and-squaring ( Moler and Van Loan , 2003 ) , which allows for fast exponentiation of stationary velocity fields and thus the solution to the ODE defined in Equation 1 . Scaling-and-Squaring To solve the ODE from Equation 1 , with a stationary velocity field v and the solution is the matrix exponential φ = exp ( v ) , we use is the scaling-and-squaring method ( Moler and Van Loan ( 2003 ) , Arsigny et al . ( 2006 ) ) . The method is very similar to Euler ’ s method , but is typically more efficient by exploiting the relation exp ( v ) = exp ( v/2T ) 2 T with T ∈ N together with the fact that exp ( v ) can be well approximated by a Padé or Taylor approximation near the origin ( i.e . for small ||v|| ) . The main idea is to pick a certain step size T such that ||v||/2T < 0.5 and divide the diagonal values in v by the power integral 2T to obtain the approximation for exp ( v/2T ) ≈ Id+v/2T and then squaring ( self-composing ) it T times to find obtain approximate solution for exp ( v ) . Algorithm 1 : Approximating φ = exp ( v ) using scaling-and-squaring Result : φ = exp ( v ) T ← ceil ( log2 ( max ( ||v|| ) + 1 ) φ0 ← v/2T for t = 1 to T do φt ← φt−1 ◦ φt−1 end The approach can efficiently be implemented in existing numerical differentiation frameworks such as PyTorch or Tensorflow by element-wise dividing the vector components in velocity field v by 2T and then self-composing the resulting field 2T times using the linear grid sampling operation defined in Section 3.1 Spatial Sampling To perform a spatial transformation on the input feature map , a sampler takes a set of sampling points Tθ ( G ) , along with an input feature map U = I with input image I to produce output O . In case of template transformer , explained in Section 4 , the input feature map would be a concatenation U = I ◦ S of an input image with some prior shape S. We follow the general sampling framework described in Jaderberg et al . ( 2015 ) , defined for arbitrary sampling kernels of which the ( sub ) gradients can be computed , and the 3D trilinear interpolation in particular : Oci = H∑ h W∑ w D∑ d Ichwd max ( 0 , 1− |yci − h| ) max ( 0 , 1− |xci − w| ) max ( 0 , 1− |zci − d| ) ( 2 ) This procedure should be differentiable with respect to both the sampling grid coordinates and the input feature map by using partial ( sub ) gradients , allowing it to be used in conjunction with backpropagation . 1For our experiments , we utilized the F.grid_sample function in PyTorch 1.6 to perform grid sampling . Baker–Campbell–Hausdorff formula Instead of parameterising our flow by a single stationary velocity field , we might also think of a piece-wise time-dependent sequence of vector fields . By parameterising the deformation as a time-dependent sequence of velocities we hope improve predictive performance by sequentially modeling larger movements first and detailed refinements thereafter . Composing multiple diffeomorphic transformations will also yield a diffeomorphic transformation , as the space of diffeomorphic transformations D is an algebraic group that is closed under the composition operation . The scaling-and-squaring algorithm offers an efficient way to find diffeomorphic transformations from a stationary vector field , but can not straightforwardly be applied to such time-dependent parameterisations . To address this , we can combine two timepoints , now A and B for simplicity of notation , to form the Lie exponential mapping : exp ( Z ) = exp ( A ) exp ( B ) ( 3 ) and apply the Baker-Campbell-Hausdorff ( BCH ) formula up to a certain order to approximate Z = bch ( A , B ) = ∞∑ n=1 zn ( A , B ) = A+B + 1 2 [ A , B ] + 1 12 [ A , [ A , B ] ] − 1 12 [ B , [ A , B ] ] + · · · ( 4 ) where [ · , · ] is the Lie bracket . We apply the formula to approximate the logarithm of matrix exponentials of two noncommutative velocity fields Z = log ( exp ( A ) exp ( B ) ) and then use scaling-andsquaring one time to find the exponential exp ( Z ) . Binary Tree Composition Naive composition of the T diffeomorphic transformations would result into a long chain of composition operations Φ = ( ( ( ( ( ( φ1◦φ2 ) ◦φ3 ) ◦φ4 ) ◦φ5 ) · · · ) · · ·◦φT−1 ) ◦φT ) . To reduce possible interpolation errors in the resampling from growing as a result of such repetitive composing , we compose the field using a binary tree scheme Φ = ( ( ( φ1 ◦ φ2 ) ◦ ( φ3 ◦ φ4 ) ) ◦ ( · · · ◦ ( φT−1 ◦ φT ) ) ) . Treating the composition scheme as a tree structure , the depth now scales in an order of complexity O ( T ) compared to O ( log ( T ) ) when using naive composition , reducing the maximum number of times an BCH approximation is repetitively applied to a single timepoint .
This paper propose a novel method to incorporate shape prior in neural networks based on Diffeomorphic transformation. This is useful as by design it preserves certain desirable properties of output such as smooth boundaries and connected components which are of interest in medical imaging applications. The method is validated on Mnist for data invariance and a medical imaging task for segmentation.
SP:f010fddc7ee6523ff0afa0ea2b9e1a55027b09de
Gradient Descent on Neural Networks Typically Occurs at the Edge of Stability
1 INTRODUCTION . Neural networks are almost never trained using ( full-batch ) gradient descent , even though gradient descent is the conceptual basis for popular optimization algorithms such as SGD . In this paper , we train neural networks using gradient descent , and find two surprises . First , while little is known about the dynamics of neural network training in general , we find that in the special case of gradient descent , there is a simple characterization that holds across a broad range of network architectures and tasks . Second , this characterization is strongly at odds with prevailing beliefs in optimization . In more detail , as we train neural networks using gradient descent with step size η , we measure the evolution of the sharpness — the maximum eigenvalue of the training loss Hessian . Empirically , the behavior of the sharpness is consistent across architectures and tasks : so long as the sharpness is less than the value 2/η , it tends to continually rise ( §3.1 ) . We call this phenomenon progressive sharpening . The significance of the value 2/η is that gradient descent on quadratic objectives is unstable if the sharpness exceeds this threshold ( §2 ) . Indeed , in neural network training , if the sharpness ever crosses 2/η , gradient descent quickly becomes destabilized — that is , the iterates start to oscillate with ever-increasing magnitude along the direction of greatest curvature . Yet once this happens , gradient descent does not diverge entirely or stall . Instead , it enters a new regime we call the Edge of Stability1 ( §3.2 ) , in which ( 1 ) the sharpness hovers right at , or just above , the value 2/η ; and ( 2 ) the train loss behaves non-monotonically , yet consistently decreases over long timescales . In this regime , gradient descent is constantly “ trying ” to increase the sharpness , but is constantly restrained from doing so . The net effect is that gradient descent continues to successfully optimize the training objective , but in such a way as to avoid further increasing the sharpness.2 In principle , it is possible to run gradient descent at step sizes η so small that the sharpness never rises to 2/η . However , these step sizes are suboptimal from the point of view of training speed , sometimes dramatically so . In particular , for standard architectures on the standard dataset CIFAR-10 , such step sizes are so small as to be completely unreasonable — at all reasonable step sizes , gradient descent eventually enters the Edge of Stability ( see §4 ) . Thus , at least for standard networks on CIFAR-10 , the Edge of Stability regime should be viewed as the “ rule , ” not the “ exception. ” As we describe in §5 , the Edge of Stability regime is inconsistent with several pieces of conventional wisdom in optimization theory : convergence analyses based on L-smoothness or monotone descent , quadratic Taylor approximations as a model for local progress , and certain heuristics for step size selection . We hope that our empirical findings will both nudge the optimization community away from widespread presumptions that appear to be untrue in the case of neural network training , and also point the way forward by identifying precise empirical phenomena suitable for further study . Certain aspects of the Edge of Stability have been observed in previous empirical studies of fullbatch gradient descent ( Xing et al. , 2018 ; Wu et al. , 2018 ) ; our paper provides a unified explanation for these observations . Furthermore , Jastrzębski et al . ( 2020 ) proposed a simplified model for the evolution of the sharpness during stochastic gradient descent which matches our empirical observations in the special case of full-batch SGD ( i.e . gradient descent ) . However , outside the full-batch special case , there is no evidence that their model matches experiments with any degree of quantitative precision , although their model does successfully predict the directional trend that large step sizes and/or small batch sizes steer SGD into regions of low sharpness . We discuss SGD at greater length in §6 . To summarize , while the sharpness does not obey simple dynamics during SGD ( as it does during GD ) , there are indications that the “ Edge of Stability ” intuition might generalize somehow to SGD , just in a way that does not center around the sharpness . 2 BACKGROUND : STABILITY OF GRADIENT DESCENT ON QUADRATICS . In this section , we review the stability properties of gradient descent on quadratic functions . Later , we will see that the stability of gradient descent on neural training objectives is partly well-modeled by the stability of gradient descent on the quadratic Taylor approximation . On a quadratic objective function f ( x ) = 12x TAx + bTx + c , gradient descent with step size η will diverge if3 any eigenvalue of A exceeds the threshold 2/η . To see why , consider first the onedimensional quadratic f ( x ) = 12ax 2 + bx+ c , with a > 0 . This function has optimum x∗ = −b/a . Consider running gradient descent with step size η starting from x0 . The update rule is xt+1 = xt − η ( axt + b ) , which means that the error xt − x∗ evolves as ( xt+1 − x∗ ) = ( 1− ηa ) ( xt − x∗ ) . Therefore , the error at step t is ( xt − x∗ ) = ( 1 − ηa ) t ( x0 − x∗ ) , and so the iterate at step t is xt = ( 1− ηa ) t ( x0−x∗ ) +x∗ . If a > 2/η , then ( 1− ηa ) < −1 , so the sequence { xt } will oscillate around x∗ with ever-increasing magnitude , and diverge . Now consider the general d-dimensional case . Let ( ai , qi ) be the i-th largest eigenvalue/eigenvector of A . As shown in Appendix B , when the gradient descent iterates { xt } are expressed in the special coordinate system whose axes are the eigenvectors of A , each coordinate evolves separately . In particular , the coordinate for each eigenvector qi , namely 〈qi , xt〉 , evolves according to the dynamics of gradient descent on a one-dimensional quadratic objective with second derivative ai . 1This nomenclature was inspired by the title of Giladi et al . ( 2020 ) . 2In the literature , the term “ sharpness ” has been used to refer to a variety of quantities , often connected to generalization ( e.g . Keskar et al . ( 2016 ) ) . In this paper , “ sharpness ” strictly means the maximum eigenvalue of the training loss Hessian . We do not claim that this quantity has any connection to generalization . 3For convex quadratics , this is “ if and only if. ” However , if A has a negative eigenvalue , then gradient descent with any ( positive ) step size will diverge along the corresponding eigenvector . Therefore , if ai > 2/η , then the sequence { 〈qi , xt〉 } will oscillate with ever-increasing magnitude ; in this case , we say that the iterates { xt } diverge along the direction qi . To illustrate , Figure 2 shows a quadratic function with eigenvalues a1 = 20 and a2 = 1 . In Figure 2 ( a ) , we run gradient descent with step size η = 0.09 ; since 0 < a2 < a1 < 2/η , gradient descent converges along both q1 and q2 . In Figure 2 ( b ) , we use step size η = 0.11 ; since 0 < a2 < 2/η < a1 , gradient descent converges along q2 yet diverges along q1 , so diverges overall . Polyak momentum ( Polyak , 1964 ) and Nesterov momentum ( Nesterov , 1983 ; Sutskever et al. , 2013 ) are notable variants of gradient descent which often improve the convergence speed . On quadratic functions , these two algorithms also diverge if the sharpness exceeds a certain threshold , which we call the “ maximum stable sharpness , ” or MSS . In particular , we prove in Appendix B that gradient descent with step size η and momentum parameter β diverges if the sharpness exceeds : MSSPolyak ( η , β ) = 1 η ( 2 + 2β ) , MSSNesterov ( η , β ) = 1 η ( 2 + 2β 1 + 2β ) . ( 1 ) The Polyak result previously appeared in Goh ( 2017 ) ; the Nesterov one seems to be new . Note that this discussion only applies to full-batch gradient descent . As we discuss in §6 , several recent papers have proposed stability analyses for SGD ( Wu et al. , 2018 ; Jastrzębski et al. , 2020 ) . Neural network training objectives are not globally quadratic . However , the second-order Taylor approximation around any point x0 in parameter space is a quadratic function whose “ A ” matrix is the Hessian at x0 . If any eigenvalue of this Hessian exceeds 2/η , gradient descent with step size η would diverge if run on this quadratic function — the iterates would oscillate with ever-increasing magnitude along the corresponding eigenvector . Therefore , at any point x0 in parameter space where the sharpness exceeds 2/η , gradient descent with step size η would diverge if run on the quadratic Taylor approximation to the training objective around x0 . 3 GRADIENT DESCENT ON NEURAL NETWORKS . In this section , we empirically characterize the behavior of gradient descent on neural network training objectives . Section 4 will show that this characterization holds broadly . 3.1 PROGRESSIVE SHARPENING . When training neural networks , it seems to be a general rule that so long as the sharpness is small enough for gradient descent to be stable ( < 2/η , for vanilla gradient descent ) , gradient descent has an overwhelming tendency to continually increase the sharpness . We call this phenomenon progressive sharpening . By “ overwhelming tendency , ” we mean that gradient descent can occasionally decrease the sharpness ( especially at the beginning of training ) , but these brief decreases always seem be followed by a return to continual increase . Jastrzębski et al . ( 2020 ) previously hypothesized ( in their Assumption 4 ) that a similar phenomenon may hold for SGD , but the evidence for , and the precise scope of , this effect are both currently far clearer for gradient descent than for SGD . Progressive sharpening is illustrated in Figure 3 . Here , we use ( full-batch ) gradient descent to train a network on a subset of 5,000 examples from CIFAR-10 , and we monitor the evolution of the sharpness during training . The network is a fully-connected architecture with two hidden layers of width 200 , and tanh activations . In Figure 3 ( a ) , we train using the mean squared error loss for classification ( Hui & Belkin , 2020 ) , encoding the correct class with 1 and the other classes with 0 . We use the small step size of η = 2/600 , and stop when the training accuracy reaches 99 % . We plot both the train loss and the sharpness , with a horizontal dashed line marking the stability threshold 2/η . Observe that the sharpness continually rises during training ( except for a brief dip at the beginning ) . This is progressive sharpening . For this experiment , we intentionally chose a step size η small enough that the sharpness remained beneath 2/η for the entire duration of training . Cross-entropy . When training with cross-entropy loss , there is an exception to the rule that the sharpness tends to continually increase : with cross-entropy loss , the sharpness typically drops at the end of training . This behavior can be seen in Figure 3 ( b ) , where we train the same network using the cross-entropy loss rather than MSE . This drop occurs because once most data points are classified correctly , gradient descent tries to drive the cross-entropy loss to zero by scaling up the margins , as detailed in Soudry et al . ( 2018 ) . As we explain in Appendix C , this causes the sharpness to drop . The effect of width . It is known that when networks parameterized in a certain way ( the “ NTK parameterization ” ) are made infinitely wide , the Hessian moves a vanishingly small amount during training ( Jacot et al. , 2018 ; Lee et al. , 2019 ; Li & Liang , 2018 ) , which implies that no progressive sharpening occurs . In Appendix D , we experiment with networks of varying width , under both NTK and standard parameterizations . We find that progressive sharpening occurs to a lesser degree as networks become increasingly wide . Nevertheless , our experiments in §4 demonstrate that progressive sharpening occurs to a dramatic degree for standard architectures on the standard dataset CIFAR-10 . We do not know why progressive sharpening occurs , or whether “ sharp ” solutions differ in any important way from “ not sharp ” solutions . These are important questions for future work . Note that Mulayoff & Michaeli ( 2020 ) studied the latter question in the context of deep linear networks .
This submission numerically shows that during exploring the neural network landscape, GD flow keeps increasing the sharpness. As a result, GD with a fixed learning rate will exhibit two phases during the dynamics. Denote by $\eta$ the fixed learning rate. In the first phase, GD follows closely to the GD flow, and it finally converges to a region where the sharpness is roughly $2/\eta$. Then, it transits into the second phase during which the sharpness hovers right at or above $2/\eta$. In the second phase, GD cannot increase the sharpness anymore due to the dynamical stability constraint. Thus, the authors name it the Edge of Stability phase. What is interesting is that in the edge of stability phase, the loss is still decreasing steadily although not monotonically.
SP:d442ae98d8f485119b8fdd7070d16a7cabc0f9ea
Gradient Descent on Neural Networks Typically Occurs at the Edge of Stability
1 INTRODUCTION . Neural networks are almost never trained using ( full-batch ) gradient descent , even though gradient descent is the conceptual basis for popular optimization algorithms such as SGD . In this paper , we train neural networks using gradient descent , and find two surprises . First , while little is known about the dynamics of neural network training in general , we find that in the special case of gradient descent , there is a simple characterization that holds across a broad range of network architectures and tasks . Second , this characterization is strongly at odds with prevailing beliefs in optimization . In more detail , as we train neural networks using gradient descent with step size η , we measure the evolution of the sharpness — the maximum eigenvalue of the training loss Hessian . Empirically , the behavior of the sharpness is consistent across architectures and tasks : so long as the sharpness is less than the value 2/η , it tends to continually rise ( §3.1 ) . We call this phenomenon progressive sharpening . The significance of the value 2/η is that gradient descent on quadratic objectives is unstable if the sharpness exceeds this threshold ( §2 ) . Indeed , in neural network training , if the sharpness ever crosses 2/η , gradient descent quickly becomes destabilized — that is , the iterates start to oscillate with ever-increasing magnitude along the direction of greatest curvature . Yet once this happens , gradient descent does not diverge entirely or stall . Instead , it enters a new regime we call the Edge of Stability1 ( §3.2 ) , in which ( 1 ) the sharpness hovers right at , or just above , the value 2/η ; and ( 2 ) the train loss behaves non-monotonically , yet consistently decreases over long timescales . In this regime , gradient descent is constantly “ trying ” to increase the sharpness , but is constantly restrained from doing so . The net effect is that gradient descent continues to successfully optimize the training objective , but in such a way as to avoid further increasing the sharpness.2 In principle , it is possible to run gradient descent at step sizes η so small that the sharpness never rises to 2/η . However , these step sizes are suboptimal from the point of view of training speed , sometimes dramatically so . In particular , for standard architectures on the standard dataset CIFAR-10 , such step sizes are so small as to be completely unreasonable — at all reasonable step sizes , gradient descent eventually enters the Edge of Stability ( see §4 ) . Thus , at least for standard networks on CIFAR-10 , the Edge of Stability regime should be viewed as the “ rule , ” not the “ exception. ” As we describe in §5 , the Edge of Stability regime is inconsistent with several pieces of conventional wisdom in optimization theory : convergence analyses based on L-smoothness or monotone descent , quadratic Taylor approximations as a model for local progress , and certain heuristics for step size selection . We hope that our empirical findings will both nudge the optimization community away from widespread presumptions that appear to be untrue in the case of neural network training , and also point the way forward by identifying precise empirical phenomena suitable for further study . Certain aspects of the Edge of Stability have been observed in previous empirical studies of fullbatch gradient descent ( Xing et al. , 2018 ; Wu et al. , 2018 ) ; our paper provides a unified explanation for these observations . Furthermore , Jastrzębski et al . ( 2020 ) proposed a simplified model for the evolution of the sharpness during stochastic gradient descent which matches our empirical observations in the special case of full-batch SGD ( i.e . gradient descent ) . However , outside the full-batch special case , there is no evidence that their model matches experiments with any degree of quantitative precision , although their model does successfully predict the directional trend that large step sizes and/or small batch sizes steer SGD into regions of low sharpness . We discuss SGD at greater length in §6 . To summarize , while the sharpness does not obey simple dynamics during SGD ( as it does during GD ) , there are indications that the “ Edge of Stability ” intuition might generalize somehow to SGD , just in a way that does not center around the sharpness . 2 BACKGROUND : STABILITY OF GRADIENT DESCENT ON QUADRATICS . In this section , we review the stability properties of gradient descent on quadratic functions . Later , we will see that the stability of gradient descent on neural training objectives is partly well-modeled by the stability of gradient descent on the quadratic Taylor approximation . On a quadratic objective function f ( x ) = 12x TAx + bTx + c , gradient descent with step size η will diverge if3 any eigenvalue of A exceeds the threshold 2/η . To see why , consider first the onedimensional quadratic f ( x ) = 12ax 2 + bx+ c , with a > 0 . This function has optimum x∗ = −b/a . Consider running gradient descent with step size η starting from x0 . The update rule is xt+1 = xt − η ( axt + b ) , which means that the error xt − x∗ evolves as ( xt+1 − x∗ ) = ( 1− ηa ) ( xt − x∗ ) . Therefore , the error at step t is ( xt − x∗ ) = ( 1 − ηa ) t ( x0 − x∗ ) , and so the iterate at step t is xt = ( 1− ηa ) t ( x0−x∗ ) +x∗ . If a > 2/η , then ( 1− ηa ) < −1 , so the sequence { xt } will oscillate around x∗ with ever-increasing magnitude , and diverge . Now consider the general d-dimensional case . Let ( ai , qi ) be the i-th largest eigenvalue/eigenvector of A . As shown in Appendix B , when the gradient descent iterates { xt } are expressed in the special coordinate system whose axes are the eigenvectors of A , each coordinate evolves separately . In particular , the coordinate for each eigenvector qi , namely 〈qi , xt〉 , evolves according to the dynamics of gradient descent on a one-dimensional quadratic objective with second derivative ai . 1This nomenclature was inspired by the title of Giladi et al . ( 2020 ) . 2In the literature , the term “ sharpness ” has been used to refer to a variety of quantities , often connected to generalization ( e.g . Keskar et al . ( 2016 ) ) . In this paper , “ sharpness ” strictly means the maximum eigenvalue of the training loss Hessian . We do not claim that this quantity has any connection to generalization . 3For convex quadratics , this is “ if and only if. ” However , if A has a negative eigenvalue , then gradient descent with any ( positive ) step size will diverge along the corresponding eigenvector . Therefore , if ai > 2/η , then the sequence { 〈qi , xt〉 } will oscillate with ever-increasing magnitude ; in this case , we say that the iterates { xt } diverge along the direction qi . To illustrate , Figure 2 shows a quadratic function with eigenvalues a1 = 20 and a2 = 1 . In Figure 2 ( a ) , we run gradient descent with step size η = 0.09 ; since 0 < a2 < a1 < 2/η , gradient descent converges along both q1 and q2 . In Figure 2 ( b ) , we use step size η = 0.11 ; since 0 < a2 < 2/η < a1 , gradient descent converges along q2 yet diverges along q1 , so diverges overall . Polyak momentum ( Polyak , 1964 ) and Nesterov momentum ( Nesterov , 1983 ; Sutskever et al. , 2013 ) are notable variants of gradient descent which often improve the convergence speed . On quadratic functions , these two algorithms also diverge if the sharpness exceeds a certain threshold , which we call the “ maximum stable sharpness , ” or MSS . In particular , we prove in Appendix B that gradient descent with step size η and momentum parameter β diverges if the sharpness exceeds : MSSPolyak ( η , β ) = 1 η ( 2 + 2β ) , MSSNesterov ( η , β ) = 1 η ( 2 + 2β 1 + 2β ) . ( 1 ) The Polyak result previously appeared in Goh ( 2017 ) ; the Nesterov one seems to be new . Note that this discussion only applies to full-batch gradient descent . As we discuss in §6 , several recent papers have proposed stability analyses for SGD ( Wu et al. , 2018 ; Jastrzębski et al. , 2020 ) . Neural network training objectives are not globally quadratic . However , the second-order Taylor approximation around any point x0 in parameter space is a quadratic function whose “ A ” matrix is the Hessian at x0 . If any eigenvalue of this Hessian exceeds 2/η , gradient descent with step size η would diverge if run on this quadratic function — the iterates would oscillate with ever-increasing magnitude along the corresponding eigenvector . Therefore , at any point x0 in parameter space where the sharpness exceeds 2/η , gradient descent with step size η would diverge if run on the quadratic Taylor approximation to the training objective around x0 . 3 GRADIENT DESCENT ON NEURAL NETWORKS . In this section , we empirically characterize the behavior of gradient descent on neural network training objectives . Section 4 will show that this characterization holds broadly . 3.1 PROGRESSIVE SHARPENING . When training neural networks , it seems to be a general rule that so long as the sharpness is small enough for gradient descent to be stable ( < 2/η , for vanilla gradient descent ) , gradient descent has an overwhelming tendency to continually increase the sharpness . We call this phenomenon progressive sharpening . By “ overwhelming tendency , ” we mean that gradient descent can occasionally decrease the sharpness ( especially at the beginning of training ) , but these brief decreases always seem be followed by a return to continual increase . Jastrzębski et al . ( 2020 ) previously hypothesized ( in their Assumption 4 ) that a similar phenomenon may hold for SGD , but the evidence for , and the precise scope of , this effect are both currently far clearer for gradient descent than for SGD . Progressive sharpening is illustrated in Figure 3 . Here , we use ( full-batch ) gradient descent to train a network on a subset of 5,000 examples from CIFAR-10 , and we monitor the evolution of the sharpness during training . The network is a fully-connected architecture with two hidden layers of width 200 , and tanh activations . In Figure 3 ( a ) , we train using the mean squared error loss for classification ( Hui & Belkin , 2020 ) , encoding the correct class with 1 and the other classes with 0 . We use the small step size of η = 2/600 , and stop when the training accuracy reaches 99 % . We plot both the train loss and the sharpness , with a horizontal dashed line marking the stability threshold 2/η . Observe that the sharpness continually rises during training ( except for a brief dip at the beginning ) . This is progressive sharpening . For this experiment , we intentionally chose a step size η small enough that the sharpness remained beneath 2/η for the entire duration of training . Cross-entropy . When training with cross-entropy loss , there is an exception to the rule that the sharpness tends to continually increase : with cross-entropy loss , the sharpness typically drops at the end of training . This behavior can be seen in Figure 3 ( b ) , where we train the same network using the cross-entropy loss rather than MSE . This drop occurs because once most data points are classified correctly , gradient descent tries to drive the cross-entropy loss to zero by scaling up the margins , as detailed in Soudry et al . ( 2018 ) . As we explain in Appendix C , this causes the sharpness to drop . The effect of width . It is known that when networks parameterized in a certain way ( the “ NTK parameterization ” ) are made infinitely wide , the Hessian moves a vanishingly small amount during training ( Jacot et al. , 2018 ; Lee et al. , 2019 ; Li & Liang , 2018 ) , which implies that no progressive sharpening occurs . In Appendix D , we experiment with networks of varying width , under both NTK and standard parameterizations . We find that progressive sharpening occurs to a lesser degree as networks become increasingly wide . Nevertheless , our experiments in §4 demonstrate that progressive sharpening occurs to a dramatic degree for standard architectures on the standard dataset CIFAR-10 . We do not know why progressive sharpening occurs , or whether “ sharp ” solutions differ in any important way from “ not sharp ” solutions . These are important questions for future work . Note that Mulayoff & Michaeli ( 2020 ) studied the latter question in the context of deep linear networks .
This paper presents an interesting observation for GD. That is, the sharpness of the learnt model in the final phase of the training (measured by the largest eigenvalue of the training loss Hessian) hovers right at the value 2/\eta while the training loss. At the same time, the loss goes to unstable and non-monotonically decreasing. This pattern is consistent across architecture, activation functions, tasks, loss functions and BN. Comprehensive experiments are conducted to show this common observation. The paper is easy to follow.
SP:d442ae98d8f485119b8fdd7070d16a7cabc0f9ea
A Critical Analysis of Distribution Shift
1 INTRODUCTION . While the research community must create robust models that generalize to new scenarios , the robustness literature ( Dodge and Karam , 2017 ; Geirhos et al. , 2020 ) lacks consensus on evaluation benchmarks and contains many dissonant hypotheses . Hendrycks et al . ( 2020a ) find that many recent language models are already robust to many forms of distribution shift , while Yin et al . ( 2019 ) and Geirhos et al . ( 2019 ) find that vision models are largely fragile and argue that data augmentation offers one solution . In contrast , Taori et al . ( 2020 ) provide results suggesting that using pretraining and improving in-distribution test set accuracy improve natural robustness , whereas other methods do not . In this paper we articulate and systematically study seven robustness hypotheses . The first four hypotheses concern methods for improving robustness , while the last three hypotheses concern abstract properties about robustness . These hypotheses are as follows . • Larger Models : increasing model size improves robustness ( Hendrycks and Dietterich , 2019 ; Xie and Yuille , 2020 ) . • Self-Attention : adding self-attention layers to models improves robustness ( Hendrycks et al. , 2019b ) . • Diverse Data Augmentation : robustness can increase through data augmentation ( Yin et al. , 2019 ) . • Pretraining : pretraining on larger and more diverse datasets improves robustness ( Orhan , 2019 ; Hendrycks et al. , 2019a ) . • Texture Bias : convolutional networks are biased towards texture , which harms robustness ( Geirhos et al. , 2019 ) . • Only IID Accuracy Matters : accuracy on independent and identically distributed test data entirely determines natural robustness . • Synthetic 6=⇒ Real : synthetic robustness interventions including diverse data augmentations do not help with robustness on real-world distribution shifts ( Taori et al. , 2020 ) . It has been difficult to arbitrate these hypotheses because existing robustness datasets preclude the possibility of controlled experiments by varying multiple aspects simultaneously . For instance , Texture Bias was initially investigated with synthetic distortions ( Geirhos et al. , 2018 ) , which conflicts with the Synthetic 6=⇒ Real hypothesis . On the other hand , natural distribution shifts often affect many factors ( e.g. , time , camera , location , etc . ) simultaneously in unknown ways ( Recht et al. , 2019 ; Hendrycks et al. , 2019b ) . Existing datasets also lack diversity such that it is hard to extrapolate which methods will improve robustness more broadly . To address these issues and test the seven hypotheses outlined above , we introduce three new robustness benchmarks and a new data augmentation method . First we introduce ImageNet-Renditions ( ImageNet-R ) , a 30,000 image test set containing various renditions ( e.g. , paintings , embroidery , etc . ) of ImageNet object classes . These renditions are naturally occurring , with textures and local image statistics unlike those of ImageNet images , allowing us to more cleanly separate the Texture Bias and Synthetic 6=⇒ Real hypotheses . Next , we investigate natural shifts in the image capture process with StreetView StoreFronts ( SVSF ) and DeepFashion Remixed ( DFR ) . SVSF contains business storefront images taken from Google Streetview , along with metadata allowing us to vary location , year , and even the camera type . DFR leverages the metadata from DeepFashion2 ( Ge et al. , 2019 ) to systematically shift object occlusion , orientation , zoom , and scale at test time . Both SVSF and DFR provide distribution shift controls and do not alter texture , which remove possible confounding variables affecting prior benchmarks . Finally , we contribute DeepAugment to increase robustness to some new types of distribution shift . This augmentation technique uses image-to-image neural networks for data augmentation , not data-independent Euclidean augmentations like image shearing or rotating as in previous work . DeepAugment achieves state-of-the-art robustness on our newly introduced ImageNet-R benchmark and a corruption robustness benchmark . DeepAugment can also be combined with other augmentation methods to outperform a model pretrained on 1000× more labeled data . After examining our results on these three datasets and others , we can rule out several of the above hypotheses while strengthening support for others . As one example , we find that synthetic data augmentation robustness interventions improve accuracy on ImageNet-R and real-world image blur distribution shifts , providing clear counterexamples to Synthetic 6=⇒ Real while lending support to the Diverse Data Augmentation and Texture Bias hypotheses . In the conclusion , we summarize the various strands of evidence for and against each hypothesis . Across our many experiments , we do not find a general method that consistently improves robustness , and some hypotheses require additional qualifications . While robustness is often spoken of and measured as a single scalar property like accuracy , our investigations suggest that robustness is not so simple . In light of our results , we hypothesize in the conclusion that robustness is multivariate . 2 RELATED WORK . Robustness Benchmarks . Recent works ( Hendrycks and Dietterich , 2019 ; Recht et al. , 2019 ; Hendrycks et al. , 2020a ) have begun to characterize model performance on out-of-distribution ( OOD ) data with various new test sets , with dissonant findings . For instance , Hendrycks et al . ( 2020a ) demonstrate that modern language processing models are moderately robust to numerous naturally occurring distribution shifts , and that Only IID Accuracy Matters is inaccurate for natural language tasks . For image recognition , Hendrycks and Dietterich ( 2019 ) analyze image models and show that they are sensitive to various simulated image corruptions ( e.g. , noise , blur , weather , JPEG compression , etc . ) from their “ ImageNet-C ” benchmark . Recht et al . ( 2019 ) reproduce the ImageNet ( Russakovsky et al. , 2015 ) validation set for use as a benchmark of naturally occurring distribution shift in computer vision . Their evaluations show a 11-14 % drop in accuracy from ImageNet to the new validation set , named ImageNetV2 , across a wide range of architectures . Taori et al . ( 2020 ) use ImageNetV2 to measure natural robustness and dismiss Diverse Data Augmentation . Recently , Engstrom et al . ( 2020 ) identify statistical biases in ImageNetV2 ’ s construction , and they estimate that reweighting ImageNetV2 to correct for these biases results in a less substantial 3.6 % drop . Data Augmentation . Geirhos et al . ( 2019 ) ; Yin et al . ( 2019 ) ; Hendrycks et al . ( 2020b ) demonstrate that data augmentation can improve robustness on ImageNet-C . The space of augmentations that help robustness includes various types of noise ( Madry et al. , 2017 ; Rusak et al. , 2020 ; Lopes et al. , 2019 ) , highly unnatural image transformations ( Geirhos et al. , 2019 ; Yun et al. , 2019 ; Zhang et al. , 2017 ) , or compositions of simple image transformations such as Python Imaging Library operations ( Cubuk et al. , 2018 ; Hendrycks et al. , 2020b ) . Some of these augmentations can improve accuracy on in-distribution examples as well as on out-of-distribution ( OOD ) examples . 3 NEW BENCHMARKS . In order to evaluate the seven robustness hypotheses , we introduce three new benchmarks that capture new types of naturally occurring distribution shifts . ImageNet-Renditions ( ImageNet-R ) is a newly collected test set intended for ImageNet classifiers , whereas StreetView StoreFronts ( SVSF ) and DeepFashion Remixed ( DFR ) each contain their own training sets and multiple test sets . SVSF and DFR split data into a training and test sets based on various image attributes stored in the metadata . For example , we can select a test set with images produced by a camera different from the training set camera . We now describe the structure and collection of each dataset . 3.1 IMAGENET-RENDITIONS ( IMAGENET-R ) . While current classifiers can learn some aspects of an object ’ s shape ( Mordvintsev et al. , 2015 ) , they nonetheless rely heavily on natural textural cues ( Geirhos et al. , 2019 ) . In contrast , human vision can process abstract visual renditions . For example , humans can recognize visual scenes from line drawings as quickly and accurately as they can from photographs ( Biederman and Ju , 1988 ) . Even some primates species have demonstrated the ability to recognize shape through line drawings ( Itakura , 1994 ; Tanaka , 2006 ) . To measure generalization to various abstract visual renditions , we create the ImageNet-Rendition ( ImageNet-R ) dataset . ImageNet-R contains various artistic renditions of object classes from the original ImageNet dataset . Note the original ImageNet dataset discouraged such images since annotators were instructed to collect “ photos only , no painting , no drawings , etc. ” ( Deng , 2012 ) . We do the opposite . Data Collection . ImageNet-R contains 30,000 image renditions for 200 ImageNet classes . We choose a subset of the ImageNet-1K classes , following Hendrycks et al . ( 2019b ) , for several reasons . A handful ImageNet classes already have many renditions , such as “ triceratops. ” We also choose a subset so that model misclassifications are egregious and to reduce label noise . The 200 class subset was also chosen based on rendition prevalence , as “ strawberry ” renditions were easier to obtain than “ radiator ” renditions . Were we to use all 1,000 ImageNet classes , annotators would be pressed to distinguish between Norwich terrier renditions as Norfolk terrier renditions , which is difficult . We collect images primarily from Flickr and use queries such as “ art , ” “ cartoon , ” “ graffiti , ” “ embroidery , ” “ graphics , ” “ origami , ” “ painting , ” “ pattern , ” “ plastic object , ” “ plush object , ” “ sculpture , ” “ line drawing , ” “ tattoo , ” “ toy , ” “ video game , ” and so on . Images are filtered by Amazon MTurk annotators using a modified collection interface from ImageNetV2 ( Recht et al. , 2019 ) . For instance , after scraping Flickr images with the query “ lighthouse cartoon , ” we have MTurk annotators select true positive lighthouse renditions . Finally , as a second round of quality control , graduate students manually filter the resulting images and ensure that individual images have correct labels and do not contain multiple labels . Examples are depicted in Figure 2 . ImageNet-R also includes the line drawings from Wang et al . ( 2019 ) , excluding horizontally mirrored duplicate images , pitch black images , and images from the incorrectly collected “ pirate ship ” class . 3.2 STREETVIEW STOREFRONTS ( SVSF ) . Computer vision applications often rely on data from complex pipelines that span different hardware , times , and geographies . Ambient variations in this pipeline may result in unexpected performance degradation , such as degradations experienced by health care providers in Thailand deploying laboratory-tuned diabetic retinopathy classifiers in the field ( Beede et al. , 2020 ) . In order to study the effects of shifts in the image capture process we collect the StreetView StoreFronts ( SVSF ) dataset , a new image classification dataset sampled from Google StreetView imagery ( Anguelov et al. , 2010 ) focusing on three distribution shift sources : country , year , and camera . Data Collection . SVSF consists of cropped images of business store fronts extracted from StreetView images by an object detection model . Each store front image is assigned the class label of the associated Google Maps business listing through a combination of machine learning models and human annotators . We combine several visually similar business types ( e.g . drugstores and pharmacies ) for a total of 20 classes , listed Appendix B. Splitting the data along the three metadata attributes of country , year , and camera , we create one training set and five test sets . We sample a training set and an in-distribution test set ( 200K and 10K images , respectively ) from images taken in US/Mexico/Canada during 2019 using a “ new ” camera system . We then sample four OOD test sets ( 10K images each ) which alter one attribute at a time while keeping the other two attributes consistent with the training distribution . Our test sets are year : 2017 , 2018 ; country : France ; and camera : “ old . ”
This paper provides a empirical study on the robustness of image classification models to distributions shifts. The authors construct three benchmark datasets that control for effects like artistic renditions of common classes, view-point changes, and geographic shifts (among others). The datasets are then used to test various hypotheses regarding robustness enhancing measures empirically. The authors additionally propose a novel augmentation scheme, that uses deep image processing networks together with random perturbations of their weights to synthesize distorted image samples.
SP:707b1ba524c785d8942517ba7dff17115012181f
A Critical Analysis of Distribution Shift
1 INTRODUCTION . While the research community must create robust models that generalize to new scenarios , the robustness literature ( Dodge and Karam , 2017 ; Geirhos et al. , 2020 ) lacks consensus on evaluation benchmarks and contains many dissonant hypotheses . Hendrycks et al . ( 2020a ) find that many recent language models are already robust to many forms of distribution shift , while Yin et al . ( 2019 ) and Geirhos et al . ( 2019 ) find that vision models are largely fragile and argue that data augmentation offers one solution . In contrast , Taori et al . ( 2020 ) provide results suggesting that using pretraining and improving in-distribution test set accuracy improve natural robustness , whereas other methods do not . In this paper we articulate and systematically study seven robustness hypotheses . The first four hypotheses concern methods for improving robustness , while the last three hypotheses concern abstract properties about robustness . These hypotheses are as follows . • Larger Models : increasing model size improves robustness ( Hendrycks and Dietterich , 2019 ; Xie and Yuille , 2020 ) . • Self-Attention : adding self-attention layers to models improves robustness ( Hendrycks et al. , 2019b ) . • Diverse Data Augmentation : robustness can increase through data augmentation ( Yin et al. , 2019 ) . • Pretraining : pretraining on larger and more diverse datasets improves robustness ( Orhan , 2019 ; Hendrycks et al. , 2019a ) . • Texture Bias : convolutional networks are biased towards texture , which harms robustness ( Geirhos et al. , 2019 ) . • Only IID Accuracy Matters : accuracy on independent and identically distributed test data entirely determines natural robustness . • Synthetic 6=⇒ Real : synthetic robustness interventions including diverse data augmentations do not help with robustness on real-world distribution shifts ( Taori et al. , 2020 ) . It has been difficult to arbitrate these hypotheses because existing robustness datasets preclude the possibility of controlled experiments by varying multiple aspects simultaneously . For instance , Texture Bias was initially investigated with synthetic distortions ( Geirhos et al. , 2018 ) , which conflicts with the Synthetic 6=⇒ Real hypothesis . On the other hand , natural distribution shifts often affect many factors ( e.g. , time , camera , location , etc . ) simultaneously in unknown ways ( Recht et al. , 2019 ; Hendrycks et al. , 2019b ) . Existing datasets also lack diversity such that it is hard to extrapolate which methods will improve robustness more broadly . To address these issues and test the seven hypotheses outlined above , we introduce three new robustness benchmarks and a new data augmentation method . First we introduce ImageNet-Renditions ( ImageNet-R ) , a 30,000 image test set containing various renditions ( e.g. , paintings , embroidery , etc . ) of ImageNet object classes . These renditions are naturally occurring , with textures and local image statistics unlike those of ImageNet images , allowing us to more cleanly separate the Texture Bias and Synthetic 6=⇒ Real hypotheses . Next , we investigate natural shifts in the image capture process with StreetView StoreFronts ( SVSF ) and DeepFashion Remixed ( DFR ) . SVSF contains business storefront images taken from Google Streetview , along with metadata allowing us to vary location , year , and even the camera type . DFR leverages the metadata from DeepFashion2 ( Ge et al. , 2019 ) to systematically shift object occlusion , orientation , zoom , and scale at test time . Both SVSF and DFR provide distribution shift controls and do not alter texture , which remove possible confounding variables affecting prior benchmarks . Finally , we contribute DeepAugment to increase robustness to some new types of distribution shift . This augmentation technique uses image-to-image neural networks for data augmentation , not data-independent Euclidean augmentations like image shearing or rotating as in previous work . DeepAugment achieves state-of-the-art robustness on our newly introduced ImageNet-R benchmark and a corruption robustness benchmark . DeepAugment can also be combined with other augmentation methods to outperform a model pretrained on 1000× more labeled data . After examining our results on these three datasets and others , we can rule out several of the above hypotheses while strengthening support for others . As one example , we find that synthetic data augmentation robustness interventions improve accuracy on ImageNet-R and real-world image blur distribution shifts , providing clear counterexamples to Synthetic 6=⇒ Real while lending support to the Diverse Data Augmentation and Texture Bias hypotheses . In the conclusion , we summarize the various strands of evidence for and against each hypothesis . Across our many experiments , we do not find a general method that consistently improves robustness , and some hypotheses require additional qualifications . While robustness is often spoken of and measured as a single scalar property like accuracy , our investigations suggest that robustness is not so simple . In light of our results , we hypothesize in the conclusion that robustness is multivariate . 2 RELATED WORK . Robustness Benchmarks . Recent works ( Hendrycks and Dietterich , 2019 ; Recht et al. , 2019 ; Hendrycks et al. , 2020a ) have begun to characterize model performance on out-of-distribution ( OOD ) data with various new test sets , with dissonant findings . For instance , Hendrycks et al . ( 2020a ) demonstrate that modern language processing models are moderately robust to numerous naturally occurring distribution shifts , and that Only IID Accuracy Matters is inaccurate for natural language tasks . For image recognition , Hendrycks and Dietterich ( 2019 ) analyze image models and show that they are sensitive to various simulated image corruptions ( e.g. , noise , blur , weather , JPEG compression , etc . ) from their “ ImageNet-C ” benchmark . Recht et al . ( 2019 ) reproduce the ImageNet ( Russakovsky et al. , 2015 ) validation set for use as a benchmark of naturally occurring distribution shift in computer vision . Their evaluations show a 11-14 % drop in accuracy from ImageNet to the new validation set , named ImageNetV2 , across a wide range of architectures . Taori et al . ( 2020 ) use ImageNetV2 to measure natural robustness and dismiss Diverse Data Augmentation . Recently , Engstrom et al . ( 2020 ) identify statistical biases in ImageNetV2 ’ s construction , and they estimate that reweighting ImageNetV2 to correct for these biases results in a less substantial 3.6 % drop . Data Augmentation . Geirhos et al . ( 2019 ) ; Yin et al . ( 2019 ) ; Hendrycks et al . ( 2020b ) demonstrate that data augmentation can improve robustness on ImageNet-C . The space of augmentations that help robustness includes various types of noise ( Madry et al. , 2017 ; Rusak et al. , 2020 ; Lopes et al. , 2019 ) , highly unnatural image transformations ( Geirhos et al. , 2019 ; Yun et al. , 2019 ; Zhang et al. , 2017 ) , or compositions of simple image transformations such as Python Imaging Library operations ( Cubuk et al. , 2018 ; Hendrycks et al. , 2020b ) . Some of these augmentations can improve accuracy on in-distribution examples as well as on out-of-distribution ( OOD ) examples . 3 NEW BENCHMARKS . In order to evaluate the seven robustness hypotheses , we introduce three new benchmarks that capture new types of naturally occurring distribution shifts . ImageNet-Renditions ( ImageNet-R ) is a newly collected test set intended for ImageNet classifiers , whereas StreetView StoreFronts ( SVSF ) and DeepFashion Remixed ( DFR ) each contain their own training sets and multiple test sets . SVSF and DFR split data into a training and test sets based on various image attributes stored in the metadata . For example , we can select a test set with images produced by a camera different from the training set camera . We now describe the structure and collection of each dataset . 3.1 IMAGENET-RENDITIONS ( IMAGENET-R ) . While current classifiers can learn some aspects of an object ’ s shape ( Mordvintsev et al. , 2015 ) , they nonetheless rely heavily on natural textural cues ( Geirhos et al. , 2019 ) . In contrast , human vision can process abstract visual renditions . For example , humans can recognize visual scenes from line drawings as quickly and accurately as they can from photographs ( Biederman and Ju , 1988 ) . Even some primates species have demonstrated the ability to recognize shape through line drawings ( Itakura , 1994 ; Tanaka , 2006 ) . To measure generalization to various abstract visual renditions , we create the ImageNet-Rendition ( ImageNet-R ) dataset . ImageNet-R contains various artistic renditions of object classes from the original ImageNet dataset . Note the original ImageNet dataset discouraged such images since annotators were instructed to collect “ photos only , no painting , no drawings , etc. ” ( Deng , 2012 ) . We do the opposite . Data Collection . ImageNet-R contains 30,000 image renditions for 200 ImageNet classes . We choose a subset of the ImageNet-1K classes , following Hendrycks et al . ( 2019b ) , for several reasons . A handful ImageNet classes already have many renditions , such as “ triceratops. ” We also choose a subset so that model misclassifications are egregious and to reduce label noise . The 200 class subset was also chosen based on rendition prevalence , as “ strawberry ” renditions were easier to obtain than “ radiator ” renditions . Were we to use all 1,000 ImageNet classes , annotators would be pressed to distinguish between Norwich terrier renditions as Norfolk terrier renditions , which is difficult . We collect images primarily from Flickr and use queries such as “ art , ” “ cartoon , ” “ graffiti , ” “ embroidery , ” “ graphics , ” “ origami , ” “ painting , ” “ pattern , ” “ plastic object , ” “ plush object , ” “ sculpture , ” “ line drawing , ” “ tattoo , ” “ toy , ” “ video game , ” and so on . Images are filtered by Amazon MTurk annotators using a modified collection interface from ImageNetV2 ( Recht et al. , 2019 ) . For instance , after scraping Flickr images with the query “ lighthouse cartoon , ” we have MTurk annotators select true positive lighthouse renditions . Finally , as a second round of quality control , graduate students manually filter the resulting images and ensure that individual images have correct labels and do not contain multiple labels . Examples are depicted in Figure 2 . ImageNet-R also includes the line drawings from Wang et al . ( 2019 ) , excluding horizontally mirrored duplicate images , pitch black images , and images from the incorrectly collected “ pirate ship ” class . 3.2 STREETVIEW STOREFRONTS ( SVSF ) . Computer vision applications often rely on data from complex pipelines that span different hardware , times , and geographies . Ambient variations in this pipeline may result in unexpected performance degradation , such as degradations experienced by health care providers in Thailand deploying laboratory-tuned diabetic retinopathy classifiers in the field ( Beede et al. , 2020 ) . In order to study the effects of shifts in the image capture process we collect the StreetView StoreFronts ( SVSF ) dataset , a new image classification dataset sampled from Google StreetView imagery ( Anguelov et al. , 2010 ) focusing on three distribution shift sources : country , year , and camera . Data Collection . SVSF consists of cropped images of business store fronts extracted from StreetView images by an object detection model . Each store front image is assigned the class label of the associated Google Maps business listing through a combination of machine learning models and human annotators . We combine several visually similar business types ( e.g . drugstores and pharmacies ) for a total of 20 classes , listed Appendix B. Splitting the data along the three metadata attributes of country , year , and camera , we create one training set and five test sets . We sample a training set and an in-distribution test set ( 200K and 10K images , respectively ) from images taken in US/Mexico/Canada during 2019 using a “ new ” camera system . We then sample four OOD test sets ( 10K images each ) which alter one attribute at a time while keeping the other two attributes consistent with the training distribution . Our test sets are year : 2017 , 2018 ; country : France ; and camera : “ old . ”
This paper investigates the robustness problem of computer vision model. To study the model robustness in a controlled setting, the author introduces three new robustness benchmarks: ImageNet-R, StreetView StoreFronts and DeepFashion Remixed. Each of them address different aspects of distribution drift in the real world. The author evaluates seven popular hypotheses on model robustness in the community on the three new datasets and has found counter-example for most of them. Based on those new results, the author concluded that model robustness problem is multi-variate in nature: no single solution could handle all aspects yet. And future work should be tested on multiple datasets to prove robustness. Moreover, the author also proposes a new data augmentation method using perturbed image-to-image deep learning model to generate visually diverse augmentations.
SP:707b1ba524c785d8942517ba7dff17115012181f
Symmetric Wasserstein Autoencoders
1 INTRODUCTION . Deep generative models have emerged as powerful frameworks for modelling complex data . Widely used families of such models include Generative Adversarial Networks ( GANs ) ( Goodfellow et al. , 2014 ) , Variational Autoencoders ( VAEs ) ( Rezende et al. , 2014 ; Kingma & Welling , 2014 ) , and autoregressive models ( Uria et al. , 2013 ; Van Oord et al. , 2016 ) . The VAE-based framework has been popular as it yields a bidirectional mapping , i.e. , it consists of both an inference model ( from data to latent space ) and a generative model ( from latent to data space ) . With an inference mechanism VAEs can provide a useful latent representation that captures salient information about the observed data . Such latent representation can in turn benefit downstream tasks such as clustering , classification , and data generation . In particular , the VAE-based approaches have achieved impressive performance results on challenging real-world applications , including image synthesizing ( Razavi et al. , 2019 ) , natural text generation ( Hu et al. , 2017 ) , and neural machine translation ( Sutskever et al. , 2014 ) . VAEs aim to maximize a tractable variational lower bound on the log-likelihood of the observed data , commonly called the ELBO . Since VAEs focus on modelling the marginal likelihood of the data instead of the joint likelihood of the data and the latent representation , the quality of the latent is not well assessed ( Alemi et al. , 2017 ; Zhao et al. , 2019 ) , which is undesirable for learning useful representation . Besides the perspective of maximum-likelihood learning of the data , the objective of VAEs is equivalent to minimizing the KL divergence between the encoding and the decoding distributions , with the former modelling the joint distribution of the observed data and the latent representation induced by the encoder and the latter modelling the corresponding joint distribution induced by the decoder . Such connection has been revealed in several recent works ( Livne et al. , 2019 ; Esmaeili et al. , 2019 ; Pu et al. , 2017b ; Chen et al. , 2018 ) . Due to the asymmetry of the KL divergence , it is highly likely that the generated samples are of a low probability in the data distribution , which often leads to unrealistic generated samples ( Li et al. , 2017b ; Alemi et al. , 2017 ) . A lot of work has proposed to improve VAEs from different perspectives . For example , to enhance the latent expressive power VampPrior ( Tomczak & Welling , 2018 ) , normalizing flow ( Rezende & Mohamed , 2015 ) , and Stein VAEs ( Pu et al. , 2017a ) replace the Gaussian distribution imposed on the latent variables with a more sophisticated and flexible distribution . However , these methods are all based on the objective of VAEs , which therefore are unable to alleviate the limitation of VAEs induced by the objective . To improve the latent representation ( Zhao et al. , 2019 ) explicitly includes the mutual information between the data and the latent into the objective . Moreover , to address the asymmetry of the KL divergence in VAEs ( Livne et al. , 2019 ; Chen et al. , 2018 ; Pu et al. , 2017b ) leverage a symmetric divergence measure between the encoding and the decoding distributions . Nevertheless , these methods typically involve a sophisticated objective function that either depends on unstable adversarial training or challenging approximation of the mutual information . In this paper , we leverage Optimal Transport ( OT ) ( Villani , 2008 ; Peyré et al. , 2019 ) to symmetrically match the encoding and the decoding distributions . The OT optimization is generally challenging particularly in high dimension , and we address this difficulty by transforming the OT cost into a simpler form amenable to efficient numerical implementation . Owing to the symmetric treatment of the observed data and the latent representation , the local structure of the data can be implicitly preserved in the latent space . However , we found that with the symmetric treatment only the performance of the generative model may not be satisfactory . To improve the generative model we additionally include a reconstruction loss into the objective , which is shown to significantly benefit the quality of the generation and reconstruction . Our contributions can be summarized as follows . Firstly , we propose a new family of generative autoencoders , called Symmetric Wasserstein Autoencoders ( SWAEs ) . Secondly , we adopt a learnable latent prior , parameterized as a mixture of the conditional priors given the learnable pseudo-inputs , which prevents SWAEs from over-regularizing the latent variables . Thirdly , we empirically perform an ablation study of SWAEs in terms of the KNN classification , denoising , reconstruction , and sample generation . Finally , we empirically verify , using benchmark tasks , the superior performance of SWAEs over several state-of-the-art generative autoencoders . 2 SYMMETRIC WASSERSTEIN AUTOENCODERS . In this section we introduce a new family of generative autoencoders , called Symmetric Wasserstein Autoencoders ( SWAEs ) . 2.1 OT FORMULATION . Denote the random vector at the encoder as e , ( xe , ze ) ∈ X×Z , which contains both the observed data xe ∈ X and the latent representation ze ∈ Z . We call the distribution p ( e ) ∼ p ( xe ) p ( ze|xe ) the encoding distribution , where p ( xe ) represents the data distribution and p ( ze|xe ) characterizes an inference model . Similarly , denote the random vector at the decoder as d , ( xd , zd ) ∈ X × Z , which consists of both the latent prior zd ∈ Z and the generated data xd ∈ X . We call the distribution p ( d ) ∼ p ( zd ) p ( xd|zd ) the decoding distribution , where p ( zd ) represents the prior distribution and p ( xd|zd ) characterizes a generative model . The objective of VAEs is equivalent to minimizing the ( asymmetric ) KL divergence between the encoding distribution p ( e ) and the decoding distribution p ( d ) ( see Appendix A.1 ) . To address the limitation in VAEs , first we propose to treat the data and the latent representation symmetrically instead of asymmetrically by minimizing the pth Wasserstein distance between p ( e ) and p ( d ) leveraging Optimal Transport ( OT ) ( Villani , 2008 ; Peyré et al. , 2019 ) . OT provides a framework for comparing two distributions in a Lagrangian framework , which seeks the minimum cost for transporting one distribution to another . We focus on the primal problem of OT , and Kantorovich ’ s formulation ( Peyré et al. , 2019 ) is given by : Wc ( p ( e ) , p ( d ) ) , inf Γ∈P ( e∼p ( e ) , d∼p ( d ) ) E ( e , d ) ∼Γ c ( e , d ) , ( 1 ) where P ( e ∼ p ( e ) , d ∼ p ( d ) ) , called the coupling between e and d , denotes the set of the joint distributions of e and d with the marginals p ( e ) and p ( d ) , respectively , and c ( e , d ) : ( X , Z ) × ( X , Z ) → [ 0 , +∞ ] denotes the cost function . When ( ( X , Z ) × ( X , Z ) , d ) is a metric space and the cost function c ( e , d ) = dp ( e , d ) for p ≥ 1 , Wp , the p-th root of Wc is defined as the p-th Wasserstein distance . In particular , it can be proved that the p-th Wasserstein distance is a metric hence symmetric , and metrizes the weak convergence ( see , e.g. , ( Santambrogio , 2015 ) ) . Optimization of equation 1 is computationally prohibitive especially in high dimension ( Peyré et al. , 2019 ) . To provide an efficient solution , we restrict to the deterministic encoder and decoder . Specifically , at the encoder we have the latent representation ze = E ( xe ) with the function E : X → Z , and at the decoder we have the generated data xd = D ( zd ) with the function D : Z → X . It turns out that with the deterministic condition instead of searching for an optimal coupling in high dimension , we can find a proper conditional distribution p ( zd|xe ) with the marginal p ( zd ) . Theorem 1 Given the deterministic encoder E : X → Z and the deterministic decoder D : Z → X , the OT problem in equation 1 can be transformed to the following : Wc ( p ( e ) , p ( d ) ) = inf p ( zd|xe ) Ep ( xe ) Ep ( zd|xe ) c ( e , d ) , ( 2 ) where the observed data follows the distribution p ( xe ) and the prior follows the distribution p ( zd ) . The proof of Theorem 1 extends that of Theorem 1 in ( Tolstikhin et al. , 2018 ) , and is provided in Appendix A.2 . If X × Z is the Euclidean space endowed with the Lp norm , then the expression in equation 2 equals the following : Wc ( p ( e ) , p ( d ) ) = inf p ( zd|xe ) Ep ( xe ) Ep ( zd|xe ) ‖xe −D ( zd ) ‖ p p + ‖E ( xe ) − zd‖pp , ( 3 ) where in the objective we call the first term the x-loss and the second term the z-loss . With the above transformation , we decompose the loss in the joint space into the losses in both the data and the latent spaces . Such decomposition is crucial and allows us to treat the data and the latent representation symmetrically . The x-loss , i.e. , ‖xe−D ( zd ) ‖pp , represents the discrepancy in the data space , and can be interpreted from two different perspectives . Firstly , since D ( zd ) represents the generated data , the x-loss essentially minimizes the dissimilarity between the observed data and the generated data . Secondly , the x-loss is closely related to the objective of Denoising Autoencoders ( DAs ) ( Vincent et al. , 2008 ; 2010 ) . In particular , DAs aim to minimize the discrepancy between the observed data and a partially destroyed version of the observed data . The corrupted data can be obtained by means of a stochastic mapping from the original data ( e.g. , via adding noises ) . By contrast , the x-loss can be explained in the same way with the generated data being interpreted as the corrupted data . This is because the prior zd in D ( zd ) is sampled from the conditional distribution p ( zd|xe ) , which depends on the observed data xe . Consequently , the generated data D ( zd ) , obtained by feeding zd to the decoder , is stochastically related to the observed data xe . With this insight , the same as the objective of DAs , the x-loss can lead to the denoising effect . The z-loss , i.e. , ‖E ( xe ) − zd‖pp , represents the discrepancy in the latent space . The whole objective in equation 3 hence simultaneously minimizes the discrepancy in the data and the latent spaces . Observe that in equation 3 E ( xe ) is the latent representation of xe at the encoder , while zd can be thought of as the latent representation of D ( zd ) at the decoder . With such connection , the optimization of equation 3 can preserve the local data structure in the latent space . More specifically , since xe and D ( zd ) are stochastically dependent , roughly speaking , if two data samples are close to each other in the data space , their corresponding latent representations are also expected to be close . This is due to the symmetric treatment of the data and the latent representation . In Figure 1 we illustrate this effect and compare SWAE with VAE . Comparison with WAEs ( Tolstikhin et al. , 2018 ) The objective in equation 3 minimizes the OT cost between the joint distributions of the data and the latent , i.e. , Wc ( p ( e ) , p ( d ) ) , while the objective of WAEs ( Tolstikhin et al. , 2018 ) minimizes the OT cost between the marginal distributions of the data , i.e. , Wc ( p ( xe ) , p ( xd ) ) , where p ( xd ) is the marginal data distribution induced by the decoding distribution p ( d ) . The problem of WAEs is first formulated as an optimization with the constraint p ( ze ) = p ( zd ) , where p ( ze ) is the marginal distribution induced by the encoding distribution p ( e ) , and then relaxed by adding a regularizer . With the deterministic decoder , the final optimization problem of WAEs is as follows : inf p ( ze|xe ) Ep ( xe ) Ep ( ze|xe ) c ( xe , D ( ze ) ) + λD ( p ( ze ) , p ( zd ) ) , ( 4 ) where D ( , ) denotes some divergence measure . Comparing equation 4 to equation 3 , we can see that both methods decompose the loss into the losses in the data and the latent spaces . Differently , in equation 4 the first term reflects the reconstruction loss in the data space and the second term represents the distribution-based dissimilarity in the latent space ; while in equation 3 the x-loss is closely related to the denoising and the generation quality and the z-loss measures the sample-based dissimilarity . Moreover , equation 4 is optimized over the posterior p ( ze|xe ) with a fixed prior p ( zd ) , while equation 3 is optimized over the conditional prior p ( zd|xe ) with a potentially learnable prior .
This works proposes an new auto-encoder variant based on an Optimal Transport (OT) penalty. While there are many such previous works of OT and auto-encoders, this work proposes a joint OT penalty on data and latent space. As the scalability of computing OT penalties in high dimensions is a concern, the authors address this by restricting to deterministic encoders and decoders in Theorem 1, an extension to joint distributions of Theorem 1 of Tolstikhin 2018. The resulting algorithm amounts to a loss involving L2 penalties for (1) the reconstruction loss (2) decoded latents (conditional on "pseudo-inputs") and real samples (3) encoded samples and the conditional latents. Next experimental results are shown on small-scale datasets (MNIST, Fashion-MNIST, Coil20, subest of CIFAR-10) and compared against the VAE, WAE-{GAN,MMD}, VampPrior, and MIM.
SP:1c4488d4b73efbed04b1045b425d7804b405ce1f
Symmetric Wasserstein Autoencoders
1 INTRODUCTION . Deep generative models have emerged as powerful frameworks for modelling complex data . Widely used families of such models include Generative Adversarial Networks ( GANs ) ( Goodfellow et al. , 2014 ) , Variational Autoencoders ( VAEs ) ( Rezende et al. , 2014 ; Kingma & Welling , 2014 ) , and autoregressive models ( Uria et al. , 2013 ; Van Oord et al. , 2016 ) . The VAE-based framework has been popular as it yields a bidirectional mapping , i.e. , it consists of both an inference model ( from data to latent space ) and a generative model ( from latent to data space ) . With an inference mechanism VAEs can provide a useful latent representation that captures salient information about the observed data . Such latent representation can in turn benefit downstream tasks such as clustering , classification , and data generation . In particular , the VAE-based approaches have achieved impressive performance results on challenging real-world applications , including image synthesizing ( Razavi et al. , 2019 ) , natural text generation ( Hu et al. , 2017 ) , and neural machine translation ( Sutskever et al. , 2014 ) . VAEs aim to maximize a tractable variational lower bound on the log-likelihood of the observed data , commonly called the ELBO . Since VAEs focus on modelling the marginal likelihood of the data instead of the joint likelihood of the data and the latent representation , the quality of the latent is not well assessed ( Alemi et al. , 2017 ; Zhao et al. , 2019 ) , which is undesirable for learning useful representation . Besides the perspective of maximum-likelihood learning of the data , the objective of VAEs is equivalent to minimizing the KL divergence between the encoding and the decoding distributions , with the former modelling the joint distribution of the observed data and the latent representation induced by the encoder and the latter modelling the corresponding joint distribution induced by the decoder . Such connection has been revealed in several recent works ( Livne et al. , 2019 ; Esmaeili et al. , 2019 ; Pu et al. , 2017b ; Chen et al. , 2018 ) . Due to the asymmetry of the KL divergence , it is highly likely that the generated samples are of a low probability in the data distribution , which often leads to unrealistic generated samples ( Li et al. , 2017b ; Alemi et al. , 2017 ) . A lot of work has proposed to improve VAEs from different perspectives . For example , to enhance the latent expressive power VampPrior ( Tomczak & Welling , 2018 ) , normalizing flow ( Rezende & Mohamed , 2015 ) , and Stein VAEs ( Pu et al. , 2017a ) replace the Gaussian distribution imposed on the latent variables with a more sophisticated and flexible distribution . However , these methods are all based on the objective of VAEs , which therefore are unable to alleviate the limitation of VAEs induced by the objective . To improve the latent representation ( Zhao et al. , 2019 ) explicitly includes the mutual information between the data and the latent into the objective . Moreover , to address the asymmetry of the KL divergence in VAEs ( Livne et al. , 2019 ; Chen et al. , 2018 ; Pu et al. , 2017b ) leverage a symmetric divergence measure between the encoding and the decoding distributions . Nevertheless , these methods typically involve a sophisticated objective function that either depends on unstable adversarial training or challenging approximation of the mutual information . In this paper , we leverage Optimal Transport ( OT ) ( Villani , 2008 ; Peyré et al. , 2019 ) to symmetrically match the encoding and the decoding distributions . The OT optimization is generally challenging particularly in high dimension , and we address this difficulty by transforming the OT cost into a simpler form amenable to efficient numerical implementation . Owing to the symmetric treatment of the observed data and the latent representation , the local structure of the data can be implicitly preserved in the latent space . However , we found that with the symmetric treatment only the performance of the generative model may not be satisfactory . To improve the generative model we additionally include a reconstruction loss into the objective , which is shown to significantly benefit the quality of the generation and reconstruction . Our contributions can be summarized as follows . Firstly , we propose a new family of generative autoencoders , called Symmetric Wasserstein Autoencoders ( SWAEs ) . Secondly , we adopt a learnable latent prior , parameterized as a mixture of the conditional priors given the learnable pseudo-inputs , which prevents SWAEs from over-regularizing the latent variables . Thirdly , we empirically perform an ablation study of SWAEs in terms of the KNN classification , denoising , reconstruction , and sample generation . Finally , we empirically verify , using benchmark tasks , the superior performance of SWAEs over several state-of-the-art generative autoencoders . 2 SYMMETRIC WASSERSTEIN AUTOENCODERS . In this section we introduce a new family of generative autoencoders , called Symmetric Wasserstein Autoencoders ( SWAEs ) . 2.1 OT FORMULATION . Denote the random vector at the encoder as e , ( xe , ze ) ∈ X×Z , which contains both the observed data xe ∈ X and the latent representation ze ∈ Z . We call the distribution p ( e ) ∼ p ( xe ) p ( ze|xe ) the encoding distribution , where p ( xe ) represents the data distribution and p ( ze|xe ) characterizes an inference model . Similarly , denote the random vector at the decoder as d , ( xd , zd ) ∈ X × Z , which consists of both the latent prior zd ∈ Z and the generated data xd ∈ X . We call the distribution p ( d ) ∼ p ( zd ) p ( xd|zd ) the decoding distribution , where p ( zd ) represents the prior distribution and p ( xd|zd ) characterizes a generative model . The objective of VAEs is equivalent to minimizing the ( asymmetric ) KL divergence between the encoding distribution p ( e ) and the decoding distribution p ( d ) ( see Appendix A.1 ) . To address the limitation in VAEs , first we propose to treat the data and the latent representation symmetrically instead of asymmetrically by minimizing the pth Wasserstein distance between p ( e ) and p ( d ) leveraging Optimal Transport ( OT ) ( Villani , 2008 ; Peyré et al. , 2019 ) . OT provides a framework for comparing two distributions in a Lagrangian framework , which seeks the minimum cost for transporting one distribution to another . We focus on the primal problem of OT , and Kantorovich ’ s formulation ( Peyré et al. , 2019 ) is given by : Wc ( p ( e ) , p ( d ) ) , inf Γ∈P ( e∼p ( e ) , d∼p ( d ) ) E ( e , d ) ∼Γ c ( e , d ) , ( 1 ) where P ( e ∼ p ( e ) , d ∼ p ( d ) ) , called the coupling between e and d , denotes the set of the joint distributions of e and d with the marginals p ( e ) and p ( d ) , respectively , and c ( e , d ) : ( X , Z ) × ( X , Z ) → [ 0 , +∞ ] denotes the cost function . When ( ( X , Z ) × ( X , Z ) , d ) is a metric space and the cost function c ( e , d ) = dp ( e , d ) for p ≥ 1 , Wp , the p-th root of Wc is defined as the p-th Wasserstein distance . In particular , it can be proved that the p-th Wasserstein distance is a metric hence symmetric , and metrizes the weak convergence ( see , e.g. , ( Santambrogio , 2015 ) ) . Optimization of equation 1 is computationally prohibitive especially in high dimension ( Peyré et al. , 2019 ) . To provide an efficient solution , we restrict to the deterministic encoder and decoder . Specifically , at the encoder we have the latent representation ze = E ( xe ) with the function E : X → Z , and at the decoder we have the generated data xd = D ( zd ) with the function D : Z → X . It turns out that with the deterministic condition instead of searching for an optimal coupling in high dimension , we can find a proper conditional distribution p ( zd|xe ) with the marginal p ( zd ) . Theorem 1 Given the deterministic encoder E : X → Z and the deterministic decoder D : Z → X , the OT problem in equation 1 can be transformed to the following : Wc ( p ( e ) , p ( d ) ) = inf p ( zd|xe ) Ep ( xe ) Ep ( zd|xe ) c ( e , d ) , ( 2 ) where the observed data follows the distribution p ( xe ) and the prior follows the distribution p ( zd ) . The proof of Theorem 1 extends that of Theorem 1 in ( Tolstikhin et al. , 2018 ) , and is provided in Appendix A.2 . If X × Z is the Euclidean space endowed with the Lp norm , then the expression in equation 2 equals the following : Wc ( p ( e ) , p ( d ) ) = inf p ( zd|xe ) Ep ( xe ) Ep ( zd|xe ) ‖xe −D ( zd ) ‖ p p + ‖E ( xe ) − zd‖pp , ( 3 ) where in the objective we call the first term the x-loss and the second term the z-loss . With the above transformation , we decompose the loss in the joint space into the losses in both the data and the latent spaces . Such decomposition is crucial and allows us to treat the data and the latent representation symmetrically . The x-loss , i.e. , ‖xe−D ( zd ) ‖pp , represents the discrepancy in the data space , and can be interpreted from two different perspectives . Firstly , since D ( zd ) represents the generated data , the x-loss essentially minimizes the dissimilarity between the observed data and the generated data . Secondly , the x-loss is closely related to the objective of Denoising Autoencoders ( DAs ) ( Vincent et al. , 2008 ; 2010 ) . In particular , DAs aim to minimize the discrepancy between the observed data and a partially destroyed version of the observed data . The corrupted data can be obtained by means of a stochastic mapping from the original data ( e.g. , via adding noises ) . By contrast , the x-loss can be explained in the same way with the generated data being interpreted as the corrupted data . This is because the prior zd in D ( zd ) is sampled from the conditional distribution p ( zd|xe ) , which depends on the observed data xe . Consequently , the generated data D ( zd ) , obtained by feeding zd to the decoder , is stochastically related to the observed data xe . With this insight , the same as the objective of DAs , the x-loss can lead to the denoising effect . The z-loss , i.e. , ‖E ( xe ) − zd‖pp , represents the discrepancy in the latent space . The whole objective in equation 3 hence simultaneously minimizes the discrepancy in the data and the latent spaces . Observe that in equation 3 E ( xe ) is the latent representation of xe at the encoder , while zd can be thought of as the latent representation of D ( zd ) at the decoder . With such connection , the optimization of equation 3 can preserve the local data structure in the latent space . More specifically , since xe and D ( zd ) are stochastically dependent , roughly speaking , if two data samples are close to each other in the data space , their corresponding latent representations are also expected to be close . This is due to the symmetric treatment of the data and the latent representation . In Figure 1 we illustrate this effect and compare SWAE with VAE . Comparison with WAEs ( Tolstikhin et al. , 2018 ) The objective in equation 3 minimizes the OT cost between the joint distributions of the data and the latent , i.e. , Wc ( p ( e ) , p ( d ) ) , while the objective of WAEs ( Tolstikhin et al. , 2018 ) minimizes the OT cost between the marginal distributions of the data , i.e. , Wc ( p ( xe ) , p ( xd ) ) , where p ( xd ) is the marginal data distribution induced by the decoding distribution p ( d ) . The problem of WAEs is first formulated as an optimization with the constraint p ( ze ) = p ( zd ) , where p ( ze ) is the marginal distribution induced by the encoding distribution p ( e ) , and then relaxed by adding a regularizer . With the deterministic decoder , the final optimization problem of WAEs is as follows : inf p ( ze|xe ) Ep ( xe ) Ep ( ze|xe ) c ( xe , D ( ze ) ) + λD ( p ( ze ) , p ( zd ) ) , ( 4 ) where D ( , ) denotes some divergence measure . Comparing equation 4 to equation 3 , we can see that both methods decompose the loss into the losses in the data and the latent spaces . Differently , in equation 4 the first term reflects the reconstruction loss in the data space and the second term represents the distribution-based dissimilarity in the latent space ; while in equation 3 the x-loss is closely related to the denoising and the generation quality and the z-loss measures the sample-based dissimilarity . Moreover , equation 4 is optimized over the posterior p ( ze|xe ) with a fixed prior p ( zd ) , while equation 3 is optimized over the conditional prior p ( zd|xe ) with a potentially learnable prior .
This paper proposes to treat the encoding and the decoding pairs symmetrically as a solution to OT problems. SWAE minimizes $p(x_d, z_d)$ and $p(x_e, z_e)$ in a jointly manner and shows better latent representation learning and generation. Moreover, the symmetric treatment for encoding and decoding shows an advantage in data denoising.
SP:1c4488d4b73efbed04b1045b425d7804b405ce1f
Self-Supervised Video Representation Learning with Constrained Spatiotemporal Jigsaw
1 INTRODUCTION . Self-supervised learning ( SSL ) has achieved tremendous successes recently for static images ( He et al. , 2020 ; Chen et al. , 2020 ) and shown to be able to outperform supervised learning on a wide range of downstream image understanding tasks . However , such successes have not yet been reproduced for videos . Since different SSL models differ mostly on the pretext tasks employed on the unlabeled training data , designing pretext tasks more suitable for videos is the current focus for self-supervised video representation learning ( Han et al. , 2020 ; Wang et al. , 2020 ) . Videos are spatiotemporal data and spatiotemporal analysis is the key to many video content understanding tasks . A good video representation learned from the self-supervised pretext task should therefore capture discriminative information jointly along both spatial and temporal dimensions . It is thus somewhat counter-intuitive to note that most existing SSL pretext tasks for videos do not explicitly require joint spatiotemporal video understanding . For example , some spatial pretext tasks have been borrowed from images without any modification ( Jing et al. , 2018 ) , ignoring the temporal dimension . On the other hand , many recent video-specific pretext tasks typically involve speed or temporal order prediction ( Lee et al. , 2017 ; Wei et al. , 2018 ; Benaim et al. , 2020 ; Wang et al. , 2020 ) , i.e. , operating predominately along the temporal axis . A natural choice for a spatiotemporal pretext task is to solve 3D jigsaw puzzles , whose 2D counterpart has been successfully used for images ( Noroozi & Favaro , 2016 ) . Indeed , solving 3D puzzles requires the learned model to understand spatiotemporal continuity , a key step towards video content understanding . However , directly solving a 3D puzzle turns out to be intractable : a puzzle of 3×3×3 pieces ( the same size as a Rubik ’ s cube ) can have 27 ! possible permutations . Video volume even in a short clip is much larger than that . Nevertheless , the latest neural sorting models ( Paumard et al. , 2020 ; Du et al. , 2020 ) can only handle permutations a few orders of magnitude less , so offer no solution . This is hardly surprising because such a task is daunting even for humans : Most people would struggle with a standard Rubik ’ s cube , let alone a much larger one . In this paper , we propose a novel Constrained Spatiotemporal Jigsaw ( CSJ ) pretext task for selfsupervised video representation learning . The key idea is to form 3D jigsaw puzzles in a constrained manner so that it becomes solvable . This is achieved by factorizing the permutations ( shuffling ) into the three spatiotemporal dimensions and then applying them sequentially . This ensures that for a given video clip , large continuous spatiotemporal cuboids exist after the constrained shuffling to provide sufficient cues for the model to reason about spatiotemporal continuity ( see Fig . 1 ( b ) ( c ) ) . Such large continuous cuboids are also vital for human understanding of video as revealed in neuroscience and visual studies ( Stringer et al. , 2006 ; Chen et al. , 2019 ) . Even with the constrained puzzles , solving them directly could still be extremely hard . Consequently , instead of directly solving the puzzles ( i.e. , recovering the permutation matrix so that each piece can be put back ) , four surrogate tasks are carefully designed . They are more solvable but meanwhile still ensure that the learned representation is sensitive to spatiotemporal continuity at both the local and global levels . Concretely , given a video clip shuffled with our constrained permutations , we make sure that the top-2 largest continuous cuboids ( LCCs ) dominate the clip volume . The level of continuity in the shuffle clip as a whole is thus determined mainly by the volumes of these LCCs , and whether they are at the right order ( see Fig . 1 ( d ) ( e ) ) both spatially and temporally . Our surrogate tasks are thus designed to locate these LCCs and predict their order so that the model learned with these tasks can be sensitive to spatiotemporal continuity both locally and globally . Our main contributions are three-fold : ( 1 ) We introduce a new pretext task for self-supervised video representation learning called Constrained Spatiotemporal Jigsaw ( CSJ ) . To our best knowledge , this is the first work on self-supervised video representation learning that leverages spatiotemporal jigsaw understanding . ( 2 ) We propose a novel constrained shuffling method to construct easy 3D jigsaws containing large LCCs . Four surrogate tasks are then formulated in place of the original jigsaw solving tasks . They are much more solvable yet remain effective in learning spatiotemporal discriminative representations . ( 3 ) Extensive experiments show that our approach achieves state-ofthe-art on two downstream tasks across various benchmarks . 2 RELATED WORK . Self-supervised Learning with Pretext Tasks Self-supervised learning ( SSL ) typically employs a pretext task to generate pseudo-labels for unlabeled data via some forms of data transformation . According to the transformations used by the pretext task , existing SSL methods for video presentation learning can be divided into three categories : ( 1 ) Spatial-Only Transformations : Derived from the original image domain ( Gidaris et al. , 2018 ) , Jing et al . ( 2018 ) leveraged the spatial-only transformations for self-supervised video presentation learning . ( 2 ) Temporal-Only Transformations : Misra et al . ( 2016 ) ; Fernando et al . ( 2017 ) ; Lee et al . ( 2017 ) ; Wei et al . ( 2018 ) obtained shuffled video frames with the temporal-only transformations and then distinguished whether the shuffled frames are in chronological order . Xu et al . ( 2019 ) chose to shuffle video clips instead of frames . Benaim et al . ( 2020 ) ; Yao et al . ( 2020 ) ; Jenni et al . ( 2020 ) exploited the speed transformation via determining whether one video clip is accelerated . ( 3 ) Spatiotemporal Transformations : There are only a few recent approaches ( Ahsan et al. , 2019 ; Kim et al. , 2019 ) that leveraged both spatial and temporal transformations by permuting 3D spatiotemporal cuboids . However , due to the aforementioned intractability of solving the spatiotemporal jigsaw puzzles , they only leveraged either temporal or spatial permutations as training signals , i.e. , they exploited the two domains independently . Therefore , no true spatiotemporal permutations have been considered in Ahsan et al . ( 2019 ) ; Kim et al . ( 2019 ) . In contrast , given that both spatial appearances and temporal relations are important cues for video representation learning , the focus of this work is on investigating how to exploit the spatial and temporal continuity jointly for self-supervised video presentation learning . To that end , our Constrained Spatiotemporal Jigsaw ( CSJ ) presents the first spatiotemporal continuity based pretext task for video SSL , thanks to a novel constrained 3D jigsaw and four surrogate tasks to reason about the continuity in the 3D jigsaw puzzles without solving them directly . Self-supervised Learning with Contrastive Learning Contrastive learning is another selfsupervised learning approach that has become increasingly popular in the image domain ( Misra & Maaten , 2020 ; He et al. , 2020 ; Chen et al. , 2020 ) . Recently , it has been incorporated into video SSL as well . Contrastive learning and transformation based pretext tasks are orthogonal to each other and often combined in that different transformed versions of a data sample form the positive set used in contrastive learning . In El-Nouby et al . ( 2019 ) ; Knights et al . ( 2020 ) ; Qian et al . ( 2020 ) ; Wang et al . ( 2020 ) ; Yang et al . ( 2020 ) , the positive/negative samples were generated based on temporal transformations only . In contrast , some recent works ( Han et al. , 2019 ; 2020 ; Zhuang et al. , 2020 ) leveraged features from the future frame embeddings or with the memory bank ( Wu et al. , 2018 ) . They modeled spatiotemporal representations using only contrastive learning without transformations . Contrastive learning is also exploited in one of our surrogate pretext tasks . Different from existing works , we explore the spatiotemporal transformations in the form of CSJ and employ contrastive learning to distinguish different levels of spatiotemporal continuity in shuffled jigsaws . This enables us to learn more discriminative spatiotemporal representations . 3 CONSTRAINED SPATIOTEMPORAL JIGSAW . 3.1 PROBLEM DEFINITION . The main goal of self-supervised video representation learning is to learn a video feature representation function f ( · ) without using any human annotations . A general approach to achieving this goal is to generate a supervisory signal y from an unlabeled video clip x and construct a pretext task P to predict y from f ( x ) . The process of solving the pretext task P encourages f ( · ) to learn discriminative spatiotemporal representations . The pretext task P is constructed typically by applying to a video clip a transformation function t ( · ; θ ) parameterized by θ and then automatically deriving y from θ , e.g. , y can be the type of the transformation . Based on this premise , P is defined as the prediction of y using the feature map of the transformed video clip f ( x̃ ) , i.e. , P : f ( x̃ ) → y , where x̃ = t ( x ; θ ) . For example , in Lee et al . ( 2017 ) , t ( · ; θ ) denotes a temporal transformation that permutes the four frames of video clip x in a temporal order θ , x̃ = t ( x ; θ ) is the shuffled clip , and the pseudo-label y is defined as the permutation order θ ( e.g. , 1324 , 4312 , etc. ) . The pretext task P is then a classification problem of 24 categories because there are 4 ! = 24 possible orders . 3.2 CONSTRAINED PERMUTATIONS . Solving spatiotemporal video jigsaw puzzles seems to be an ideal pretext task for learning discriminative representation as it requires an understanding of spatiotemporal continuity . After shuffling the pixels in a video clip using a 3D permutation matrix , the pretext task is to recover the permutation matrix . However , as explained earlier , this task is intractable given even moderate video clip sizes . Our solution is to introduce constraints on the permutations . As a result , a new pretext task PCSJ based on Constrained Spatiotemporal Jigsaw ( see Fig . 2 ( a ) ) is formulated , which is much easier to solve than a random/unconstrained jigsaw . Specifically , our goal is to introduce constraints to the permutations so that the resultant shuffled video clip is guaranteed to have large continuous cuboids ( see Fig . 2 ( a ) ) . Similar to humans ( Stringer et al. , 2006 ) , having large continuous cuboids is key for a model to understand a 3D jigsaw and therefore to have any chance to solve it . Formally , the volume of a shuffled video clip x̃ are denoted as { T , H , W } , measuring its sizes along the temporal , height , and width dimensions , respectively . A cuboid is defined as a crop of x̃ : c = x̃t1 : t2 , h1 : h2 , w1 : w2 , where t1 , t2 ∈ { 1 , 2 , . . . , T } , h1 , h2 ∈ { 1 , 2 , . . . , H } , w1 , w2 ∈ { 1 , 2 , . . . , W } . If all the jigsaw pieces ( smallest video clip unit , e.g . a pixel or a 3D pixel block ) in c keep the same relative order as they were in x ( before being shuffled ) , we call the cuboid c as a continuous cuboid ccont . The cuboid ’ s volume equals ( t2 − t1 ) × ( h2 − h1 ) × ( w2 − w1 ) , and the largest continuous cuboid ( LCC ) ccontmax is the ccont with the largest volume . We introduce two permutation strategies to ensure that the volumes of LCCs are large in relation to the whole video clip volume after our shuffling transformation t ( · ; θCSJ ) . First , instead of shuffling x in three spatiotemporal dimensions simultaneously , t ( · ; θCSJ ) factorizes the permutations into the three spatiotemporal dimensions and then utilizes them sequentially to generate shuffled clips , e.g. , in the order of T , W , H and only once . Note that the volume of the generated x̃ stays the same with different permutation orders ( e.g. , TWH and HTW ) . Second , we shuffle a group of jigsaw pieces together instead of each piece individually along each dimension . Taking spatial shuffling as an example , if there are 8 pieces per frame ( along each of the two spatial dimensions ) , θCSJ could be represented as the permutation from { 12345678 } to { 84567123 } . The longest and the secondlongest index ranges are : [ 2 , 5 ] for coordinates { 4567 } , and [ 6 , 8 ] for coordinates { 123 } . With these two permutation strategies , not only do we have large LCCs , but also they are guaranteed to have clearly separable boundaries ( see Fig . 2 ( b ) ) with surrounding pieces due to the factorized and grouped permutation design . This means that they are easily detectable .
In this paper, the authors extend the self-supervised 2D jigsaw puzzle solving idea to 3D for self-supervised video representation learning. To make the 3D jigsaw puzzle problem tractable, they propose a two-fold idea. First, they constrain the 3D jigsaw puzzle solution space by factorizing the permutations into time, x, and y dimensions and by grouping pieces. Second, since the constrained 3D jigsaw is still intractable, they propose four surrogate tasks of the 3D jigsaw: 1) LLCD (detecting largest continuous cuboid), 2) CSPC (3D permutation pattern classification), 3) CLSC (contrastive learning over permuted clips), 4) CCMR (measuring the global continuity of the permuted clips)
SP:89dc84f203effa2b434cdf323ff251043336754e
Self-Supervised Video Representation Learning with Constrained Spatiotemporal Jigsaw
1 INTRODUCTION . Self-supervised learning ( SSL ) has achieved tremendous successes recently for static images ( He et al. , 2020 ; Chen et al. , 2020 ) and shown to be able to outperform supervised learning on a wide range of downstream image understanding tasks . However , such successes have not yet been reproduced for videos . Since different SSL models differ mostly on the pretext tasks employed on the unlabeled training data , designing pretext tasks more suitable for videos is the current focus for self-supervised video representation learning ( Han et al. , 2020 ; Wang et al. , 2020 ) . Videos are spatiotemporal data and spatiotemporal analysis is the key to many video content understanding tasks . A good video representation learned from the self-supervised pretext task should therefore capture discriminative information jointly along both spatial and temporal dimensions . It is thus somewhat counter-intuitive to note that most existing SSL pretext tasks for videos do not explicitly require joint spatiotemporal video understanding . For example , some spatial pretext tasks have been borrowed from images without any modification ( Jing et al. , 2018 ) , ignoring the temporal dimension . On the other hand , many recent video-specific pretext tasks typically involve speed or temporal order prediction ( Lee et al. , 2017 ; Wei et al. , 2018 ; Benaim et al. , 2020 ; Wang et al. , 2020 ) , i.e. , operating predominately along the temporal axis . A natural choice for a spatiotemporal pretext task is to solve 3D jigsaw puzzles , whose 2D counterpart has been successfully used for images ( Noroozi & Favaro , 2016 ) . Indeed , solving 3D puzzles requires the learned model to understand spatiotemporal continuity , a key step towards video content understanding . However , directly solving a 3D puzzle turns out to be intractable : a puzzle of 3×3×3 pieces ( the same size as a Rubik ’ s cube ) can have 27 ! possible permutations . Video volume even in a short clip is much larger than that . Nevertheless , the latest neural sorting models ( Paumard et al. , 2020 ; Du et al. , 2020 ) can only handle permutations a few orders of magnitude less , so offer no solution . This is hardly surprising because such a task is daunting even for humans : Most people would struggle with a standard Rubik ’ s cube , let alone a much larger one . In this paper , we propose a novel Constrained Spatiotemporal Jigsaw ( CSJ ) pretext task for selfsupervised video representation learning . The key idea is to form 3D jigsaw puzzles in a constrained manner so that it becomes solvable . This is achieved by factorizing the permutations ( shuffling ) into the three spatiotemporal dimensions and then applying them sequentially . This ensures that for a given video clip , large continuous spatiotemporal cuboids exist after the constrained shuffling to provide sufficient cues for the model to reason about spatiotemporal continuity ( see Fig . 1 ( b ) ( c ) ) . Such large continuous cuboids are also vital for human understanding of video as revealed in neuroscience and visual studies ( Stringer et al. , 2006 ; Chen et al. , 2019 ) . Even with the constrained puzzles , solving them directly could still be extremely hard . Consequently , instead of directly solving the puzzles ( i.e. , recovering the permutation matrix so that each piece can be put back ) , four surrogate tasks are carefully designed . They are more solvable but meanwhile still ensure that the learned representation is sensitive to spatiotemporal continuity at both the local and global levels . Concretely , given a video clip shuffled with our constrained permutations , we make sure that the top-2 largest continuous cuboids ( LCCs ) dominate the clip volume . The level of continuity in the shuffle clip as a whole is thus determined mainly by the volumes of these LCCs , and whether they are at the right order ( see Fig . 1 ( d ) ( e ) ) both spatially and temporally . Our surrogate tasks are thus designed to locate these LCCs and predict their order so that the model learned with these tasks can be sensitive to spatiotemporal continuity both locally and globally . Our main contributions are three-fold : ( 1 ) We introduce a new pretext task for self-supervised video representation learning called Constrained Spatiotemporal Jigsaw ( CSJ ) . To our best knowledge , this is the first work on self-supervised video representation learning that leverages spatiotemporal jigsaw understanding . ( 2 ) We propose a novel constrained shuffling method to construct easy 3D jigsaws containing large LCCs . Four surrogate tasks are then formulated in place of the original jigsaw solving tasks . They are much more solvable yet remain effective in learning spatiotemporal discriminative representations . ( 3 ) Extensive experiments show that our approach achieves state-ofthe-art on two downstream tasks across various benchmarks . 2 RELATED WORK . Self-supervised Learning with Pretext Tasks Self-supervised learning ( SSL ) typically employs a pretext task to generate pseudo-labels for unlabeled data via some forms of data transformation . According to the transformations used by the pretext task , existing SSL methods for video presentation learning can be divided into three categories : ( 1 ) Spatial-Only Transformations : Derived from the original image domain ( Gidaris et al. , 2018 ) , Jing et al . ( 2018 ) leveraged the spatial-only transformations for self-supervised video presentation learning . ( 2 ) Temporal-Only Transformations : Misra et al . ( 2016 ) ; Fernando et al . ( 2017 ) ; Lee et al . ( 2017 ) ; Wei et al . ( 2018 ) obtained shuffled video frames with the temporal-only transformations and then distinguished whether the shuffled frames are in chronological order . Xu et al . ( 2019 ) chose to shuffle video clips instead of frames . Benaim et al . ( 2020 ) ; Yao et al . ( 2020 ) ; Jenni et al . ( 2020 ) exploited the speed transformation via determining whether one video clip is accelerated . ( 3 ) Spatiotemporal Transformations : There are only a few recent approaches ( Ahsan et al. , 2019 ; Kim et al. , 2019 ) that leveraged both spatial and temporal transformations by permuting 3D spatiotemporal cuboids . However , due to the aforementioned intractability of solving the spatiotemporal jigsaw puzzles , they only leveraged either temporal or spatial permutations as training signals , i.e. , they exploited the two domains independently . Therefore , no true spatiotemporal permutations have been considered in Ahsan et al . ( 2019 ) ; Kim et al . ( 2019 ) . In contrast , given that both spatial appearances and temporal relations are important cues for video representation learning , the focus of this work is on investigating how to exploit the spatial and temporal continuity jointly for self-supervised video presentation learning . To that end , our Constrained Spatiotemporal Jigsaw ( CSJ ) presents the first spatiotemporal continuity based pretext task for video SSL , thanks to a novel constrained 3D jigsaw and four surrogate tasks to reason about the continuity in the 3D jigsaw puzzles without solving them directly . Self-supervised Learning with Contrastive Learning Contrastive learning is another selfsupervised learning approach that has become increasingly popular in the image domain ( Misra & Maaten , 2020 ; He et al. , 2020 ; Chen et al. , 2020 ) . Recently , it has been incorporated into video SSL as well . Contrastive learning and transformation based pretext tasks are orthogonal to each other and often combined in that different transformed versions of a data sample form the positive set used in contrastive learning . In El-Nouby et al . ( 2019 ) ; Knights et al . ( 2020 ) ; Qian et al . ( 2020 ) ; Wang et al . ( 2020 ) ; Yang et al . ( 2020 ) , the positive/negative samples were generated based on temporal transformations only . In contrast , some recent works ( Han et al. , 2019 ; 2020 ; Zhuang et al. , 2020 ) leveraged features from the future frame embeddings or with the memory bank ( Wu et al. , 2018 ) . They modeled spatiotemporal representations using only contrastive learning without transformations . Contrastive learning is also exploited in one of our surrogate pretext tasks . Different from existing works , we explore the spatiotemporal transformations in the form of CSJ and employ contrastive learning to distinguish different levels of spatiotemporal continuity in shuffled jigsaws . This enables us to learn more discriminative spatiotemporal representations . 3 CONSTRAINED SPATIOTEMPORAL JIGSAW . 3.1 PROBLEM DEFINITION . The main goal of self-supervised video representation learning is to learn a video feature representation function f ( · ) without using any human annotations . A general approach to achieving this goal is to generate a supervisory signal y from an unlabeled video clip x and construct a pretext task P to predict y from f ( x ) . The process of solving the pretext task P encourages f ( · ) to learn discriminative spatiotemporal representations . The pretext task P is constructed typically by applying to a video clip a transformation function t ( · ; θ ) parameterized by θ and then automatically deriving y from θ , e.g. , y can be the type of the transformation . Based on this premise , P is defined as the prediction of y using the feature map of the transformed video clip f ( x̃ ) , i.e. , P : f ( x̃ ) → y , where x̃ = t ( x ; θ ) . For example , in Lee et al . ( 2017 ) , t ( · ; θ ) denotes a temporal transformation that permutes the four frames of video clip x in a temporal order θ , x̃ = t ( x ; θ ) is the shuffled clip , and the pseudo-label y is defined as the permutation order θ ( e.g. , 1324 , 4312 , etc. ) . The pretext task P is then a classification problem of 24 categories because there are 4 ! = 24 possible orders . 3.2 CONSTRAINED PERMUTATIONS . Solving spatiotemporal video jigsaw puzzles seems to be an ideal pretext task for learning discriminative representation as it requires an understanding of spatiotemporal continuity . After shuffling the pixels in a video clip using a 3D permutation matrix , the pretext task is to recover the permutation matrix . However , as explained earlier , this task is intractable given even moderate video clip sizes . Our solution is to introduce constraints on the permutations . As a result , a new pretext task PCSJ based on Constrained Spatiotemporal Jigsaw ( see Fig . 2 ( a ) ) is formulated , which is much easier to solve than a random/unconstrained jigsaw . Specifically , our goal is to introduce constraints to the permutations so that the resultant shuffled video clip is guaranteed to have large continuous cuboids ( see Fig . 2 ( a ) ) . Similar to humans ( Stringer et al. , 2006 ) , having large continuous cuboids is key for a model to understand a 3D jigsaw and therefore to have any chance to solve it . Formally , the volume of a shuffled video clip x̃ are denoted as { T , H , W } , measuring its sizes along the temporal , height , and width dimensions , respectively . A cuboid is defined as a crop of x̃ : c = x̃t1 : t2 , h1 : h2 , w1 : w2 , where t1 , t2 ∈ { 1 , 2 , . . . , T } , h1 , h2 ∈ { 1 , 2 , . . . , H } , w1 , w2 ∈ { 1 , 2 , . . . , W } . If all the jigsaw pieces ( smallest video clip unit , e.g . a pixel or a 3D pixel block ) in c keep the same relative order as they were in x ( before being shuffled ) , we call the cuboid c as a continuous cuboid ccont . The cuboid ’ s volume equals ( t2 − t1 ) × ( h2 − h1 ) × ( w2 − w1 ) , and the largest continuous cuboid ( LCC ) ccontmax is the ccont with the largest volume . We introduce two permutation strategies to ensure that the volumes of LCCs are large in relation to the whole video clip volume after our shuffling transformation t ( · ; θCSJ ) . First , instead of shuffling x in three spatiotemporal dimensions simultaneously , t ( · ; θCSJ ) factorizes the permutations into the three spatiotemporal dimensions and then utilizes them sequentially to generate shuffled clips , e.g. , in the order of T , W , H and only once . Note that the volume of the generated x̃ stays the same with different permutation orders ( e.g. , TWH and HTW ) . Second , we shuffle a group of jigsaw pieces together instead of each piece individually along each dimension . Taking spatial shuffling as an example , if there are 8 pieces per frame ( along each of the two spatial dimensions ) , θCSJ could be represented as the permutation from { 12345678 } to { 84567123 } . The longest and the secondlongest index ranges are : [ 2 , 5 ] for coordinates { 4567 } , and [ 6 , 8 ] for coordinates { 123 } . With these two permutation strategies , not only do we have large LCCs , but also they are guaranteed to have clearly separable boundaries ( see Fig . 2 ( b ) ) with surrounding pieces due to the factorized and grouped permutation design . This means that they are easily detectable .
The paper presents a novel pretext task for self-supervised video representation learning (SSVRL). The authors design several surrogate tasks for tackling intentionally constructed constrained spatiotemporal jigsaw puzzles. The learned representations during training to solve the surrogate tasks can be transferred to other video tasks. The proposed method shows superior performances than state-of-the-art SSVRL approaches on action recognition and video retrieval benchmarks.
SP:89dc84f203effa2b434cdf323ff251043336754e
Efficient Graph Neural Architecture Search
Recently , graph neural networks ( GNN ) have been demonstrated effective in various graph-based tasks . To obtain state-of-the-art ( SOTA ) data-specific GNN architectures , researchers turn to the neural architecture search ( NAS ) methods . However , it remains to be a challenging problem to conduct efficient architecture search for GNN . In this work , we present a novel framework for Efficient GrAph Neural architecture search ( EGAN ) . By designing a novel and expressive search space , an efficient one-shot NAS method based on stochastic relaxation and natural gradient is proposed . Further , to enable architecture search in large graphs , a transfer learning paradigm is designed . Extensive experiments , including node-level and graph-level tasks , are conducted . The results show that the proposed EGAN can obtain SOTA data-specific architectures , and reduce the search cost by two orders of magnitude compared to existing NAS baselines . 1 INTRODUCTION . Recent years have witnessed the success of graph neural networks ( GNN ) ( Gori et al. , 2005 ; Battaglia et al. , 2018 ) in various graph-based tasks , e.g. , recommendation ( Ying et al. , 2018a ) , chemistry ( Gilmer et al. , 2017 ) , circuit design ( Zhang et al. , 2019 ) , subgraph counting ( Liu et al. , 2020 ) , and SAT generation ( You et al. , 2019 ) . To adapt to different graph-based tasks , various GNN models , e.g. , GCN ( Kipf & Welling , 2016 ) , GAT ( Veličković et al. , 2018 ) , or GIN ( Xu et al. , 2019 ) , have been designed in the past five years . Most existing GNN models follow a neighborhood aggregation ( or message passing ) schema ( Gilmer et al. , 2017 ) , as shown in the left part of Figure 1 , which is that the representation of a node in a graph is learned by iteratively aggregating the features of its neighbors . Despite the broad applications of GNN models , researchers have to take efforts to design proper GNN architectures given different tasks by imposing different relational inductive biases ( Battaglia et al. , 2018 ) . As pointed out by Battaglia et al . ( 2018 ) , the GNN architectures can support one form of combinatorial generalization given different tasks , i.e. , graphs . Then a natural and interesting question can be asked : Can we automatically design state-of-the-art ( SOTA ) GNN architectures for graph-based tasks ? A straightforward solution is to adopt the neural architecture search ( NAS ) approaches , which have shown promising results in automatically designing architectures for convolutional neural networks ( CNN ) ( Zoph & Le , 2017 ; Pham et al. , 2018 ; Liu et al. , 2019a ; Tan & Le , 2019 ; You et al. , 2020a ) . However , it is nontrivial to adopt NAS to GNN . The first challenge is to define the search space . One can design a dummy search space to include as many as possible the related parameters , e.g. , aggregation functions , number of layers , activation functions , etc. , on top of the message passing framework ( Eq . ( 1 ) ) , however , it leads to quite a large discrete space , for example , 315,000 possible GNN architectures are generated by including just 12 types of model parameters in You et al . ( 2020b ) ) , which is challenging for any search algorithm . The second challenge is to design an effective and efficient search algorithm . In the literature , reinforcement learning ( RL ) based and evolutionary based algorithms have been explored for GNN architecture search ( Gao et al. , 2020 ; Zhou et al. , 2019 ; Lai et al. , 2020 ; Nunes & Pappa , 2020 ) . However , they are inherently computationally expensive due to the stand-alone training manner . In the NAS literature , by adopting the weight sharing strategy , one-shot NAS methods are orders of magnitude more efficient than RL based ones ( Pham et al. , 2018 ; Liu et al. , 2019a ; Xie et al. , 2019 ; Guo et al. , 2019 ) . However , the one-shot methods can not be directly applied to the aforementioned dummy search space , since it remains unknown how to search for some model parameters like number of layers and activation functions by the weight sharing strategy . Therefore , it is a challenging problem to conduct effective and efficient architecture search for GNN . In this work , we propose a novel framework , called EGAN ( Efficient GrAph Neural architecture search ) , to automatically design SOTA GNN architectures . Motivated by two well-established works ( Xu et al. , 2019 ; Garg et al. , 2020 ) that the expressive capabilities of GNN models highly rely on the properties of the aggregation functions , a novel search space consisting of node and layer aggregators is designed , which can emulate many popular GNN models . Then by representing the search space as a directed acyclic graph ( DAG ) ( Figure 1 ( c ) ) , we design a one-shot framework by using the stochastic relaxation and natural gradient method , which can optimize the architecture selection and model parameters in a differentiable manner . To enable architecture search in large graphs , we further design a transfer learning paradigm , which firstly constructs a proxy graph out of the large graph by keeping the properties , and then searches for GNN architectures in the proxy graph , finally transfers the searched architecture to the large graph . To demonstrate the effectiveness and efficiency of the proposed framework , we apply EGAN to various tasks , from node-level to graph-level ones . The experimental results on ten different datasets show that EGAN can obtain SOTA data-specific architectures for different tasks , and at the same time , reduce the search cost by two orders of magnitude . Moreover , the transfer learning paradigm , to the best of our knowledge , is the first framework to enable architecture search in large graphs . Notations . Let G = ( V , E ) be a simple graph with node features X ∈ RN×d , where V and E represent the node and edge sets , respectively . N represents the number of nodes and d is the dimension of node features . We use N ( v ) to represent the first-order neighbors of a node v in G , i.e. , N ( v ) = { u ∈ V| ( v , u ) ∈ E } . In the literature , we also create a new set Ñ ( v ) is the neighbor set including itself , i.e. , Ñ ( v ) = { v } ∪ { u ∈ V| ( v , u ) ∈ E } . 2 RELATED WORKS . GNN was first proposed in ( Gori et al. , 2005 ) and in the past five years different GNN models ( Kipf & Welling , 2016 ; Hamilton et al. , 2017 ; Veličković et al. , 2018 ; Gao et al. , 2018 ; Battaglia et al. , 2018 ; Xu et al. , 2019 ; 2018 ; Liu et al. , 2019b ; Abu-El-Haija et al. , 2019 ; Wu et al. , 2019 ; Zeng et al. , 2020 ; Zhao & Akoglu , 2020 ; Rong et al. , 2020 ) have been designed , and they rely on a neighborhood aggregation ( or message passing ) schema ( Gilmer et al. , 2017 ) , which learns the representation of a given node by iteratively aggregating the hidden features ( “ message ” ) of its neighbors . Besides , in Xu et al . ( 2018 ) ; Chen et al . ( 2020 ) , the design of residual networks ( He et al. , 2016a ; b ) are incorporated into existing message passing GNN models . Battaglia et al . ( 2018 ) pointed out that the GNN architectures can provide one form of combinatorial generalization for graph-based tasks , and Xu et al . ( 2019 ) ; Garg et al . ( 2020 ) further show that the expressive capability of existing GNN models is upper bounded by the well-known Weisfeiler-Lehman ( WL ) test . It will be an interesting question to explore GNN architectures with better combinatorial generalization , thus neural architecture search ( NAS ) can be a worthwhile approach for this consideration . NAS ( Baker et al. , 2017 ; Zoph & Le , 2017 ; Elsken et al. , 2018 ) aims to automatically find SOTA architectures beyond human-designed ones , which have shown promising results in architecture design for CNN and Recurrent Neural Network ( RNN ) ( Liu et al. , 2019a ; Zoph et al. , 2018 ; Tan & Le , 2019 ) . Existing NAS approaches can be roughly categorized into two groups according to search methods ( Bender et al. , 2018 ) : i.e . the stand-alone and one-shot ones . The former ones tend to obtain the SOTA architecture from training thousands of architectures from scratch , including reinforcement learning ( RL ) based ( Baker et al. , 2017 ; Zoph & Le , 2017 ) and evolutionary-based ones ( Real et al. , 2019 ) , while the latter ones tend to train a supernet containing thousands of architectures based on the weight sharing strategy , and then extract a submodel as the SOTA architecture at the end of the search phase ( Pham et al. , 2018 ; Bender et al. , 2018 ; Liu et al. , 2019a ; Xie et al. , 2019 ) . The difference of training paradigms leads to that one-shot NAS methods tend to be orders of magnitude more efficient than the RL based ones . Recently , there are several works on architecture search for GNN , e.g. , RL based ones ( Gao et al. , 2020 ; Zhou et al. , 2019 ; Lai et al. , 2020 ) , and evolutionary-based ones ( Nunes & Pappa , 2020 ; Jiang & Balaprakash , 2020 ) , thus all existing works are computationally expensive . Franceschi et al . ( 2019 ) proposes to jointly learn the edge probabilities and the parameters of GCN given a graph , thus orthogonal to our work . Besides , Peng et al . ( 2020 ) proposes a one-shot NAS method for GCN architectures in the human action recognition task . In Li et al . ( 2020 ) , a sequential greedy search method based on DARTS ( Liu et al. , 2019a ) is proposed to search for GCN architectures , however , the tasks are more focused on vision related tasks , with only one dataset in conventional node classification task . In this work , to the best of our knowledge , for conventional node-level and graph-level classification tasks , we are the first to design a one-shot NAS method for GNN architecture search , which is thus , in nature , more efficient than existing NAS methods for GNN . In Appendix A.3 , we give more detailed discussions about the comparisons between EGAN and more recent GNN models . 3 THE PROPOSED FRAMEWORK . 3.1 THE DESIGN OF SEARCH SPACE . As introduced in Section 2 , most existing GNN architectures rely on a message passing framework ( Gilmer et al. , 2017 ) , which constitutes the backbone of the designed search space in this work . To be specific , a K-layer GNN can be written as follows : the l-th layer ( l = 1 , · · · , K ) updates hv for each node v by aggregating its neighborhood as h ( l ) v = σ ( W ( l ) · Φn ( { h ( l−1 ) u , ∀u ∈ Ñ ( v ) } ) ) , ( 1 ) where h ( l ) v ∈ Rdl represents the hidden features of a node v learned by the l-th layer , and dl is the corresponding dimension . W ( l ) is a trainable weight matrix shared by all nodes in the graph , and σ is a non-linear activation function , e.g. , a sigmoid or ReLU . Φn is the key component , i.e. , a pre-defined aggregation function , which varies across different GNN models . Thus a dummy search space is to include as many as possible related parameters in Eq . ( 1 ) . However , it leads to a very large search space , making the search process very expensive . In this work , motivated by two well-established works ( Xu et al. , 2019 ; Garg et al. , 2020 ) , which show that the expressive capabilities of GNN models highly rely on the properties of aggregation functions , we propose to search for different aggregation functions by simplifying the dummy search space . For other parameters , we do simple tuning in the re-training stage , which is also a standard practice in existing NAS methods ( Liu et al. , 2019a ; Xie et al. , 2019 ) . Then the first component of the proposed search space is the node aggregators , which consists of existing GNN models . To improve the expressive capability , we add the other component , layer aggregators , to combine the outputs of node aggregator in all layers , which have been demonstrated effective in JK-Network ( Xu et al. , 2018 ) . Then we introduce the proposed search space , as shown in Figure 1 ( c ) , in the following : • Node aggregators : We choose 12 node aggregators based on popular GNN models , and they are presented in Table 7 in Appendix A.1 . The node aggregator set is denoted by On . • Layer aggregators : We choose 3 layer aggregators as shown in Table 7 in Appendix A.1 . Besides , we have two more operations , IDENTITY and ZERO , related to skip-connections . Instead of requiring skip-connections between all intermediate layers and the final layer in JK-Network , in this work , we generalize this option by proposing to search for the existence of skip-connections between each intermediate layer and the last layer . To connect , we choose IDENTITY , and ZERO otherwise . The layer aggregator set is denoted by Ol and the skip operation set by Os . To further guarantee that K-hop neighborhood can always be accessed , we add one more constraint that the output of the node aggregator in the last layer should always be used as the input of the layer aggregator , thus for a K-layer GNN architecture , we need to search K− 1 IDENTITY or ZERO for the skip-connection options .
The paper proposes a framework for efficient architecture search for graphs. This is done by combining a differentiable DARTS-like architecture encoding with a transfer learning method, that searches on smaller graphs with similar properties, and then transfers to the target graphs. The experiments show that EGAN matches or exceeds both hand-designed and NAS-designed GNNs. Moreover, the method is very fast to run.
SP:02c82e31ddcff1990d5cb3f8ecbb44392cb02892
Efficient Graph Neural Architecture Search
Recently , graph neural networks ( GNN ) have been demonstrated effective in various graph-based tasks . To obtain state-of-the-art ( SOTA ) data-specific GNN architectures , researchers turn to the neural architecture search ( NAS ) methods . However , it remains to be a challenging problem to conduct efficient architecture search for GNN . In this work , we present a novel framework for Efficient GrAph Neural architecture search ( EGAN ) . By designing a novel and expressive search space , an efficient one-shot NAS method based on stochastic relaxation and natural gradient is proposed . Further , to enable architecture search in large graphs , a transfer learning paradigm is designed . Extensive experiments , including node-level and graph-level tasks , are conducted . The results show that the proposed EGAN can obtain SOTA data-specific architectures , and reduce the search cost by two orders of magnitude compared to existing NAS baselines . 1 INTRODUCTION . Recent years have witnessed the success of graph neural networks ( GNN ) ( Gori et al. , 2005 ; Battaglia et al. , 2018 ) in various graph-based tasks , e.g. , recommendation ( Ying et al. , 2018a ) , chemistry ( Gilmer et al. , 2017 ) , circuit design ( Zhang et al. , 2019 ) , subgraph counting ( Liu et al. , 2020 ) , and SAT generation ( You et al. , 2019 ) . To adapt to different graph-based tasks , various GNN models , e.g. , GCN ( Kipf & Welling , 2016 ) , GAT ( Veličković et al. , 2018 ) , or GIN ( Xu et al. , 2019 ) , have been designed in the past five years . Most existing GNN models follow a neighborhood aggregation ( or message passing ) schema ( Gilmer et al. , 2017 ) , as shown in the left part of Figure 1 , which is that the representation of a node in a graph is learned by iteratively aggregating the features of its neighbors . Despite the broad applications of GNN models , researchers have to take efforts to design proper GNN architectures given different tasks by imposing different relational inductive biases ( Battaglia et al. , 2018 ) . As pointed out by Battaglia et al . ( 2018 ) , the GNN architectures can support one form of combinatorial generalization given different tasks , i.e. , graphs . Then a natural and interesting question can be asked : Can we automatically design state-of-the-art ( SOTA ) GNN architectures for graph-based tasks ? A straightforward solution is to adopt the neural architecture search ( NAS ) approaches , which have shown promising results in automatically designing architectures for convolutional neural networks ( CNN ) ( Zoph & Le , 2017 ; Pham et al. , 2018 ; Liu et al. , 2019a ; Tan & Le , 2019 ; You et al. , 2020a ) . However , it is nontrivial to adopt NAS to GNN . The first challenge is to define the search space . One can design a dummy search space to include as many as possible the related parameters , e.g. , aggregation functions , number of layers , activation functions , etc. , on top of the message passing framework ( Eq . ( 1 ) ) , however , it leads to quite a large discrete space , for example , 315,000 possible GNN architectures are generated by including just 12 types of model parameters in You et al . ( 2020b ) ) , which is challenging for any search algorithm . The second challenge is to design an effective and efficient search algorithm . In the literature , reinforcement learning ( RL ) based and evolutionary based algorithms have been explored for GNN architecture search ( Gao et al. , 2020 ; Zhou et al. , 2019 ; Lai et al. , 2020 ; Nunes & Pappa , 2020 ) . However , they are inherently computationally expensive due to the stand-alone training manner . In the NAS literature , by adopting the weight sharing strategy , one-shot NAS methods are orders of magnitude more efficient than RL based ones ( Pham et al. , 2018 ; Liu et al. , 2019a ; Xie et al. , 2019 ; Guo et al. , 2019 ) . However , the one-shot methods can not be directly applied to the aforementioned dummy search space , since it remains unknown how to search for some model parameters like number of layers and activation functions by the weight sharing strategy . Therefore , it is a challenging problem to conduct effective and efficient architecture search for GNN . In this work , we propose a novel framework , called EGAN ( Efficient GrAph Neural architecture search ) , to automatically design SOTA GNN architectures . Motivated by two well-established works ( Xu et al. , 2019 ; Garg et al. , 2020 ) that the expressive capabilities of GNN models highly rely on the properties of the aggregation functions , a novel search space consisting of node and layer aggregators is designed , which can emulate many popular GNN models . Then by representing the search space as a directed acyclic graph ( DAG ) ( Figure 1 ( c ) ) , we design a one-shot framework by using the stochastic relaxation and natural gradient method , which can optimize the architecture selection and model parameters in a differentiable manner . To enable architecture search in large graphs , we further design a transfer learning paradigm , which firstly constructs a proxy graph out of the large graph by keeping the properties , and then searches for GNN architectures in the proxy graph , finally transfers the searched architecture to the large graph . To demonstrate the effectiveness and efficiency of the proposed framework , we apply EGAN to various tasks , from node-level to graph-level ones . The experimental results on ten different datasets show that EGAN can obtain SOTA data-specific architectures for different tasks , and at the same time , reduce the search cost by two orders of magnitude . Moreover , the transfer learning paradigm , to the best of our knowledge , is the first framework to enable architecture search in large graphs . Notations . Let G = ( V , E ) be a simple graph with node features X ∈ RN×d , where V and E represent the node and edge sets , respectively . N represents the number of nodes and d is the dimension of node features . We use N ( v ) to represent the first-order neighbors of a node v in G , i.e. , N ( v ) = { u ∈ V| ( v , u ) ∈ E } . In the literature , we also create a new set Ñ ( v ) is the neighbor set including itself , i.e. , Ñ ( v ) = { v } ∪ { u ∈ V| ( v , u ) ∈ E } . 2 RELATED WORKS . GNN was first proposed in ( Gori et al. , 2005 ) and in the past five years different GNN models ( Kipf & Welling , 2016 ; Hamilton et al. , 2017 ; Veličković et al. , 2018 ; Gao et al. , 2018 ; Battaglia et al. , 2018 ; Xu et al. , 2019 ; 2018 ; Liu et al. , 2019b ; Abu-El-Haija et al. , 2019 ; Wu et al. , 2019 ; Zeng et al. , 2020 ; Zhao & Akoglu , 2020 ; Rong et al. , 2020 ) have been designed , and they rely on a neighborhood aggregation ( or message passing ) schema ( Gilmer et al. , 2017 ) , which learns the representation of a given node by iteratively aggregating the hidden features ( “ message ” ) of its neighbors . Besides , in Xu et al . ( 2018 ) ; Chen et al . ( 2020 ) , the design of residual networks ( He et al. , 2016a ; b ) are incorporated into existing message passing GNN models . Battaglia et al . ( 2018 ) pointed out that the GNN architectures can provide one form of combinatorial generalization for graph-based tasks , and Xu et al . ( 2019 ) ; Garg et al . ( 2020 ) further show that the expressive capability of existing GNN models is upper bounded by the well-known Weisfeiler-Lehman ( WL ) test . It will be an interesting question to explore GNN architectures with better combinatorial generalization , thus neural architecture search ( NAS ) can be a worthwhile approach for this consideration . NAS ( Baker et al. , 2017 ; Zoph & Le , 2017 ; Elsken et al. , 2018 ) aims to automatically find SOTA architectures beyond human-designed ones , which have shown promising results in architecture design for CNN and Recurrent Neural Network ( RNN ) ( Liu et al. , 2019a ; Zoph et al. , 2018 ; Tan & Le , 2019 ) . Existing NAS approaches can be roughly categorized into two groups according to search methods ( Bender et al. , 2018 ) : i.e . the stand-alone and one-shot ones . The former ones tend to obtain the SOTA architecture from training thousands of architectures from scratch , including reinforcement learning ( RL ) based ( Baker et al. , 2017 ; Zoph & Le , 2017 ) and evolutionary-based ones ( Real et al. , 2019 ) , while the latter ones tend to train a supernet containing thousands of architectures based on the weight sharing strategy , and then extract a submodel as the SOTA architecture at the end of the search phase ( Pham et al. , 2018 ; Bender et al. , 2018 ; Liu et al. , 2019a ; Xie et al. , 2019 ) . The difference of training paradigms leads to that one-shot NAS methods tend to be orders of magnitude more efficient than the RL based ones . Recently , there are several works on architecture search for GNN , e.g. , RL based ones ( Gao et al. , 2020 ; Zhou et al. , 2019 ; Lai et al. , 2020 ) , and evolutionary-based ones ( Nunes & Pappa , 2020 ; Jiang & Balaprakash , 2020 ) , thus all existing works are computationally expensive . Franceschi et al . ( 2019 ) proposes to jointly learn the edge probabilities and the parameters of GCN given a graph , thus orthogonal to our work . Besides , Peng et al . ( 2020 ) proposes a one-shot NAS method for GCN architectures in the human action recognition task . In Li et al . ( 2020 ) , a sequential greedy search method based on DARTS ( Liu et al. , 2019a ) is proposed to search for GCN architectures , however , the tasks are more focused on vision related tasks , with only one dataset in conventional node classification task . In this work , to the best of our knowledge , for conventional node-level and graph-level classification tasks , we are the first to design a one-shot NAS method for GNN architecture search , which is thus , in nature , more efficient than existing NAS methods for GNN . In Appendix A.3 , we give more detailed discussions about the comparisons between EGAN and more recent GNN models . 3 THE PROPOSED FRAMEWORK . 3.1 THE DESIGN OF SEARCH SPACE . As introduced in Section 2 , most existing GNN architectures rely on a message passing framework ( Gilmer et al. , 2017 ) , which constitutes the backbone of the designed search space in this work . To be specific , a K-layer GNN can be written as follows : the l-th layer ( l = 1 , · · · , K ) updates hv for each node v by aggregating its neighborhood as h ( l ) v = σ ( W ( l ) · Φn ( { h ( l−1 ) u , ∀u ∈ Ñ ( v ) } ) ) , ( 1 ) where h ( l ) v ∈ Rdl represents the hidden features of a node v learned by the l-th layer , and dl is the corresponding dimension . W ( l ) is a trainable weight matrix shared by all nodes in the graph , and σ is a non-linear activation function , e.g. , a sigmoid or ReLU . Φn is the key component , i.e. , a pre-defined aggregation function , which varies across different GNN models . Thus a dummy search space is to include as many as possible related parameters in Eq . ( 1 ) . However , it leads to a very large search space , making the search process very expensive . In this work , motivated by two well-established works ( Xu et al. , 2019 ; Garg et al. , 2020 ) , which show that the expressive capabilities of GNN models highly rely on the properties of aggregation functions , we propose to search for different aggregation functions by simplifying the dummy search space . For other parameters , we do simple tuning in the re-training stage , which is also a standard practice in existing NAS methods ( Liu et al. , 2019a ; Xie et al. , 2019 ) . Then the first component of the proposed search space is the node aggregators , which consists of existing GNN models . To improve the expressive capability , we add the other component , layer aggregators , to combine the outputs of node aggregator in all layers , which have been demonstrated effective in JK-Network ( Xu et al. , 2018 ) . Then we introduce the proposed search space , as shown in Figure 1 ( c ) , in the following : • Node aggregators : We choose 12 node aggregators based on popular GNN models , and they are presented in Table 7 in Appendix A.1 . The node aggregator set is denoted by On . • Layer aggregators : We choose 3 layer aggregators as shown in Table 7 in Appendix A.1 . Besides , we have two more operations , IDENTITY and ZERO , related to skip-connections . Instead of requiring skip-connections between all intermediate layers and the final layer in JK-Network , in this work , we generalize this option by proposing to search for the existence of skip-connections between each intermediate layer and the last layer . To connect , we choose IDENTITY , and ZERO otherwise . The layer aggregator set is denoted by Ol and the skip operation set by Os . To further guarantee that K-hop neighborhood can always be accessed , we add one more constraint that the output of the node aggregator in the last layer should always be used as the input of the layer aggregator , thus for a K-layer GNN architecture , we need to search K− 1 IDENTITY or ZERO for the skip-connection options .
This work proposes an efficient graph neural architecture search to address the problem of automatically designing GNN architecture for any graph-based task. Comparing with the existing NAS approaches for GNNs, the authors improves the search efficiency from the following three components: (1) a slim search space only consisting of the node aggregator, layer aggregator and skip connection; (2) a one-shot search algorithm, which is proposed in the previous NAS work; and (3) a transfer learning strategy, which searches architectures for large graphs via sampling proxy graphs. However, the current performance improvement over the human-designed models is marginal, which diminishes their research contribution.
SP:02c82e31ddcff1990d5cb3f8ecbb44392cb02892
Deep Ensembles with Hierarchical Diversity Pruning
1 INTRODUCTION . Deep ensembles with sufficient ensemble diversity hold potential of improving both accuracy and robustness of ensembles with their combined wisdom . The improvement can be measured by three criteria : ( i ) the average ensemble accuracy of the selected ensemble teams , ( ii ) the percentage of selected ensembles that exceed the highest accuracy of individual member models ; ( iii ) the lower bound ( worst case ) and the upper bound ( best case ) accuracy of the selected ensembles . The higher these three measures , the higher quality of the ensemble teams . Ensemble learning can be broadly classified into two categories : ( 1 ) learning the ensemble of diverse models via diversity optimized joint-training , coined as the ensemble training approach , such as boosting ( Schapire , 1999 ) ; and ( 2 ) learning to compose an ensemble of base models from a pool of existing pre-trained models through ensemble teaming based on ensemble diversity metrics ( Partridge & Krzanowski , 1997 ; Liu et al. , 2019 ; McHugh , 2012 ; Skalak , 1996 ) , coined as the ensemble consensus approach . This paper is focused on improving the state-of-the-art results in the second category . Related Work and Problem Statement . Ensemble diversity metrics are by design to capture the degree of negative correlation among the member models of an ensemble team ( Brown et al. , 2005 ; Liu et al. , 2019 ; Kuncheva & Whitaker , 2003 ) such that the high diversity indicates high negative correlation among member models of an ensemble . Three orthogonal and yet complimentary threads of efforts have been engaged in ensemble learning : ( 1 ) developing mechanisms to produce diverse base neural network models , ( 2 ) developing diversity metrics to select ensembles with high ensemble diversity from the candidate ensembles over the base model pool , and ( 3 ) developing consensus voting methods . The most popular consensus voting methods include the simple averaging , the weighted averaging , the majority voting , the plurality voting ( Ju et al. , 2017 ) , and the learn to rank ( Burges et al. , 2005 ) . For the base model selection , early efforts have been devoted to training diverse weak models to form a strong ensemble on a learning task , such as bagging ( Breiman , 1996 ) , boosting ( Schapire , 1999 ) , or different ways of selecting features , e.g. , random forests ( Tin Kam Ho , 1995 ) . Several recent studies also produce diverse base models by varying the training hyper-parameters , such as snapshot ensemble ( Huang et al. , 2017 ) , which utilizes the cyclic learning rates ( Smith , 2015 ; Wu et al. , 2019 ) to converge the single DNN model at different epochs to obtain the snapshots as the ensemble member models . Alternative method is to construct the pool of base models by using pre-trained models with different neural network backbones ( Wu et al. , 2020 ; Liu et al. , 2019 ; Wei et al. , 2020 ; Chow et al. , 2019a ) . The research efforts on diversity metrics have proposed both pairwise and non-pairwise ensemble diversity measures ( Fort et al. , 2019 ; Wu et al. , 2020 ; Liu et al. , 2019 ) , among which the three representative pairwise metrics are Cohen ’ s Kappa ( CK ) ( McHugh , 2012 ) , Q Statistics ( QS ) ( Yule , 1900 ) , Binary Disagreement ( BD ) ( Skalak , 1996 ) , and the three representative non-pairwise diversity metrics are Fleiss ’ Kappa ( FK ) ( Fleiss et al. , 2013 ) , Kohavi-Wolpert Variance ( KW ) ( Kohavi & Wolpert , 1996 ; Kuncheva & Whitaker , 2003 ) and Generalized Diversity ( GD ) ( Partridge & Krzanowski , 1997 ) . These diversity metrics are widely used in several recent studies ( Fort et al. , 2019 ; Liu et al. , 2019 ; Wu et al. , 2020 ) . Some early study has shown that these diversity metrics are correlated with respect to ensemble accuracy and diversity in the context of traditional machine learning models ( Kuncheva & Whitaker , 2003 ) . However , few studies to date have provided in-depth comparative critique on the effectiveness of these diversity metrics in pruning those low quality deep ensembles from the candidate ensembles due to their high negative correlation . Scope and Contributions . In this paper , we focus on the problem of defining ensemble diversity metrics that can select diverse ensemble teams with high ensemble accuracy . We first investigate the six representative ensemble diversity metrics , coined as Q metrics . We identify and analyze their inherent limitations in capturing the negative correlation among the member models of an ensemble , and why pruning out those deep ensembles with low Q-diversity may not always guarantee to improve the ensemble accuracy . To address the inherent problems of Q metrics , we extend the existing six Q metrics with three optimizations : ( 1 ) We introduce the concept of the focal model and argue that one way to better capture the negative correlations among member models of an ensemble is to compute diversity scores for ensembles of fixed size based on the focal model . ( 2 ) We introduce the six HQ diversity metrics to optimize the six Q-diversity metrics respectively . ( 3 ) We develop a HQbased hierarchical pruning method , consisting of two stage pruning : the α filter and the K-Means filter . By combining these optimizations , the deep ensembles selected by our HQ-metrics can significantly outperform those deep ensembles selected by the corresponding Q metrics , showing that the HQ metrics based hierarchical pruning approach is efficient in identification and removal of low diversity deep ensembles . Comprehensive experiments are conducted on three benchmark datasets : CIFAR-10 ( Krizhevsky & Hinton , 2009 ) , ImageNet ( Russakovsky et al. , 2015 ) , and Cora ( Lu & Getoor , 2003 ) . The results show that our hierarchical diversity pruning approach outperforms their corresponding Q-metrics in terms of the lower bound and the upper bound of ensemble accuracy over the deep ensembles selected , exhibiting the effectiveness of our HQ approach in pruning low diversity deep ensembles . 2 HIERARCHICAL PRUNING WITH DIVERSITY METRICS . Existing studies on consensus based ensemble learning ( Huang et al. , 2017 ; Krizhevsky et al. , 2012 ; Zoph & Le , 2016 ) generate the base model pool through two channels : ( i ) deep neural network training using different network structures or different configurations of hyperparameters ( Breiman , 1996 ; Schapire , 1999 ; Zoph & Le , 2016 ; Hinton et al. , 2015 ; Wu et al. , 2018 ; 2019 ) and ( ii ) selecting the top performing pre-trained models from open-source projects ( e.g. , GitHub ) and public model zoos ( Jia et al. , 2014 ; ONNX Developers , 2020 ; GTModelZoo Developers , 2020 ) . Hence , an important technical challenge for deep ensemble learning is to define diversity metrics for producing high quality ensemble teaming strategies , aiming to boost the ensemble accuracy . Given that the number of possible ensemble teams increases exponentially with a small pool of base models , de- veloping proper ensemble diversity metrics is critical for effective pruning of deep ensembles with insufficient diversity . Consider a pool of M base models for a learning task on a given dataset D , denoted by BMSet ( D ) = { F1 , ... , FM } . Let EnsSet denote the set of all possible ensemble teams that are composed from BMSet ( D ) , with the ensemble team size S varying from 2 to M . We have a total of ∑M S=2 ( M S ) ensembles , i.e. , |EnsSet| = ( M 2 ) + ( M 3 ) + ... + ( M M ) = 2M − ( 1 + M ) . The cardinality of the set of possible ensembles EnsSet grows exponentially with M , the number of base models . For example , M = 3 , we have |EnsSet| = 4 . When M becomes larger , such as M = 5 , 10 , 20 , |EnsSet| = 26 , 1013 , 1048555 . Hence , asM increases , it is non-trivial to construct a set of high-accuracy ensemble teams ( GEnsSet ) , from the candidate set ( EnsSet ) of all possible ensembles that are composed from BMSet ( D ) . Consider a pool of M = 10 base models for ImageNet , in which the highest performing base model is 78.25 % , the lowest performing base model is 56.63 % , and the average accuracy of these 10 base models is 71.60 % ( see Table 5 in Appendix Section F ) . For a pool of 10 base models , there will be a total of 1013 ( 210 − ( 10 + 1 ) ) different ensembles with team size ranging from 2 to 10 . The performance of these ensembles vary sharply , from 61.39 % ( lower bound ) to 80.77 % ( upper bound ) . Randomly selecting an ensemble team from these 1013 teams in EnsSet ( ImageNet ) may lead to a non-trivial probability of selecting a team with the ensemble accuracy lower than the average member model accuracy of 71.60 % over the 10 base models . Clearly , an efficient ensemble diversity metric should be able to prune out those ensemble teams with insufficient ensemble diversity and thus low ensemble accuracy , increasing ( i ) the average ensemble accuracy of the selected ensemble teams , ( ii ) the percentage of selected ensembles that exceed the highest accuracy of individual member models ( i.e. , 78.25 % for the 10 base DNN models on ImageNet ) ; and ( iii ) the lower bound ( worst case ) and the upper bound ( best case ) accuracy of the selected ensembles . A number of ensemble diversity metrics have been proposed to address this challenging problem . In this section , we first provide a comparative study of the six state-of-the-art Q-diversity metrics and analyze their inherent limitations in identifying and pruning out low diversity ensembles . Then we introduce our proposed HQ-diversity metrics and analyze the effectiveness of our HQ based hierarchical diversity approach in pruning low quality ensembles . 2.1 Q-DIVERSITY METRICS AND THEIR LIMITATIONS . We outline the key notations for the six Q-diversity metrics in Table 1 : three pairwise diversity metrics : Cohen ’ s Kappa ( CK ) ( McHugh , 2012 ) , Q Statistics ( QS ) ( Yule , 1900 ) and Binary Disagreement ( BD ) ( Skalak , 1996 ) , and three non-pairwise diversity metrics : Fleiss ’ Kappa ( Fleiss et al. , 2013 ) ( FK ) , Kohavi-Wolpert Variance ( KW ) ( Kohavi & Wolpert , 1996 ; Kuncheva & Whitaker , 2003 ) and Generalized Diversity ( GD ) ( Partridge & Krzanowski , 1997 ) . The arrow column ↑ | ↓ specifies the relationship between the Q-value and the ensemble diversity . The ↑ represents positive relationship of the Q-value and the ensemble diversity , that is a high Q-value refers to high ensemble diversity . The ↓ indicates the negative relationship , that is the low Q-value corresponds to high ensemble diversity . To facilitate the comparison of the six Q-diversity metrics such that the low Q-value refers to high ensemble diversity for all six Q-metrics , we apply ( 1−Q-value ) when calculating Q-diversity score with BD , KW and GD . We refer readers to Appendix ( Section C ) for the formal definitions of the six Q-diversity metrics . Given a Q-diversity metric , we calculate the diversity score for each ensemble team in the ensemble set ( EnsSet ) using a set of negative samples ( NegSampSet ) on which one or more models in the ensemble make prediction errors . The low Q-score indicates sufficient diversity among member models of an ensemble . Upon the completion of Q-diversity score computation for all ensembles in EnsSet , the diversity threshold based pruning is employed to remove those ensembles with insufficient diversity among ensemble member models . Either a pre-defined Q-diversity threshold or a mean threshold by taking the average value of all Q-diversity scores calculated for all candidate deep ensembles in EnsSet . The mean threshold tends to work better in general than a manually defined threshold . Once a mean threshold is obtained , those ensembles in EnsSet with their Q diversity scores below the threshold will be selected and placed into the diverse ensemble set GEnsSet , and the remaining ensembles are those with their Q scores higher than the threshold and thus will be pruned out . The pseudo code of the algorithm is included in Appendix ( Algorithm 1 ) . The last three columns of Table 1 show the mean threshold for all six Q-diversity metrics calculated on the set of 1013 candidate deep ensembles for the three benchmark datasets used in this study . We make two observations . First , different Q-diversity metrics capture the ensemble diversity from different perspectives with different diversity measurement principles , resulting in different Q-scores . Second , each Q-metric , say CK , is used to compare ensembles based on their Q-CK scores . Hence , even though the Q-KW metric has relatively high KW-specific Q scores for all ensemble teams , it can select the diverse ensembles based on the mean KW-threshold , in a similar manner as any of the other five Q metrics . Limitations of Q Metrics . Figure 1a and 1b show Q-KW and Q-GD metrics and their relationship with ensemble accuracy for all 1013 deep ensembles on CIFAR-10 respectively . Each dot represents a deep ensemble team with team sizes color-coded by the color diagram on the right . The vertical red dashed line represents the Q-KW and Q-GD mean thresholds of 0.868 and 0.476 respectively . The horizontal red and black dashed lines represent the maximum single model accuracy 96.68 % and the average accuracy 94.25 % of the 10 base models respectively . We use these two accuracy bounds as important references to quantify the quality of the deep ensembles selected using a Q metric with its mean threshold . Those deep ensembles on the left of the red vertical dash line are selected and added into GEnsSet given that their Q-scores are below the mean threshold ( e.g. , QKW or Q-GD ) . The ensembles on the right of this red vertical dash line are pruned out because their Q diversity scores exceed the mean threshold . Compare Figure 1a and 1b , it is visually clear that both Q metrics can select a sufficient number of good quality ensemble teams while at the same time , both Q metrics with mean threshold pruning will miss a large portion of teams with high ensemble accuracy , indicating the inherent limitations of both Q metrics and the mean threshold pruning with respect to capturing the concrete ensemble diversity in terms of low negative correlation among member models of an ensemble . To better understand the inherent problems with the Q-diversity metrics , we performed another set of experiments by measuring the Q-GD metric over ensemble teams of fixed size S on CIFAR-10 . Figure 1c shows a visualization of the results using the Q-GD scores computed over ensembles of size S = 4 with mean threshold indicated by the vertical red dashed line , showing a visually sharper trend in terms of the relationship between ensemble diversity and ensemble accuracy when comparing the selected ensemble teams ( red dots ) with those ensembles ( black dots ) on the right of the red vertical threshold line . However , relying on separating the diversity computation and comparison over ensemble teams of the same size alone may not be sufficient , because Figure 1c shows that ( i ) some selected ensemble teams have low accuracy , affecting all three ensemble quality measures ( recall Section 2 , page 3 ) , and ( ii ) a fair number of ensemble teams with high ensemble accuracy ( black dots on the top right side ) are still missed . Similar observations are also found for other five Q-diversity metrics . We conclude our analysis with three arguments : ( 1 ) The Qdiversity metrics may not accurately capture the degree of negative correlation among the member models of an ensemble even when its ensemble Q-diversity score is below the mean threshold . ( 2 ) Comparing ensembles of different team size S using their Q scores may not be a fair measure of their true ensemble diversity in terms of the degree of negative correlation among member models of an ensemble . However , relying on ensembles of the same team size S alone is still insufficient . ( 3 ) Mean threshold is not a good Q-diversity pruning method in terms of capturing the intrinsic relationship between ensemble diversity and ensemble accuracy . This motivates us to propose the HQ diversity metrics with two phase pruning using learning algorithms .
The manuscript studies the problem of ensemble selection (pruning) with the ensemble consists of deep neural network models. The authors compare different diversity metrics, which they named collectively as Q-metric, visualize the accuracies of different ensembles on CIFAR-10 dataset where the ensembles are stratified by their sizes. Based on their observation, the authors further propose HQ-metric, HQ(\alpha) and HQ(\alpha +K) to improve the diversity score from Q-metrics. The authors evaluate their strategies on CIFAR-10 and on all of the Q-metircs and show that those Q-metric, when incorporating their proposed strategies, in general, is capable of selecting ensembles of higher accuracy.
SP:7bcf05b89cb5776ae03592d5619d859e5c8571bc
Deep Ensembles with Hierarchical Diversity Pruning
1 INTRODUCTION . Deep ensembles with sufficient ensemble diversity hold potential of improving both accuracy and robustness of ensembles with their combined wisdom . The improvement can be measured by three criteria : ( i ) the average ensemble accuracy of the selected ensemble teams , ( ii ) the percentage of selected ensembles that exceed the highest accuracy of individual member models ; ( iii ) the lower bound ( worst case ) and the upper bound ( best case ) accuracy of the selected ensembles . The higher these three measures , the higher quality of the ensemble teams . Ensemble learning can be broadly classified into two categories : ( 1 ) learning the ensemble of diverse models via diversity optimized joint-training , coined as the ensemble training approach , such as boosting ( Schapire , 1999 ) ; and ( 2 ) learning to compose an ensemble of base models from a pool of existing pre-trained models through ensemble teaming based on ensemble diversity metrics ( Partridge & Krzanowski , 1997 ; Liu et al. , 2019 ; McHugh , 2012 ; Skalak , 1996 ) , coined as the ensemble consensus approach . This paper is focused on improving the state-of-the-art results in the second category . Related Work and Problem Statement . Ensemble diversity metrics are by design to capture the degree of negative correlation among the member models of an ensemble team ( Brown et al. , 2005 ; Liu et al. , 2019 ; Kuncheva & Whitaker , 2003 ) such that the high diversity indicates high negative correlation among member models of an ensemble . Three orthogonal and yet complimentary threads of efforts have been engaged in ensemble learning : ( 1 ) developing mechanisms to produce diverse base neural network models , ( 2 ) developing diversity metrics to select ensembles with high ensemble diversity from the candidate ensembles over the base model pool , and ( 3 ) developing consensus voting methods . The most popular consensus voting methods include the simple averaging , the weighted averaging , the majority voting , the plurality voting ( Ju et al. , 2017 ) , and the learn to rank ( Burges et al. , 2005 ) . For the base model selection , early efforts have been devoted to training diverse weak models to form a strong ensemble on a learning task , such as bagging ( Breiman , 1996 ) , boosting ( Schapire , 1999 ) , or different ways of selecting features , e.g. , random forests ( Tin Kam Ho , 1995 ) . Several recent studies also produce diverse base models by varying the training hyper-parameters , such as snapshot ensemble ( Huang et al. , 2017 ) , which utilizes the cyclic learning rates ( Smith , 2015 ; Wu et al. , 2019 ) to converge the single DNN model at different epochs to obtain the snapshots as the ensemble member models . Alternative method is to construct the pool of base models by using pre-trained models with different neural network backbones ( Wu et al. , 2020 ; Liu et al. , 2019 ; Wei et al. , 2020 ; Chow et al. , 2019a ) . The research efforts on diversity metrics have proposed both pairwise and non-pairwise ensemble diversity measures ( Fort et al. , 2019 ; Wu et al. , 2020 ; Liu et al. , 2019 ) , among which the three representative pairwise metrics are Cohen ’ s Kappa ( CK ) ( McHugh , 2012 ) , Q Statistics ( QS ) ( Yule , 1900 ) , Binary Disagreement ( BD ) ( Skalak , 1996 ) , and the three representative non-pairwise diversity metrics are Fleiss ’ Kappa ( FK ) ( Fleiss et al. , 2013 ) , Kohavi-Wolpert Variance ( KW ) ( Kohavi & Wolpert , 1996 ; Kuncheva & Whitaker , 2003 ) and Generalized Diversity ( GD ) ( Partridge & Krzanowski , 1997 ) . These diversity metrics are widely used in several recent studies ( Fort et al. , 2019 ; Liu et al. , 2019 ; Wu et al. , 2020 ) . Some early study has shown that these diversity metrics are correlated with respect to ensemble accuracy and diversity in the context of traditional machine learning models ( Kuncheva & Whitaker , 2003 ) . However , few studies to date have provided in-depth comparative critique on the effectiveness of these diversity metrics in pruning those low quality deep ensembles from the candidate ensembles due to their high negative correlation . Scope and Contributions . In this paper , we focus on the problem of defining ensemble diversity metrics that can select diverse ensemble teams with high ensemble accuracy . We first investigate the six representative ensemble diversity metrics , coined as Q metrics . We identify and analyze their inherent limitations in capturing the negative correlation among the member models of an ensemble , and why pruning out those deep ensembles with low Q-diversity may not always guarantee to improve the ensemble accuracy . To address the inherent problems of Q metrics , we extend the existing six Q metrics with three optimizations : ( 1 ) We introduce the concept of the focal model and argue that one way to better capture the negative correlations among member models of an ensemble is to compute diversity scores for ensembles of fixed size based on the focal model . ( 2 ) We introduce the six HQ diversity metrics to optimize the six Q-diversity metrics respectively . ( 3 ) We develop a HQbased hierarchical pruning method , consisting of two stage pruning : the α filter and the K-Means filter . By combining these optimizations , the deep ensembles selected by our HQ-metrics can significantly outperform those deep ensembles selected by the corresponding Q metrics , showing that the HQ metrics based hierarchical pruning approach is efficient in identification and removal of low diversity deep ensembles . Comprehensive experiments are conducted on three benchmark datasets : CIFAR-10 ( Krizhevsky & Hinton , 2009 ) , ImageNet ( Russakovsky et al. , 2015 ) , and Cora ( Lu & Getoor , 2003 ) . The results show that our hierarchical diversity pruning approach outperforms their corresponding Q-metrics in terms of the lower bound and the upper bound of ensemble accuracy over the deep ensembles selected , exhibiting the effectiveness of our HQ approach in pruning low diversity deep ensembles . 2 HIERARCHICAL PRUNING WITH DIVERSITY METRICS . Existing studies on consensus based ensemble learning ( Huang et al. , 2017 ; Krizhevsky et al. , 2012 ; Zoph & Le , 2016 ) generate the base model pool through two channels : ( i ) deep neural network training using different network structures or different configurations of hyperparameters ( Breiman , 1996 ; Schapire , 1999 ; Zoph & Le , 2016 ; Hinton et al. , 2015 ; Wu et al. , 2018 ; 2019 ) and ( ii ) selecting the top performing pre-trained models from open-source projects ( e.g. , GitHub ) and public model zoos ( Jia et al. , 2014 ; ONNX Developers , 2020 ; GTModelZoo Developers , 2020 ) . Hence , an important technical challenge for deep ensemble learning is to define diversity metrics for producing high quality ensemble teaming strategies , aiming to boost the ensemble accuracy . Given that the number of possible ensemble teams increases exponentially with a small pool of base models , de- veloping proper ensemble diversity metrics is critical for effective pruning of deep ensembles with insufficient diversity . Consider a pool of M base models for a learning task on a given dataset D , denoted by BMSet ( D ) = { F1 , ... , FM } . Let EnsSet denote the set of all possible ensemble teams that are composed from BMSet ( D ) , with the ensemble team size S varying from 2 to M . We have a total of ∑M S=2 ( M S ) ensembles , i.e. , |EnsSet| = ( M 2 ) + ( M 3 ) + ... + ( M M ) = 2M − ( 1 + M ) . The cardinality of the set of possible ensembles EnsSet grows exponentially with M , the number of base models . For example , M = 3 , we have |EnsSet| = 4 . When M becomes larger , such as M = 5 , 10 , 20 , |EnsSet| = 26 , 1013 , 1048555 . Hence , asM increases , it is non-trivial to construct a set of high-accuracy ensemble teams ( GEnsSet ) , from the candidate set ( EnsSet ) of all possible ensembles that are composed from BMSet ( D ) . Consider a pool of M = 10 base models for ImageNet , in which the highest performing base model is 78.25 % , the lowest performing base model is 56.63 % , and the average accuracy of these 10 base models is 71.60 % ( see Table 5 in Appendix Section F ) . For a pool of 10 base models , there will be a total of 1013 ( 210 − ( 10 + 1 ) ) different ensembles with team size ranging from 2 to 10 . The performance of these ensembles vary sharply , from 61.39 % ( lower bound ) to 80.77 % ( upper bound ) . Randomly selecting an ensemble team from these 1013 teams in EnsSet ( ImageNet ) may lead to a non-trivial probability of selecting a team with the ensemble accuracy lower than the average member model accuracy of 71.60 % over the 10 base models . Clearly , an efficient ensemble diversity metric should be able to prune out those ensemble teams with insufficient ensemble diversity and thus low ensemble accuracy , increasing ( i ) the average ensemble accuracy of the selected ensemble teams , ( ii ) the percentage of selected ensembles that exceed the highest accuracy of individual member models ( i.e. , 78.25 % for the 10 base DNN models on ImageNet ) ; and ( iii ) the lower bound ( worst case ) and the upper bound ( best case ) accuracy of the selected ensembles . A number of ensemble diversity metrics have been proposed to address this challenging problem . In this section , we first provide a comparative study of the six state-of-the-art Q-diversity metrics and analyze their inherent limitations in identifying and pruning out low diversity ensembles . Then we introduce our proposed HQ-diversity metrics and analyze the effectiveness of our HQ based hierarchical diversity approach in pruning low quality ensembles . 2.1 Q-DIVERSITY METRICS AND THEIR LIMITATIONS . We outline the key notations for the six Q-diversity metrics in Table 1 : three pairwise diversity metrics : Cohen ’ s Kappa ( CK ) ( McHugh , 2012 ) , Q Statistics ( QS ) ( Yule , 1900 ) and Binary Disagreement ( BD ) ( Skalak , 1996 ) , and three non-pairwise diversity metrics : Fleiss ’ Kappa ( Fleiss et al. , 2013 ) ( FK ) , Kohavi-Wolpert Variance ( KW ) ( Kohavi & Wolpert , 1996 ; Kuncheva & Whitaker , 2003 ) and Generalized Diversity ( GD ) ( Partridge & Krzanowski , 1997 ) . The arrow column ↑ | ↓ specifies the relationship between the Q-value and the ensemble diversity . The ↑ represents positive relationship of the Q-value and the ensemble diversity , that is a high Q-value refers to high ensemble diversity . The ↓ indicates the negative relationship , that is the low Q-value corresponds to high ensemble diversity . To facilitate the comparison of the six Q-diversity metrics such that the low Q-value refers to high ensemble diversity for all six Q-metrics , we apply ( 1−Q-value ) when calculating Q-diversity score with BD , KW and GD . We refer readers to Appendix ( Section C ) for the formal definitions of the six Q-diversity metrics . Given a Q-diversity metric , we calculate the diversity score for each ensemble team in the ensemble set ( EnsSet ) using a set of negative samples ( NegSampSet ) on which one or more models in the ensemble make prediction errors . The low Q-score indicates sufficient diversity among member models of an ensemble . Upon the completion of Q-diversity score computation for all ensembles in EnsSet , the diversity threshold based pruning is employed to remove those ensembles with insufficient diversity among ensemble member models . Either a pre-defined Q-diversity threshold or a mean threshold by taking the average value of all Q-diversity scores calculated for all candidate deep ensembles in EnsSet . The mean threshold tends to work better in general than a manually defined threshold . Once a mean threshold is obtained , those ensembles in EnsSet with their Q diversity scores below the threshold will be selected and placed into the diverse ensemble set GEnsSet , and the remaining ensembles are those with their Q scores higher than the threshold and thus will be pruned out . The pseudo code of the algorithm is included in Appendix ( Algorithm 1 ) . The last three columns of Table 1 show the mean threshold for all six Q-diversity metrics calculated on the set of 1013 candidate deep ensembles for the three benchmark datasets used in this study . We make two observations . First , different Q-diversity metrics capture the ensemble diversity from different perspectives with different diversity measurement principles , resulting in different Q-scores . Second , each Q-metric , say CK , is used to compare ensembles based on their Q-CK scores . Hence , even though the Q-KW metric has relatively high KW-specific Q scores for all ensemble teams , it can select the diverse ensembles based on the mean KW-threshold , in a similar manner as any of the other five Q metrics . Limitations of Q Metrics . Figure 1a and 1b show Q-KW and Q-GD metrics and their relationship with ensemble accuracy for all 1013 deep ensembles on CIFAR-10 respectively . Each dot represents a deep ensemble team with team sizes color-coded by the color diagram on the right . The vertical red dashed line represents the Q-KW and Q-GD mean thresholds of 0.868 and 0.476 respectively . The horizontal red and black dashed lines represent the maximum single model accuracy 96.68 % and the average accuracy 94.25 % of the 10 base models respectively . We use these two accuracy bounds as important references to quantify the quality of the deep ensembles selected using a Q metric with its mean threshold . Those deep ensembles on the left of the red vertical dash line are selected and added into GEnsSet given that their Q-scores are below the mean threshold ( e.g. , QKW or Q-GD ) . The ensembles on the right of this red vertical dash line are pruned out because their Q diversity scores exceed the mean threshold . Compare Figure 1a and 1b , it is visually clear that both Q metrics can select a sufficient number of good quality ensemble teams while at the same time , both Q metrics with mean threshold pruning will miss a large portion of teams with high ensemble accuracy , indicating the inherent limitations of both Q metrics and the mean threshold pruning with respect to capturing the concrete ensemble diversity in terms of low negative correlation among member models of an ensemble . To better understand the inherent problems with the Q-diversity metrics , we performed another set of experiments by measuring the Q-GD metric over ensemble teams of fixed size S on CIFAR-10 . Figure 1c shows a visualization of the results using the Q-GD scores computed over ensembles of size S = 4 with mean threshold indicated by the vertical red dashed line , showing a visually sharper trend in terms of the relationship between ensemble diversity and ensemble accuracy when comparing the selected ensemble teams ( red dots ) with those ensembles ( black dots ) on the right of the red vertical threshold line . However , relying on separating the diversity computation and comparison over ensemble teams of the same size alone may not be sufficient , because Figure 1c shows that ( i ) some selected ensemble teams have low accuracy , affecting all three ensemble quality measures ( recall Section 2 , page 3 ) , and ( ii ) a fair number of ensemble teams with high ensemble accuracy ( black dots on the top right side ) are still missed . Similar observations are also found for other five Q-diversity metrics . We conclude our analysis with three arguments : ( 1 ) The Qdiversity metrics may not accurately capture the degree of negative correlation among the member models of an ensemble even when its ensemble Q-diversity score is below the mean threshold . ( 2 ) Comparing ensembles of different team size S using their Q scores may not be a fair measure of their true ensemble diversity in terms of the degree of negative correlation among member models of an ensemble . However , relying on ensembles of the same team size S alone is still insufficient . ( 3 ) Mean threshold is not a good Q-diversity pruning method in terms of capturing the intrinsic relationship between ensemble diversity and ensemble accuracy . This motivates us to propose the HQ diversity metrics with two phase pruning using learning algorithms .
The paper succeeds in developing diversity metrics that correlate better with ensemble accuracy than the original diversity metrics. However, this makes one wonder why one cannot just use ensemble accuracy directly. One can also use a combining scheme along the lines of (Freund, 1995) where it adds models that focus on the examples that will increase accuracy and allowing errors on examples where most of the models so far have either classified the examples correctly already or incorrectly (where there is no hope of recovery and so effort is not worthwhile). Additionally, the appendix has the algorithms and other substantive content that is central to the paper, which is not supposed to be the case.
SP:7bcf05b89cb5776ae03592d5619d859e5c8571bc
Stochastic Normalized Gradient Descent with Momentum for Large Batch Training
1 INTRODUCTION . In machine learning , we often need to solve the following empirical risk minimization problem : min w∈Rd F ( w ) = 1 n n∑ i=1 fi ( w ) , ( 1 ) where w ∈ Rd denotes the model parameter , n denotes the number of training samples , fi ( w ) denotes the loss on the ith training sample . The problem in ( 1 ) can be used to formulate a broad family of machine learning models , such as logistic regression and deep learning models . Stochastic gradient descent ( SGD ) Robbins & Monro ( 1951 ) and its variants have been the dominating optimization methods for solving ( 1 ) . SGD and its variants are iterative methods . In the tth iteration , these methods randomly choose a subset ( also called mini-batch ) It ⊂ { 1 , 2 , . . . , n } and compute the stochastic mini-batch gradient 1/B ∑ i∈It ∇fi ( wt ) for updating the model parameter , where B = |It| is the batch size . Existing works Li et al . ( 2014b ) ; Yu et al . ( 2019a ) have proved that with the batch size of B , SGD and its momentum variant , called momentum SGD ( MSGD ) , achieve a O ( 1/ √ TB ) convergence rate for smooth non-convex problems , where T is total number of model parameter updates . With the population of multi-core systems and the easy implementation for data parallelism , many distributed variants of SGD have been proposed , including parallel SGD Li et al . ( 2014a ) , decentralized SGD Lian et al . ( 2017 ) , local SGD Yu et al . ( 2019b ) ; Lin et al . ( 2020 ) , local momentum SGD Yu et al . ( 2019a ) and so on . Theoretical results show that all these methods can achieve aO ( 1/ √ TKb ) convergence rate for smooth non-convex problems . Here , b is the batch size on each worker and K is the number of workers . By setting Kb = B , we can observe that the convergence rate of these distributed methods is consistent with that of sequential methods . In distributed settings , a small number of model parameter updates T implies a small synchronize cost and communication cost . Hence , a small T can further speed up the training process . Based on theO ( 1/ √ TKb ) convergence rate , we can find that if we adopt a larger b , the T will be smaller . Hence , large batch training can reduce the number of communication rounds in distributed training . Another benefit of adopting large batch training is to better utilize the computational power of current multi-core systems like GPUs You et al . ( 2017 ) . Hence , large batch training has recently attracted more and more attention in machine learning . Unfortunately , empirical results LeCun et al . ( 2012 ) ; Keskar et al . ( 2017 ) show that existing SGD methods with a large batch size will lead to a drop of generalization accuracy on deep learning models . Figure 1 shows the comparison of training loss and test accuracy between MSGD with a small batch size and MSGD with a large batch size . We can find that large batch training does degrade both training loss and test accuracy . Many works try to explain this phenomenon Keskar et al . ( 2017 ) ; Hoffer et al . ( 2017 ) . They observe that SGD with a small batch size typically makes the model parameter converge to a flatten minimum while SGD with a large batch size typically makes the model parameter fall into the region of a sharp minimum . And usually , a flatten minimum can achieve better generalization ability than a sharp minimum . Hence , large batch training has also become a challenging topic . Recently , many methods have been proposed for improving the performance of SGD with a large batch size . The work in Goyal et al . ( 2017 ) ; You et al . ( 2020 ) proposes many tricks like warmup , momentum correction and linearly scaling the learning rate , for large batch training . The work in You et al . ( 2017 ) observes that the norms of gradient at different layers of deep neural networks are widely different and the authors propose the layer-wise adaptive rate scaling method ( LARS ) . The work in Ginsburg et al . ( 2019 ) also proposes a similar method that updates the model parameter in a layer-wise way . Most of these methods lack theoretical evidence to explain why they can adopt a large batch size . Although the work in You et al . ( 2020 ) proposes some theoretical explanations for LARS , the implementation is still not consistent with its theorems in which both of the momentum coefficient and weight decay are set as zeros . In this paper , we propose a novel method , called stochastic normalized gradient descent with momentum ( SNGM ) , for large batch training . SNGM combines normalized gradient Nesterov ( 2004 ) ; Hazan et al . ( 2015 ) ; Wilson et al . ( 2019 ) and Polyak ’ s momentum technique Polyak ( 1964 ) together . The main contributions of this paper are outlined as follows : • We theoretically prove that compared to MSGD which is one of the most widely used variants of SGD , SNGM can adopt a larger batch size to converge to the -stationary point with the same computation complexity ( total number of gradient computation ) . That is to say , SNGM needs a smaller number of parameter update , and hence has faster training speed than MSGD . • For a relaxed smooth objective function ( see Definition 2 ) , we theoretically show that SNGM can achieve an -stationary point with a computation complexity of O ( 1/ 4 ) . To the best of our knowledge , this is the first work that analyzes the computation complexity of stochastic optimization methods for a relaxed smooth objective function . • Empirical results on deep learning also show that SNGM can achieve the state-of-the-art accuracy with a large batch size . 2 PRELIMINARIES . In this paper , we use ‖·‖ to denote the Euclidean norm , use w∗ to denote one of the optimal solutions of ( 1 ) , i.e. , w∗ ∈ argminw F ( w ) . We call w an -stationary point of F ( w ) if ‖∇F ( w ) ‖ ≤ . The computation complexity of an algorithm is the total number of its gradient computation . We also give the following assumption and definitions : Assumption 1 ( σ-bounded variance ) For any w , E‖∇fi ( w ) −∇F ( w ) ‖2 ≤ σ2 ( σ > 0 ) . Definition 1 ( Smoothness ) A function φ ( · ) is L-smooth ( L > 0 ) if for any u , w , φ ( u ) ≤ φ ( w ) +∇φ ( w ) > ( u−w ) + L 2 ‖u−w‖2 . L is called smoothness constant in this paper . Definition 2 ( Relaxed smoothness Zhang et al . ( 2020 ) ) A function φ ( · ) is ( L , λ ) -smooth ( L ≥ 0 , λ ≥ 0 ) if φ ( · ) is twice differentiable and for any w , ‖∇2φ ( w ) ‖ ≤ L+ λ‖∇φ ( w ) ‖ , where∇2φ ( w ) denotes the Hessian matrix of φ ( w ) . From the above definition , we can observe that if a function φ ( w ) is ( L , 0 ) -smooth , then it is a classical L-smooth function Nesterov ( 2004 ) . For a ( L , λ ) -smooth function , we have the following property Zhang et al . ( 2020 ) : Lemma 1 If φ ( · ) is ( L , λ ) -smooth , then for any u , w , α such that ‖u−w‖ ≤ α , we have ‖∇φ ( u ) ‖ ≤ ( Lα+ ‖∇φ ( w ) ‖ ) eλα . All the proofs of lemmas and corollaries of this paper are put in the supplementary . 3 RELATIONSHIP BETWEEN SMOOTHNESS CONSTANT AND BATCH SIZE . In this section , we deeply analyze the convergence property of MSGD to find the relationship between smoothness constant and batch size , which provides insightful hint for designing our new method SNGM . MSGD can be written as follows : vt+1 = βvt + gt , ( 2 ) wt+1 = wt − ηvt+1 , ( 3 ) where gt = 1/B ∑ i∈It ∇fi ( wt ) is a stochastic mini-batch gradient with a batch size of B , and vt+1 is the Polyak ’ s momentum Polyak ( 1964 ) . We aim to find how large the batch size can be without loss of performance . The convergence rate of MSGD with the batch size B for L-smooth functions can be derived from the work in Yu et al . ( 2019a ) . That is to say , when η ≤ ( 1− β ) 2/ ( ( 1 + β ) L ) , we obtain 1 T T−1∑ t=0 E‖∇F ( wt ) ‖2 ≤ 2 ( 1− β ) [ F ( w0 ) − F ( w∗ ) ] ηT + Lησ2 ( 1− β ) 2B + 4L2η2σ2 ( 1− β ) 2 , =O ( B ηC ) +O ( η B ) +O ( η2 ) , ( 4 ) where C = TB denotes the computation complexity ( total number of gradient computation ) . According to Corollary 1 in Yu et al . ( 2019a ) , we set η = √ B/ √ T = B/ √ C and obtain that 1 T T−1∑ t=0 E‖∇F ( wt ) ‖ ≤ √ O ( 1√ C ) +O ( B 2 C ) . ( 5 ) Algorithm 1 SNGM Initialization : η > 0 , β ∈ [ 0 , 1 ) , B > 0 , T > 0 , u0 = 0 , w0 ; for t = 0 , 1 , . . . , T − 1 do Randomly choose B function indices , denoted as It ; Compute a mini-batch gradient gt = 1B ∑ i∈It ∇fi ( wt ) ; ut+1 = βut + gt ‖gt‖ ; wt+1 = wt − ηut+1 ; end for Since η ≤ ( 1− β ) 2/ ( ( 1+ β ) L ) is necessary for ( 4 ) , we firstly obtain that B ≤ O ( √ C/L ) . Furthermore , according to the right term of ( 5 ) , we have to set B such that B2/C ≤ 1/ √ C , i.e. , B ≤ C1/4 , for O ( 1/ 4 ) computation complexity guarantee . Hence in MSGD , we have to set the batch size satisfying B ≤ O ( min { √ C L , C1/4 } ) . ( 6 ) We can observe that a larger L leads to a smaller batch size in MSGD . If B does not satisfy ( 6 ) , MSGD will get higher computation complexity . In fact , to the best of our knowledge , among all the existing convergence analysis of SGD and its variants on both convex and non-convex problems , we can observe three necessary conditions for the O ( 1/ 4 ) computation complexity guarantee Li et al . ( 2014b ; a ) ; Lian et al . ( 2017 ) ; Yu et al . ( 2019b ; a ) : ( a ) the objective function is L-smooth ; ( b ) the learning rate η is less than O ( 1/L ) ; ( c ) the batch size B is proportional to the learning rate η . One direct corollary is that the batch size is limited by the smooth constant L , i.e. , B ≤ O ( 1/L ) . Hence , we can not increase the batch size casually in these SGD based methods . Otherwise , it may slow down the convergence rate and we need to compute more gradients , which is consistent with the observations in Hoffer et al . ( 2017 ) .
This paper proposes a new stochastic normalized gradient descent method with momentum (SNGM) for large batch training. They prove that unlike mometum SGD (MSGD), SNGM can adopt larger batch size to converge to the epsilon-stationary point with the same computation complexity (total number of gradient computation). The paper shows that SNGM with large batches is comparable to MSGD with small batches for training ResNet on CIFAR10 and ImageNet. The paper also shows that SNGM outperforms LARS on CIFAR10.
SP:276a1974451e9740ff761c45ff63de47aabe0534
Stochastic Normalized Gradient Descent with Momentum for Large Batch Training
1 INTRODUCTION . In machine learning , we often need to solve the following empirical risk minimization problem : min w∈Rd F ( w ) = 1 n n∑ i=1 fi ( w ) , ( 1 ) where w ∈ Rd denotes the model parameter , n denotes the number of training samples , fi ( w ) denotes the loss on the ith training sample . The problem in ( 1 ) can be used to formulate a broad family of machine learning models , such as logistic regression and deep learning models . Stochastic gradient descent ( SGD ) Robbins & Monro ( 1951 ) and its variants have been the dominating optimization methods for solving ( 1 ) . SGD and its variants are iterative methods . In the tth iteration , these methods randomly choose a subset ( also called mini-batch ) It ⊂ { 1 , 2 , . . . , n } and compute the stochastic mini-batch gradient 1/B ∑ i∈It ∇fi ( wt ) for updating the model parameter , where B = |It| is the batch size . Existing works Li et al . ( 2014b ) ; Yu et al . ( 2019a ) have proved that with the batch size of B , SGD and its momentum variant , called momentum SGD ( MSGD ) , achieve a O ( 1/ √ TB ) convergence rate for smooth non-convex problems , where T is total number of model parameter updates . With the population of multi-core systems and the easy implementation for data parallelism , many distributed variants of SGD have been proposed , including parallel SGD Li et al . ( 2014a ) , decentralized SGD Lian et al . ( 2017 ) , local SGD Yu et al . ( 2019b ) ; Lin et al . ( 2020 ) , local momentum SGD Yu et al . ( 2019a ) and so on . Theoretical results show that all these methods can achieve aO ( 1/ √ TKb ) convergence rate for smooth non-convex problems . Here , b is the batch size on each worker and K is the number of workers . By setting Kb = B , we can observe that the convergence rate of these distributed methods is consistent with that of sequential methods . In distributed settings , a small number of model parameter updates T implies a small synchronize cost and communication cost . Hence , a small T can further speed up the training process . Based on theO ( 1/ √ TKb ) convergence rate , we can find that if we adopt a larger b , the T will be smaller . Hence , large batch training can reduce the number of communication rounds in distributed training . Another benefit of adopting large batch training is to better utilize the computational power of current multi-core systems like GPUs You et al . ( 2017 ) . Hence , large batch training has recently attracted more and more attention in machine learning . Unfortunately , empirical results LeCun et al . ( 2012 ) ; Keskar et al . ( 2017 ) show that existing SGD methods with a large batch size will lead to a drop of generalization accuracy on deep learning models . Figure 1 shows the comparison of training loss and test accuracy between MSGD with a small batch size and MSGD with a large batch size . We can find that large batch training does degrade both training loss and test accuracy . Many works try to explain this phenomenon Keskar et al . ( 2017 ) ; Hoffer et al . ( 2017 ) . They observe that SGD with a small batch size typically makes the model parameter converge to a flatten minimum while SGD with a large batch size typically makes the model parameter fall into the region of a sharp minimum . And usually , a flatten minimum can achieve better generalization ability than a sharp minimum . Hence , large batch training has also become a challenging topic . Recently , many methods have been proposed for improving the performance of SGD with a large batch size . The work in Goyal et al . ( 2017 ) ; You et al . ( 2020 ) proposes many tricks like warmup , momentum correction and linearly scaling the learning rate , for large batch training . The work in You et al . ( 2017 ) observes that the norms of gradient at different layers of deep neural networks are widely different and the authors propose the layer-wise adaptive rate scaling method ( LARS ) . The work in Ginsburg et al . ( 2019 ) also proposes a similar method that updates the model parameter in a layer-wise way . Most of these methods lack theoretical evidence to explain why they can adopt a large batch size . Although the work in You et al . ( 2020 ) proposes some theoretical explanations for LARS , the implementation is still not consistent with its theorems in which both of the momentum coefficient and weight decay are set as zeros . In this paper , we propose a novel method , called stochastic normalized gradient descent with momentum ( SNGM ) , for large batch training . SNGM combines normalized gradient Nesterov ( 2004 ) ; Hazan et al . ( 2015 ) ; Wilson et al . ( 2019 ) and Polyak ’ s momentum technique Polyak ( 1964 ) together . The main contributions of this paper are outlined as follows : • We theoretically prove that compared to MSGD which is one of the most widely used variants of SGD , SNGM can adopt a larger batch size to converge to the -stationary point with the same computation complexity ( total number of gradient computation ) . That is to say , SNGM needs a smaller number of parameter update , and hence has faster training speed than MSGD . • For a relaxed smooth objective function ( see Definition 2 ) , we theoretically show that SNGM can achieve an -stationary point with a computation complexity of O ( 1/ 4 ) . To the best of our knowledge , this is the first work that analyzes the computation complexity of stochastic optimization methods for a relaxed smooth objective function . • Empirical results on deep learning also show that SNGM can achieve the state-of-the-art accuracy with a large batch size . 2 PRELIMINARIES . In this paper , we use ‖·‖ to denote the Euclidean norm , use w∗ to denote one of the optimal solutions of ( 1 ) , i.e. , w∗ ∈ argminw F ( w ) . We call w an -stationary point of F ( w ) if ‖∇F ( w ) ‖ ≤ . The computation complexity of an algorithm is the total number of its gradient computation . We also give the following assumption and definitions : Assumption 1 ( σ-bounded variance ) For any w , E‖∇fi ( w ) −∇F ( w ) ‖2 ≤ σ2 ( σ > 0 ) . Definition 1 ( Smoothness ) A function φ ( · ) is L-smooth ( L > 0 ) if for any u , w , φ ( u ) ≤ φ ( w ) +∇φ ( w ) > ( u−w ) + L 2 ‖u−w‖2 . L is called smoothness constant in this paper . Definition 2 ( Relaxed smoothness Zhang et al . ( 2020 ) ) A function φ ( · ) is ( L , λ ) -smooth ( L ≥ 0 , λ ≥ 0 ) if φ ( · ) is twice differentiable and for any w , ‖∇2φ ( w ) ‖ ≤ L+ λ‖∇φ ( w ) ‖ , where∇2φ ( w ) denotes the Hessian matrix of φ ( w ) . From the above definition , we can observe that if a function φ ( w ) is ( L , 0 ) -smooth , then it is a classical L-smooth function Nesterov ( 2004 ) . For a ( L , λ ) -smooth function , we have the following property Zhang et al . ( 2020 ) : Lemma 1 If φ ( · ) is ( L , λ ) -smooth , then for any u , w , α such that ‖u−w‖ ≤ α , we have ‖∇φ ( u ) ‖ ≤ ( Lα+ ‖∇φ ( w ) ‖ ) eλα . All the proofs of lemmas and corollaries of this paper are put in the supplementary . 3 RELATIONSHIP BETWEEN SMOOTHNESS CONSTANT AND BATCH SIZE . In this section , we deeply analyze the convergence property of MSGD to find the relationship between smoothness constant and batch size , which provides insightful hint for designing our new method SNGM . MSGD can be written as follows : vt+1 = βvt + gt , ( 2 ) wt+1 = wt − ηvt+1 , ( 3 ) where gt = 1/B ∑ i∈It ∇fi ( wt ) is a stochastic mini-batch gradient with a batch size of B , and vt+1 is the Polyak ’ s momentum Polyak ( 1964 ) . We aim to find how large the batch size can be without loss of performance . The convergence rate of MSGD with the batch size B for L-smooth functions can be derived from the work in Yu et al . ( 2019a ) . That is to say , when η ≤ ( 1− β ) 2/ ( ( 1 + β ) L ) , we obtain 1 T T−1∑ t=0 E‖∇F ( wt ) ‖2 ≤ 2 ( 1− β ) [ F ( w0 ) − F ( w∗ ) ] ηT + Lησ2 ( 1− β ) 2B + 4L2η2σ2 ( 1− β ) 2 , =O ( B ηC ) +O ( η B ) +O ( η2 ) , ( 4 ) where C = TB denotes the computation complexity ( total number of gradient computation ) . According to Corollary 1 in Yu et al . ( 2019a ) , we set η = √ B/ √ T = B/ √ C and obtain that 1 T T−1∑ t=0 E‖∇F ( wt ) ‖ ≤ √ O ( 1√ C ) +O ( B 2 C ) . ( 5 ) Algorithm 1 SNGM Initialization : η > 0 , β ∈ [ 0 , 1 ) , B > 0 , T > 0 , u0 = 0 , w0 ; for t = 0 , 1 , . . . , T − 1 do Randomly choose B function indices , denoted as It ; Compute a mini-batch gradient gt = 1B ∑ i∈It ∇fi ( wt ) ; ut+1 = βut + gt ‖gt‖ ; wt+1 = wt − ηut+1 ; end for Since η ≤ ( 1− β ) 2/ ( ( 1+ β ) L ) is necessary for ( 4 ) , we firstly obtain that B ≤ O ( √ C/L ) . Furthermore , according to the right term of ( 5 ) , we have to set B such that B2/C ≤ 1/ √ C , i.e. , B ≤ C1/4 , for O ( 1/ 4 ) computation complexity guarantee . Hence in MSGD , we have to set the batch size satisfying B ≤ O ( min { √ C L , C1/4 } ) . ( 6 ) We can observe that a larger L leads to a smaller batch size in MSGD . If B does not satisfy ( 6 ) , MSGD will get higher computation complexity . In fact , to the best of our knowledge , among all the existing convergence analysis of SGD and its variants on both convex and non-convex problems , we can observe three necessary conditions for the O ( 1/ 4 ) computation complexity guarantee Li et al . ( 2014b ; a ) ; Lian et al . ( 2017 ) ; Yu et al . ( 2019b ; a ) : ( a ) the objective function is L-smooth ; ( b ) the learning rate η is less than O ( 1/L ) ; ( c ) the batch size B is proportional to the learning rate η . One direct corollary is that the batch size is limited by the smooth constant L , i.e. , B ≤ O ( 1/L ) . Hence , we can not increase the batch size casually in these SGD based methods . Otherwise , it may slow down the convergence rate and we need to compute more gradients , which is consistent with the observations in Hoffer et al . ( 2017 ) .
Large batch training has been observed to not only significantly improve the training speed but also lead to a worse generalization performance. This paper considers how to improve the performance of MSGD in large batch training. They propose the so called normalized MSGD where instead of the gradient, the algorithm uses the normalized gradient to update the momentum. They also provide theoretical justification of this change by considering smooth and relaxed smooth function. O(1/\epsilon^4) convergence rate is established.
SP:276a1974451e9740ff761c45ff63de47aabe0534
Weighted Line Graph Convolutional Networks
1 INTRODUCTION . Graph neural networks ( Gori et al. , 2005 ; Scarselli et al. , 2009 ; Hamilton et al. , 2017 ) have shown to be competent in solving challenging tasks in the field of network embedding . Many tasks have been significantly advanced by graph deep learning methods such as node classification tasks ( Kipf & Welling , 2017 ; Veličković et al. , 2017 ; Gao et al. , 2018 ) , graph classification tasks ( Ying et al. , 2018 ; Zhang et al. , 2018 ) , link prediction tasks ( Zhang & Chen , 2018 ; Zhou et al. , 2019 ) , and community detection tasks ( Chen et al. , 2019 ) . Currently , most graph neural networks capture the relationships among nodes through message passing operations . Recently , some works ( Chen et al. , 2019 ) use extra graph structures such as line graphs to enhance message passing operations in graph neural networks from different graph perspectives . A line graph is a graph that is derived from an original graph to represent connectivity between edges in the original graph . Since line graphs can encode the topology information , message passing operations on line graphs can enhance network embeddings in graph neural networks . However , graph neural networks that leverage line graph structures need to deal with two challenging issues ; those are bias and inefficiency . Topology information in original graphs is encoded in line graphs but in a biased way . In particular , node features are either overstated or understated depending on their degrees . Besides , line graphs can be much bigger graphs than original graphs depending on the graph density . Message passing operations of graph neural networks on line graphs lead to significant use of computational resources . In this work , we propose to construct a weighted line graph that can correct biases in encoded topology information of line graphs . To this end , we assign each edge in a line graph a normalized weight such that each node in the line graph has a weighted degree of 2 . In this weighted line graph , the dynamics of node features are the same as those in its original graph . Based on our weighted line graph , we propose a weighted line graph convolution layer ( WLGCL ) that performs a message passing operation on both original graph structures and weighted line graph structures . To address inefficiency issues existing in graph neural networks that use line graph structures , we further propose to implement our WLGCL via an incidence matrix , which can dramatically reduce the usage of computational resources . Based on our WLGCL , we build a family of weighted line graph convolutional networks ( WLGCNs ) . We evaluate our methods on graph classification tasks and show that WLGCNs consistently outperform previous state-of-the-art models . Experiments on simulated data demonstrate the efficiency advantage of our implementation . 2 BACKGROUND AND RELATED WORK . In graph theory , a line graph is a graph derived from an undirected graph . It represents the connectivity among edges in the original graph . Given a graph G , the corresponding line graph L ( G ) is constructed by using edges in G as vertices in L ( G ) . Two nodes in L ( G ) are adjacent if they share a common end node in the graph G ( Golumbic , 2004 ) . Note that the edges ( a , b ) and ( b , a ) in an undirected graph G correspond to the same vertex in the line graph L ( G ) . The Whitney graph isomorphism theorem ( Thatte , 2005 ) stated that a line graph has a one-to-one correspondence to its original graph . This theorem guarantees that the line graph can encode the topology information in the original graph . Recently , some works ( Monti et al. , 2018 ; Chen et al. , 2019 ; Bandyopadhyay et al. , 2019 ; Jiang et al. , 2019 ) proposes to use the line graph structure to enhance the message passing operations in graph neural networks . Since the line graph can encode the topology information , the message passing on the line graph can enhance the network embeddings in graph neural networks . In graph neural networks that use line graph structures , features are passed and transformed in both the original graph structures and the line graph structures , thereby leading to better feature learnings and performances . 3 WEIGHTED LINE GRAPH CONVOLUTIONAL NETWORKS . In this work , we propose the weighted line graph to address the bias in the line graph when encoding graph topology information . Based on our weighted line graph , we propose the weighted line graph convolution layer ( WLGCL ) for better feature learning by leveraging line graph structures . Besides , graph neural networks using line graphs consume excessive computational resources . To solve the inefficiency issue , we propose to use the incidence matrix to implement the WLGCL , which can dramatically reduce the usage of computational resources . 3.1 BENEFIT AND BIAS OF LINE GRAPH REPRESENTATIONS . In this section , we describe the benefit and bias of using line graph representations . Benefit In message-passing operations , edges are usually given equal importance and edge features are not well explored . This can constrain the capacity of GNNs , especially on graphs with edge features . In the chemistry domain , a compound can be converted into a graph , where atoms are nodes and chemical bonds are edges . On such kinds of graphs , edges have different properties and thus different importance . However , message-passing operations underestimate the importance of edges . To address this issue , the line graph structure can be used to leverage edge features and different edge importance ( Jiang et al. , 2019 ; Chen et al. , 2019 ; Zhu et al. , 2019 ) . The line graph , by its nature , enables graph neural networks to encode and propagate edge features in the graph . The line graph neural networks that take advantage of line graph structures have shown to be promising on graph-related tasks ( Chen et al. , 2019 ; Xiong et al. , 2019 ; Yao et al. , 2019 ) . By encoding node and edge features simultaneously , line graph neural networks enhance the feature learning on graphs . Bias According to the Whitney graph isomorphism theorem , the line graph L ( G ) encodes the topology information of the original graph G , but the dynamics and topology of G are not correctly represented in L ( G ) ( Evans & Lambiotte , 2009 ) . As described in the previous section , each edge in the graph G corresponds to a vertex in the line graph L ( G ) . The features of each edge contain features of its two end nodes . A vertex with a degree d in the original graph G will generate d× ( d− 1 ) /2 edges in the line graph L ( G ) . The message passing frequency of this node ’ s features will change from O ( d ) in the original graph to O ( d2 ) in the line graph . From this point , the line graph encodes the topology information in the original graph but in a biased way . In the original graph , a node ’ s features will be passed to d neighbors . But in the corresponding line graph , the information will be passed to d× ( d− 1 ) /2 nodes . The topology structure in the line graph L ( G ) will overstate the importance of features for nodes with high degrees in the graph . On the contrary , the nodes with smaller degrees will be relatively understated , thereby leading to biased topology information encoded in the line graph . Note that popular adjacency matrix normalization methods ( Kipf & Welling , 2017 ; Veličković et al. , 2017 ; Gao & Ji , 2019 ; Gong & Cheng , 2019 ) can not address this issue . 3.2 WEIGHTED LINE GRAPH . In the previous section , we show that the line graph L ( G ) constructed from the original graph G encodes biased graph topology information . To address this issue , we propose to construct a weighted line graph that assigns normalized weights to edges . In a regular line graph L ( G ) , each edge is assigned an equal weight of 1 , thereby leading to a biased encoding of the graph topology information . To correct the bias , we need to normalize edge weights in the line graph . Considering each edge in G has two ends , it is intuitive to normalize the weighted degree of the corresponding node in L ( G ) to 2 . To this end , the weight for an edge in the adjacency matrix F of L ( G ) is computed as : F ( a , b ) , ( b , c ) = { 1 Db if a 6= c 1 Db + 1Da , if a = c ( 1 ) where a , b , and c are nodes in the graph G , ( a , b ) and ( b , c ) are edges in the graph G that are connected by the node b. Db is the degree of the node b in the graph G. To facilitate the message passing operation , we add self-loops on the weighted line graph WL ( G ) . The weights for self-loop edges computed by the second case consider the fact that they are self-connected by both ends . Figure 2 illustrates an example of a graph and its corresponding weighted line graph . Theorem 1 . Given the edge weights in the weighted line graph WL ( G ) defined by Eq . ( 1 ) , the weighted degree for a node ( a , b ) in WL ( G ) is 2 . The proof of Theorem 1 is provided in the supplementary material . By constructing the weighted line graph with normalized edge weights defined in Eq . ( 1 ) , each node ( a , b ) has a weighted degree of 2 . Given a node a with a degree of d , it has d related edges in G and d related nodes in L ( G ) . The message passing frequency of node a ’ s features in the weighted line graph WL ( G ) is ∑d i=1 2 = O ( d ) , which is consistent with that in the original graph G. Thus , the weighted line graph encodes the topology information of the original graph in an unbiased way . 3.3 WEIGHTED LINE GRAPH CONVOLUTION LAYER . In this section , we propose the weighted line graph convolution layer ( WLGCL ) that leverages our proposed weighted line graph for feature representations learnings . In this layer , node features are passed and aggregated in both the original graph G and the corresponding weighted line graph WL ( G ) . Suppose an undirected attributed graph G has N nodes and E edges . Each node and each edge in the graph contains Cn and Ce features , respectively . In the layer ` , an adjacency matrix A ( ` ) ∈ RN×N , a node feature matrix X ( ` ) ∈ RN×Cn , and a edge feature matrix Y ( ` ) ∈ RE×Ce are used to represent the graph connectivity , node features , and edge features , respectively . Here , we construct the adjacency matrix F ( ` ) ∈ RE×E of the corresponding weighted line graph . The layer-wise propagation rule of the weighted line graph convolution layer ` is defined as : Ŷ ( ` ) = F ( ` ) Y ( ` ) , ∈RE×Ce ( 2 ) K ( ` ) L = B ( ` ) Ŷ ( ` ) , ∈RN×Ce ( 3 ) K ( ` ) = A ( ` ) X ( ` ) , ∈RN×Cn ( 4 ) X ( ` +1 ) = K ( ` ) W ( ` ) +K ( ` ) L W ( ` ) L , ∈R N×C′ ( 5 ) where W ( ` ) ∈ RCn×C′ and W ( ` ) L ∈ RCe×C ′ are matrices of trainable parameters . B ( ` ) ∈ RN×E is the incidence matrix of the graph G that shows the connectivity between nodes and edges . To enable message passing on the line graph L ( G ) , each edge in the graph G needs to have features . However , edge features are not available on some graphs . To address this issue , we can compute features for an edge ( a , b ) by summing up features of its two end nodes : Y ( ` ) ( a , b ) = X ( ` ) a +X ( ` ) b . Here , we use the summation operation to ensure the permutation invariant property in this layer . Then , we perform message passing and aggregation on the line graph in Eq . ( 2 ) . With updated edges features , Eq . ( 3 ) generates new nodes features with edge features Y ( ` ) . Eq . ( 4 ) performs feature passing and aggregation on the graph G , which leads to aggregated nodes features K ( ` ) . In Eq . ( 5 ) , aggregated features from the graph G and the line graph L ( G ) are transformed and combined , which produces the output feature matrix X ( ` +1 ) . Note that we can apply popular adjacency matrix normalization methods ( Kipf & Welling , 2017 ) on the adjacency matrix A ( ` ) , the line graph adjacency matrix F ( ` ) , and the incidence matrix B ( ` ) . In the WLGCL , we use the line graph structure as a complement to the original graph structure , thereby leading to enhanced feature learnings . Here , we use a simple feature aggregation method as used in GCN ( Kipf & Welling , 2017 ) . Other complicated and advanced feature aggregation methods such as GAT ( Veličković et al. , 2017 ) can be easily applied by changing Eq . ( 2 ) and Eq . ( 4 ) accordingly . Figure 3 provides an illustration of our WLGCL .
This paper introduces a weighted line graph formulation (WLGCL) which corrects the over-counting ("bias") of high-degree node features in a line-graph based convolutional network. Further, the paper uses Incidence Matrix to implement WLGCL updates which reduces the space complexity ($O(N^4) \to O(N^3)$) and time complexity ($O(N^4 C) \to O(N^4)$) compared to the naive implementation. The paper shows empirical evaluation on downstream task of graph classification and shows gain in accuracy.
SP:c3236039988295311cdf505107bffa85b883e680
Weighted Line Graph Convolutional Networks
1 INTRODUCTION . Graph neural networks ( Gori et al. , 2005 ; Scarselli et al. , 2009 ; Hamilton et al. , 2017 ) have shown to be competent in solving challenging tasks in the field of network embedding . Many tasks have been significantly advanced by graph deep learning methods such as node classification tasks ( Kipf & Welling , 2017 ; Veličković et al. , 2017 ; Gao et al. , 2018 ) , graph classification tasks ( Ying et al. , 2018 ; Zhang et al. , 2018 ) , link prediction tasks ( Zhang & Chen , 2018 ; Zhou et al. , 2019 ) , and community detection tasks ( Chen et al. , 2019 ) . Currently , most graph neural networks capture the relationships among nodes through message passing operations . Recently , some works ( Chen et al. , 2019 ) use extra graph structures such as line graphs to enhance message passing operations in graph neural networks from different graph perspectives . A line graph is a graph that is derived from an original graph to represent connectivity between edges in the original graph . Since line graphs can encode the topology information , message passing operations on line graphs can enhance network embeddings in graph neural networks . However , graph neural networks that leverage line graph structures need to deal with two challenging issues ; those are bias and inefficiency . Topology information in original graphs is encoded in line graphs but in a biased way . In particular , node features are either overstated or understated depending on their degrees . Besides , line graphs can be much bigger graphs than original graphs depending on the graph density . Message passing operations of graph neural networks on line graphs lead to significant use of computational resources . In this work , we propose to construct a weighted line graph that can correct biases in encoded topology information of line graphs . To this end , we assign each edge in a line graph a normalized weight such that each node in the line graph has a weighted degree of 2 . In this weighted line graph , the dynamics of node features are the same as those in its original graph . Based on our weighted line graph , we propose a weighted line graph convolution layer ( WLGCL ) that performs a message passing operation on both original graph structures and weighted line graph structures . To address inefficiency issues existing in graph neural networks that use line graph structures , we further propose to implement our WLGCL via an incidence matrix , which can dramatically reduce the usage of computational resources . Based on our WLGCL , we build a family of weighted line graph convolutional networks ( WLGCNs ) . We evaluate our methods on graph classification tasks and show that WLGCNs consistently outperform previous state-of-the-art models . Experiments on simulated data demonstrate the efficiency advantage of our implementation . 2 BACKGROUND AND RELATED WORK . In graph theory , a line graph is a graph derived from an undirected graph . It represents the connectivity among edges in the original graph . Given a graph G , the corresponding line graph L ( G ) is constructed by using edges in G as vertices in L ( G ) . Two nodes in L ( G ) are adjacent if they share a common end node in the graph G ( Golumbic , 2004 ) . Note that the edges ( a , b ) and ( b , a ) in an undirected graph G correspond to the same vertex in the line graph L ( G ) . The Whitney graph isomorphism theorem ( Thatte , 2005 ) stated that a line graph has a one-to-one correspondence to its original graph . This theorem guarantees that the line graph can encode the topology information in the original graph . Recently , some works ( Monti et al. , 2018 ; Chen et al. , 2019 ; Bandyopadhyay et al. , 2019 ; Jiang et al. , 2019 ) proposes to use the line graph structure to enhance the message passing operations in graph neural networks . Since the line graph can encode the topology information , the message passing on the line graph can enhance the network embeddings in graph neural networks . In graph neural networks that use line graph structures , features are passed and transformed in both the original graph structures and the line graph structures , thereby leading to better feature learnings and performances . 3 WEIGHTED LINE GRAPH CONVOLUTIONAL NETWORKS . In this work , we propose the weighted line graph to address the bias in the line graph when encoding graph topology information . Based on our weighted line graph , we propose the weighted line graph convolution layer ( WLGCL ) for better feature learning by leveraging line graph structures . Besides , graph neural networks using line graphs consume excessive computational resources . To solve the inefficiency issue , we propose to use the incidence matrix to implement the WLGCL , which can dramatically reduce the usage of computational resources . 3.1 BENEFIT AND BIAS OF LINE GRAPH REPRESENTATIONS . In this section , we describe the benefit and bias of using line graph representations . Benefit In message-passing operations , edges are usually given equal importance and edge features are not well explored . This can constrain the capacity of GNNs , especially on graphs with edge features . In the chemistry domain , a compound can be converted into a graph , where atoms are nodes and chemical bonds are edges . On such kinds of graphs , edges have different properties and thus different importance . However , message-passing operations underestimate the importance of edges . To address this issue , the line graph structure can be used to leverage edge features and different edge importance ( Jiang et al. , 2019 ; Chen et al. , 2019 ; Zhu et al. , 2019 ) . The line graph , by its nature , enables graph neural networks to encode and propagate edge features in the graph . The line graph neural networks that take advantage of line graph structures have shown to be promising on graph-related tasks ( Chen et al. , 2019 ; Xiong et al. , 2019 ; Yao et al. , 2019 ) . By encoding node and edge features simultaneously , line graph neural networks enhance the feature learning on graphs . Bias According to the Whitney graph isomorphism theorem , the line graph L ( G ) encodes the topology information of the original graph G , but the dynamics and topology of G are not correctly represented in L ( G ) ( Evans & Lambiotte , 2009 ) . As described in the previous section , each edge in the graph G corresponds to a vertex in the line graph L ( G ) . The features of each edge contain features of its two end nodes . A vertex with a degree d in the original graph G will generate d× ( d− 1 ) /2 edges in the line graph L ( G ) . The message passing frequency of this node ’ s features will change from O ( d ) in the original graph to O ( d2 ) in the line graph . From this point , the line graph encodes the topology information in the original graph but in a biased way . In the original graph , a node ’ s features will be passed to d neighbors . But in the corresponding line graph , the information will be passed to d× ( d− 1 ) /2 nodes . The topology structure in the line graph L ( G ) will overstate the importance of features for nodes with high degrees in the graph . On the contrary , the nodes with smaller degrees will be relatively understated , thereby leading to biased topology information encoded in the line graph . Note that popular adjacency matrix normalization methods ( Kipf & Welling , 2017 ; Veličković et al. , 2017 ; Gao & Ji , 2019 ; Gong & Cheng , 2019 ) can not address this issue . 3.2 WEIGHTED LINE GRAPH . In the previous section , we show that the line graph L ( G ) constructed from the original graph G encodes biased graph topology information . To address this issue , we propose to construct a weighted line graph that assigns normalized weights to edges . In a regular line graph L ( G ) , each edge is assigned an equal weight of 1 , thereby leading to a biased encoding of the graph topology information . To correct the bias , we need to normalize edge weights in the line graph . Considering each edge in G has two ends , it is intuitive to normalize the weighted degree of the corresponding node in L ( G ) to 2 . To this end , the weight for an edge in the adjacency matrix F of L ( G ) is computed as : F ( a , b ) , ( b , c ) = { 1 Db if a 6= c 1 Db + 1Da , if a = c ( 1 ) where a , b , and c are nodes in the graph G , ( a , b ) and ( b , c ) are edges in the graph G that are connected by the node b. Db is the degree of the node b in the graph G. To facilitate the message passing operation , we add self-loops on the weighted line graph WL ( G ) . The weights for self-loop edges computed by the second case consider the fact that they are self-connected by both ends . Figure 2 illustrates an example of a graph and its corresponding weighted line graph . Theorem 1 . Given the edge weights in the weighted line graph WL ( G ) defined by Eq . ( 1 ) , the weighted degree for a node ( a , b ) in WL ( G ) is 2 . The proof of Theorem 1 is provided in the supplementary material . By constructing the weighted line graph with normalized edge weights defined in Eq . ( 1 ) , each node ( a , b ) has a weighted degree of 2 . Given a node a with a degree of d , it has d related edges in G and d related nodes in L ( G ) . The message passing frequency of node a ’ s features in the weighted line graph WL ( G ) is ∑d i=1 2 = O ( d ) , which is consistent with that in the original graph G. Thus , the weighted line graph encodes the topology information of the original graph in an unbiased way . 3.3 WEIGHTED LINE GRAPH CONVOLUTION LAYER . In this section , we propose the weighted line graph convolution layer ( WLGCL ) that leverages our proposed weighted line graph for feature representations learnings . In this layer , node features are passed and aggregated in both the original graph G and the corresponding weighted line graph WL ( G ) . Suppose an undirected attributed graph G has N nodes and E edges . Each node and each edge in the graph contains Cn and Ce features , respectively . In the layer ` , an adjacency matrix A ( ` ) ∈ RN×N , a node feature matrix X ( ` ) ∈ RN×Cn , and a edge feature matrix Y ( ` ) ∈ RE×Ce are used to represent the graph connectivity , node features , and edge features , respectively . Here , we construct the adjacency matrix F ( ` ) ∈ RE×E of the corresponding weighted line graph . The layer-wise propagation rule of the weighted line graph convolution layer ` is defined as : Ŷ ( ` ) = F ( ` ) Y ( ` ) , ∈RE×Ce ( 2 ) K ( ` ) L = B ( ` ) Ŷ ( ` ) , ∈RN×Ce ( 3 ) K ( ` ) = A ( ` ) X ( ` ) , ∈RN×Cn ( 4 ) X ( ` +1 ) = K ( ` ) W ( ` ) +K ( ` ) L W ( ` ) L , ∈R N×C′ ( 5 ) where W ( ` ) ∈ RCn×C′ and W ( ` ) L ∈ RCe×C ′ are matrices of trainable parameters . B ( ` ) ∈ RN×E is the incidence matrix of the graph G that shows the connectivity between nodes and edges . To enable message passing on the line graph L ( G ) , each edge in the graph G needs to have features . However , edge features are not available on some graphs . To address this issue , we can compute features for an edge ( a , b ) by summing up features of its two end nodes : Y ( ` ) ( a , b ) = X ( ` ) a +X ( ` ) b . Here , we use the summation operation to ensure the permutation invariant property in this layer . Then , we perform message passing and aggregation on the line graph in Eq . ( 2 ) . With updated edges features , Eq . ( 3 ) generates new nodes features with edge features Y ( ` ) . Eq . ( 4 ) performs feature passing and aggregation on the graph G , which leads to aggregated nodes features K ( ` ) . In Eq . ( 5 ) , aggregated features from the graph G and the line graph L ( G ) are transformed and combined , which produces the output feature matrix X ( ` +1 ) . Note that we can apply popular adjacency matrix normalization methods ( Kipf & Welling , 2017 ) on the adjacency matrix A ( ` ) , the line graph adjacency matrix F ( ` ) , and the incidence matrix B ( ` ) . In the WLGCL , we use the line graph structure as a complement to the original graph structure , thereby leading to enhanced feature learnings . Here , we use a simple feature aggregation method as used in GCN ( Kipf & Welling , 2017 ) . Other complicated and advanced feature aggregation methods such as GAT ( Veličković et al. , 2017 ) can be easily applied by changing Eq . ( 2 ) and Eq . ( 4 ) accordingly . Figure 3 provides an illustration of our WLGCL .
The paper proposed a GNN model based on a weighted line graph, which adds weights to the line graph for the original input graph in a node/graph property prediction task. The line graph is a graph built on the original graph but with edges as nodes. A new convolution called weighted line graph convolution layer (WLGCL) is proposed to overcome the issue of "biased topological information" of the line graph. The weights for the line graph in WLGCL are computed based on the node degree of the original graph, which implies the node degree in the line graph is always 2. The WLGCL can be implemented for different kinds of graph convolution, which rule incorporates graph connectivity, node features and edge features.
SP:c3236039988295311cdf505107bffa85b883e680
Learning-Augmented Sketches for Hessians
Sketching is a dimensionality reduction technique where one compresses a matrix by often random linear combinations . A line of work has shown how to sketch the Hessian to speed up each iteration in a second order method , but such sketches usually depend only on the matrix at hand , and in a number of cases are even oblivious to the input matrix . One could instead hope to learn a distribution on sketching matrices that is optimized for the specific distribution of input matrices . We show how to design learned sketches for the Hessian in the context of second order methods , where we learn potentially different sketches for the different iterations of an optimization procedure . We show empirically that learned sketches , compared with their “ non-learned ” counterparts , improve the approximation accuracy for important problems , including LASSO , SVM , and matrix estimation with nuclear norm constraints . Several of our schemes can be proven to perform no worse than their unlearned counterparts . 1 INTRODUCTION . Large-scale optimization problems are abundant and solving them efficiently requires powerful tools to make the computation practical . This is especially true of second order methods which often are less practical than first order ones . Although second order methods may have many fewer iterations , each iteration could involve inverting a large Hessian , which is cubic time ; in contrast , first order methods such as stochastic gradient descent are linear time per iteration . In order to make second order methods faster in each iteration , a large body of work has looked at dimensionality reduction techniques , such as sampling , sketching , or approximating the Hessian by a low rank matrix . See , for example , ( Gower et al. , 2016 ; Xu et al. , 2016 ; Pilanci & Wainwright , 2016 ; 2017 ; Doikov & Richtárik , 2018 ; Gower et al. , 2018 ; Roosta-Khorasani & Mahoney , 2019 ; Gower et al. , 2019 ; Kylasa et al. , 2019 ; Xu et al. , 2020 ; Li et al. , 2020 ) . Our focus is on sketching techniques , which often consist of multiplying the Hessian by a random matrix chosen independently of the Hessian . Sketching has a long history in theoretical computer science ( see , e.g. , ( Woodruff , 2014 ) for a survey ) , and we describe such methods more below . A special case of sketching is sampling , which in practice is often uniform sampling , and hence oblivious to properties of the actual matrix . Other times the sampling is non-uniform , and based on squared norms of submatrices of the Hessian or on the so-called leverage scores of the Hessian . Our focus is on sketching techniques , and in particular , we follow the framework of ( Pilanci & Wainwright , 2016 ; 2017 ) which introduce the iterative Hessian sketch and Newton sketch , as well as the high accuracy refinement given in ( van den Brand et al. , 2020 ) . If one were to run Newton ’ s method to find a point where the gradient is zero , in each iteration one needs to solve an equation involving the current Hessian and gradient to find the update direction . When the Hessian can be decomposed as A > A for an n × d matrix A with n d , then sketching is particularly suitable . The iterative Hessian sketch was proposed in ( Pilanci & Wainwright , 2016 ) , where A is replaced with S · A , for a random matrix S which could be i.i.d . Gaussian or drawn from a more structured family of random matrices such as the Subsampled Randomized Hadamard Transforms or COUNTSKETCH matrices ; the latter was done in ( Cormode & Dickens , 2019 ) . The Newton sketch was proposed in ( Pilanci & Wainwright , 2017 ) , which extended sketching methods beyond constrained least-squares problems to any twice differentiable function subject to a closed convex constraint set . Using this sketch inside of interior point updates has led to much faster algorithms for an extensive body of convex optimization problems Pilanci & Wainwright ( 2017 ) . By instead using sketching as a preconditioner , an application of the work of ( van den Brand et al. , 2020 ) ( see Appendix E ) was able to improve the dependence on the accuracy parameter to logarithmic . In general , the idea behind sketching is the following . One chooses a random matrix S , drawn from a certain family of random matrices , and computes SA . IfA is tall-and-skinny , then S is short-and-fat , and thus SA is a small , roughly square matrix . Moreover , SA preserves important properties of A . One typically desired property is that S is a subspace embedding , meaning that simultaneously for all x , one has ‖SAx‖2 = ( 1± ) ‖Ax‖2 . An observation exploited in ( Cormode & Dickens , 2019 ) , building off of the COUNT-SKETCH random matrices S introduced in randomized linear algebra in ( Clarkson & Woodruff , 2017 ) , is that if S contains O ( 1 ) non-zero entries per column , then SA can be computed in O ( nnz ( A ) ) time , where nnz ( A ) denotes the number of nonzeros in A . This is sometimes referred to as input sparsity running time . Each iteration of a second order method often involves solving an equation of the form A > Ax = A > b , where A > A is the Hessian and b is the gradient . For a number of problems , one has access to a matrixA ∈ Rn×d with n d , which is also an assumption made in Pilanci & Wainwright ( 2017 ) . Therefore , the solution x is the minimizer to a constrained least squares regression problem : min x∈C 1 2 ‖Ax− b‖22 , ( 1 ) where C is a convex constraint set in Rd . For the unconstrained case ( C = Rd ) , various classical sketches that attain the subspace embedding property can provably yield high-accuracy approximate solutions ( see , e.g. , ( Sarlos , 2006 ; Nelson & Nguyên , 2013 ; Cohen , 2016 ; Clarkson & Woodruff , 2017 ) ) ; for the general constrained case , the Iterative Hessian Sketch ( IHS ) was proposed by Pilanci & Wainwright ( 2016 ) as an effective approach and Cormode & Dickens ( 2019 ) employed sparse sketches to achieve input-sparsity running time for IHS . All sketches used in these results are dataoblivious random sketches . Learned Sketching . In the last few years , an exciting new notion of learned sketching has emerged . Here the idea is that one often sees independent samples of matrices A from a distribution D , and can train a model to learn the entries in a sketching matrix S on these samples . When given a future sample B , also drawn from D , the learned sketching matrix S will be such that S · B is a much more accurate compression of B than if S had the same number of rows and were instead drawn without knowledge of D. Moreover , the learned sketch S is often sparse , therefore allowing S · B to be applied very quickly . For large datasets B this is particularly important , and distinguishes this approach from other transfer learning approaches , e.g. , ( Andrychowicz et al. , 2016 ) , which can be considerably slower in this context . Learned sketches were first used in the data stream context for finding frequent items ( Hsu et al. , 2019 ) and have subsequently been applied to a number of other problems on large data . For example , Indyk et al . ( 2019 ) showed that learned sketches yield significantly small errors for low rank approximation . In ( Dong et al. , 2020 ) , significant improvements to nearest neighbor search were obtained via learned sketches . More recently , Liu et al . ( 2020 ) extended learned sketches to several problems in numerical linear algebra , including least-squares and robust regression , as well as k-means clustering . Despite the number of problems that learned sketches have been applied to , they have not been applied to convex optimization in general . Given that such methods often require solving a large overdetermined least squares problem in each iteration , it is hopeful that one can improve each iteration using learned sketches . However , a number of natural questions arise : ( 1 ) how should we learn the sketch ? ( 2 ) should we apply the same learned sketch in each iteration , or learn it in the next iteration by training on a data set involving previously learned sketches from prior iterations ? Our Contributions . In this work we answer the above questions and derive the first learned sketches for a wide number of problems in convex optimization . Namely , we apply learned sketches to constrained least-squares problems , including LASSO , support vector machines ( SVM ) , and matrix regression with nuclear norm constraints . We show empirically that learned sketches demonstrate superior accuracy over random oblivious sketches for each of these problems . Specifically , compared with three classical sketches ( Gaussian , COUNT-SKETCH and Sparse Johnson-Lindenstrauss Transforms ; see definitions in Section 2 ) , the learned sketches in each of the first few iterations • improve the LASSO error f ( x ) − f ( x∗ ) by 80 % to 87 % in two real-world datasets , where f ( x ) = 12 ‖Ax− b‖ 2 2 + ‖x‖1 ; • improve the dual SVM error f ( x ) − f ( x∗ ) by 10–30 % for a synthetic and a real-world dataset , as well as by 30 % –40 % for another real-world dataset , where f ( x ) = ‖Bx‖22 ; • improve the matrix estimation error f ( X ) − f ( X∗ ) by at least 30 % for a synthetic dataset and at least 95 % for a real-world data set , where f ( X ) = ‖AX −B‖2F . Therefore , the learned sketches attain a smaller error within the same number of iterations , and in fact , within the same limit on the maximum runtime , since our sketches are extremely sparse ( see below ) . We also study the general framework of convex optimization in ( van den Brand et al. , 2020 ) , and show that also for sketching-based preconditioning , learned sketches demonstrate considerable advantages . More precisely , by using a learned sketch with the same number of rows as an oblivious sketch , we are able to obtain a much better preconditioner with the same overall running time . All of our learned sketches S are extremely sparse , meaning that they contain a single non-zero entry per column . Following the previous work of ( Indyk et al. , 2019 ) , we choose the position of the nonzero entry in each column to be uniformly random , while the value of the nonzero entry is learned . This already demonstrates a significant advantage over non-learned sketches , and has a fast training time . Importantly , because of such sparsity , our sketches can be applied in input sparsity time given a new optimization problem . We also provide several theoretical results , showing how to algorithmically use learned sketches in conjunction with random sketches so as to do no worse than random sketches .
The paper proposed a learned variant of the well-known iterative Hessian sketch (IHS) method of Pilanci and Wainwright, for efficiently solving least-squares regression. The proposed method is essentially a learned variant of the count-sketch, where the positions of the non-zero entries are random while the value is learned. While getting a learned variant for IHS is an interesting direction, the current theoretical contribution of this paper is only incremental, and most importantly, the reviewer is unconvinced for the practicality of the current approach.
SP:4647fc008073e5ee4e432f84e645aedb7faf736d
Learning-Augmented Sketches for Hessians
Sketching is a dimensionality reduction technique where one compresses a matrix by often random linear combinations . A line of work has shown how to sketch the Hessian to speed up each iteration in a second order method , but such sketches usually depend only on the matrix at hand , and in a number of cases are even oblivious to the input matrix . One could instead hope to learn a distribution on sketching matrices that is optimized for the specific distribution of input matrices . We show how to design learned sketches for the Hessian in the context of second order methods , where we learn potentially different sketches for the different iterations of an optimization procedure . We show empirically that learned sketches , compared with their “ non-learned ” counterparts , improve the approximation accuracy for important problems , including LASSO , SVM , and matrix estimation with nuclear norm constraints . Several of our schemes can be proven to perform no worse than their unlearned counterparts . 1 INTRODUCTION . Large-scale optimization problems are abundant and solving them efficiently requires powerful tools to make the computation practical . This is especially true of second order methods which often are less practical than first order ones . Although second order methods may have many fewer iterations , each iteration could involve inverting a large Hessian , which is cubic time ; in contrast , first order methods such as stochastic gradient descent are linear time per iteration . In order to make second order methods faster in each iteration , a large body of work has looked at dimensionality reduction techniques , such as sampling , sketching , or approximating the Hessian by a low rank matrix . See , for example , ( Gower et al. , 2016 ; Xu et al. , 2016 ; Pilanci & Wainwright , 2016 ; 2017 ; Doikov & Richtárik , 2018 ; Gower et al. , 2018 ; Roosta-Khorasani & Mahoney , 2019 ; Gower et al. , 2019 ; Kylasa et al. , 2019 ; Xu et al. , 2020 ; Li et al. , 2020 ) . Our focus is on sketching techniques , which often consist of multiplying the Hessian by a random matrix chosen independently of the Hessian . Sketching has a long history in theoretical computer science ( see , e.g. , ( Woodruff , 2014 ) for a survey ) , and we describe such methods more below . A special case of sketching is sampling , which in practice is often uniform sampling , and hence oblivious to properties of the actual matrix . Other times the sampling is non-uniform , and based on squared norms of submatrices of the Hessian or on the so-called leverage scores of the Hessian . Our focus is on sketching techniques , and in particular , we follow the framework of ( Pilanci & Wainwright , 2016 ; 2017 ) which introduce the iterative Hessian sketch and Newton sketch , as well as the high accuracy refinement given in ( van den Brand et al. , 2020 ) . If one were to run Newton ’ s method to find a point where the gradient is zero , in each iteration one needs to solve an equation involving the current Hessian and gradient to find the update direction . When the Hessian can be decomposed as A > A for an n × d matrix A with n d , then sketching is particularly suitable . The iterative Hessian sketch was proposed in ( Pilanci & Wainwright , 2016 ) , where A is replaced with S · A , for a random matrix S which could be i.i.d . Gaussian or drawn from a more structured family of random matrices such as the Subsampled Randomized Hadamard Transforms or COUNTSKETCH matrices ; the latter was done in ( Cormode & Dickens , 2019 ) . The Newton sketch was proposed in ( Pilanci & Wainwright , 2017 ) , which extended sketching methods beyond constrained least-squares problems to any twice differentiable function subject to a closed convex constraint set . Using this sketch inside of interior point updates has led to much faster algorithms for an extensive body of convex optimization problems Pilanci & Wainwright ( 2017 ) . By instead using sketching as a preconditioner , an application of the work of ( van den Brand et al. , 2020 ) ( see Appendix E ) was able to improve the dependence on the accuracy parameter to logarithmic . In general , the idea behind sketching is the following . One chooses a random matrix S , drawn from a certain family of random matrices , and computes SA . IfA is tall-and-skinny , then S is short-and-fat , and thus SA is a small , roughly square matrix . Moreover , SA preserves important properties of A . One typically desired property is that S is a subspace embedding , meaning that simultaneously for all x , one has ‖SAx‖2 = ( 1± ) ‖Ax‖2 . An observation exploited in ( Cormode & Dickens , 2019 ) , building off of the COUNT-SKETCH random matrices S introduced in randomized linear algebra in ( Clarkson & Woodruff , 2017 ) , is that if S contains O ( 1 ) non-zero entries per column , then SA can be computed in O ( nnz ( A ) ) time , where nnz ( A ) denotes the number of nonzeros in A . This is sometimes referred to as input sparsity running time . Each iteration of a second order method often involves solving an equation of the form A > Ax = A > b , where A > A is the Hessian and b is the gradient . For a number of problems , one has access to a matrixA ∈ Rn×d with n d , which is also an assumption made in Pilanci & Wainwright ( 2017 ) . Therefore , the solution x is the minimizer to a constrained least squares regression problem : min x∈C 1 2 ‖Ax− b‖22 , ( 1 ) where C is a convex constraint set in Rd . For the unconstrained case ( C = Rd ) , various classical sketches that attain the subspace embedding property can provably yield high-accuracy approximate solutions ( see , e.g. , ( Sarlos , 2006 ; Nelson & Nguyên , 2013 ; Cohen , 2016 ; Clarkson & Woodruff , 2017 ) ) ; for the general constrained case , the Iterative Hessian Sketch ( IHS ) was proposed by Pilanci & Wainwright ( 2016 ) as an effective approach and Cormode & Dickens ( 2019 ) employed sparse sketches to achieve input-sparsity running time for IHS . All sketches used in these results are dataoblivious random sketches . Learned Sketching . In the last few years , an exciting new notion of learned sketching has emerged . Here the idea is that one often sees independent samples of matrices A from a distribution D , and can train a model to learn the entries in a sketching matrix S on these samples . When given a future sample B , also drawn from D , the learned sketching matrix S will be such that S · B is a much more accurate compression of B than if S had the same number of rows and were instead drawn without knowledge of D. Moreover , the learned sketch S is often sparse , therefore allowing S · B to be applied very quickly . For large datasets B this is particularly important , and distinguishes this approach from other transfer learning approaches , e.g. , ( Andrychowicz et al. , 2016 ) , which can be considerably slower in this context . Learned sketches were first used in the data stream context for finding frequent items ( Hsu et al. , 2019 ) and have subsequently been applied to a number of other problems on large data . For example , Indyk et al . ( 2019 ) showed that learned sketches yield significantly small errors for low rank approximation . In ( Dong et al. , 2020 ) , significant improvements to nearest neighbor search were obtained via learned sketches . More recently , Liu et al . ( 2020 ) extended learned sketches to several problems in numerical linear algebra , including least-squares and robust regression , as well as k-means clustering . Despite the number of problems that learned sketches have been applied to , they have not been applied to convex optimization in general . Given that such methods often require solving a large overdetermined least squares problem in each iteration , it is hopeful that one can improve each iteration using learned sketches . However , a number of natural questions arise : ( 1 ) how should we learn the sketch ? ( 2 ) should we apply the same learned sketch in each iteration , or learn it in the next iteration by training on a data set involving previously learned sketches from prior iterations ? Our Contributions . In this work we answer the above questions and derive the first learned sketches for a wide number of problems in convex optimization . Namely , we apply learned sketches to constrained least-squares problems , including LASSO , support vector machines ( SVM ) , and matrix regression with nuclear norm constraints . We show empirically that learned sketches demonstrate superior accuracy over random oblivious sketches for each of these problems . Specifically , compared with three classical sketches ( Gaussian , COUNT-SKETCH and Sparse Johnson-Lindenstrauss Transforms ; see definitions in Section 2 ) , the learned sketches in each of the first few iterations • improve the LASSO error f ( x ) − f ( x∗ ) by 80 % to 87 % in two real-world datasets , where f ( x ) = 12 ‖Ax− b‖ 2 2 + ‖x‖1 ; • improve the dual SVM error f ( x ) − f ( x∗ ) by 10–30 % for a synthetic and a real-world dataset , as well as by 30 % –40 % for another real-world dataset , where f ( x ) = ‖Bx‖22 ; • improve the matrix estimation error f ( X ) − f ( X∗ ) by at least 30 % for a synthetic dataset and at least 95 % for a real-world data set , where f ( X ) = ‖AX −B‖2F . Therefore , the learned sketches attain a smaller error within the same number of iterations , and in fact , within the same limit on the maximum runtime , since our sketches are extremely sparse ( see below ) . We also study the general framework of convex optimization in ( van den Brand et al. , 2020 ) , and show that also for sketching-based preconditioning , learned sketches demonstrate considerable advantages . More precisely , by using a learned sketch with the same number of rows as an oblivious sketch , we are able to obtain a much better preconditioner with the same overall running time . All of our learned sketches S are extremely sparse , meaning that they contain a single non-zero entry per column . Following the previous work of ( Indyk et al. , 2019 ) , we choose the position of the nonzero entry in each column to be uniformly random , while the value of the nonzero entry is learned . This already demonstrates a significant advantage over non-learned sketches , and has a fast training time . Importantly , because of such sparsity , our sketches can be applied in input sparsity time given a new optimization problem . We also provide several theoretical results , showing how to algorithmically use learned sketches in conjunction with random sketches so as to do no worse than random sketches .
Sketching is a popular technique in numerical linear algebra for achieving various desirable properties (e.g., lower complexity, one pass methods). The present paper considers a particular kind of sketch for which the sketch matrix is learned from data. It shows how such learned sketches can be used in two types of problems: Hessian sketching (Sec. 3) and Hessian regression (Sec. 4). The authors give both algorithms and provide theoretical guarantees. They also apply these techniques to a number of both synthetic and real datasets in the experiments. For the most part, the experiments indicate that the proposed methods give a consistent, but not necessarily very large, improvement.
SP:4647fc008073e5ee4e432f84e645aedb7faf736d
Wiring Up Vision: Minimizing Supervised Synaptic Updates Needed to Produce a Primate Ventral Stream
1 INTRODUCTION . Particular artificial neural networks ( ANNs ) are the leading mechanistic models of visual processing in the primate visual ventral stream ( Schrimpf et al. , 2020 ; Kubilius et al. , 2019 ; Dapello et al. , 2020 ) . After training on large-scale datasets such as ImageNet ( Deng et al. , 2009 ) by updating weights based on labeled images , internal representations of these ANNs partly match neural representations in the primate visual system from early visual cortex V1 through V2 and V4 to high-level IT ( Yamins et al. , 2014 ; Khaligh-Razavi & Kriegeskorte , 2014 ; Cadena et al. , 2017 ; Tang et al. , 2018 ; Schrimpf et al. , 2018 ; Kubilius et al. , 2019 ) , and model object recognition behavior can partly account for primate object recognition behavior ( Rajalingham et al. , 2018 ; Schrimpf et al. , 2018 ) . Recently , such models have been criticized due to how their learning departs from brain development because they require many more labeled examples than is reasonable for biological systems ’ limited waking ( visual ) experience ( Seibert , 2018 ; Zador , 2019 ) . For example , all the current top models of the primate ventral stream rely on trillions of supervised synaptic updates , i.e . the training of millions of parameters with millions of labeled examples over dozens of epochs . In biological systems , on the other hand , the at-birth synaptic wiring as encoded by the genome already provides structure that is sufficient for macaques to exhibit adult-like visual representations after a few months ( Movshon & Kiorpes , 1988 ; Kiorpes & Movshon , 2004 ; Seibert , 2018 ) , which restricts the amount of experience dependent learning . Furthermore , different neuronal populations in cortical circuits undergo different plasticity mechanisms : neurons in supragranular and infragranular layers adapt more rapidly than those in layer 4 which receives inputs from lower areas ( Diamond et al. , 1994 ; Schoups et al. , 2001 ) , while current artificial synapses , on the other hand , all change under the same plasticity mechanism . While current models provide a basic understanding of the neural mechanisms of adult ventral stream inference , can we start to build models that provide an understanding of how the ventral stream “ wires itself up ” – models of the initial state at birth and how it develops during postnatal life ? Related Work . Several papers have addressed related questions in machine learning : Distilled student networks can be trained on the outputs of a teacher network ( Hinton et al. , 2015 ; Cho & Hariharan , 2019 ; Tian et al. , 2019 ) , and , in pruning studies , networks with knocked out synapses perform reasonably well ( Cheney et al. , 2017 ; Morcos et al. , 2018 ) , demonstrating that models with many trained parameters can be compressed ( Wu et al. , 2018 ) which is further supported by the convergence of training gradients onto a small subspace ( Gur-Ari et al. , 2018 ) . Tian et al . ( 2020 ) show that a pre-trained encoder ’ s fixed features can be used to train a thin decoder with performance close to full fine-tuning and recent theoretically-driven work has found that training only BatchNorm layers ( Frankle et al. , 2021 ) or determining the right parameters from a large pool of weights ( Frankle et al. , 2019 ; Ramanujan et al. , 2019 ) can already achieve high classification accuracy . Unsupervised approaches are also starting to develop useful representations without requiring many labels by inferring internal labels such as clusters or representational similarity ( Caron et al. , 2018 ; Wu et al. , 2018 ; Zhuang et al. , 2019 ; Hénaff et al. , 2019 ; Konkle & Alvarez , 2020 ; Zhuang et al. , 2020 ) . Many attempts are also being made to make the learning algorithms themselves more biologically plausible ( e.g . Lillicrap et al. , 2016 ; Scellier & Bengio , 2017 ; Pozzi et al. , 2020 ) . Nevertheless , all of these approaches require many synaptic updates in the form of labeled samples or precise machinery to determine the right set of weights . In this work , we take first steps of relating findings in machine learning to neuroscience and using such models to explore hypotheses about the product of evolution ( a model ’ s “ birth state ” ) while simultaneously reducing the number of supervised synaptic updates ( a model ’ s visual experience dependent development ) without sacrificing high brain predictivity . Our contributions follow from a framework in which evolution endows the visual system with a well-chosen , yet still largely random “ birth ” pattern of synaptic connectivity ( architecture + initialization ) , and developmental learning corresponds to training a fraction of the synaptic weights using very few supervised labels . We do not view the proposed changes as fully biological models of post-natal development , only that they more concretely correspond to biology than current models . Solving the entire problem of development all at once is too much for one study , but even partial improvements in this direction will likely be informative to further work . Specifically , 1. we build models with a fraction of supervised updates ( training epochs and labeled images ) that retain high similarity to the primate ventral visual stream ( quantified by a brain predictivity score from benchmarks on Brain-Score ( Schrimpf et al. , 2018 ) ) and find that layers corresponding to higher visual regions such as IT are most dependent on training , 2. we improve the “ at-birth ” synaptic connectivity to show that even low-capacity evolutionarily encoded information might lead to reasonable initial representations with no training at all , 3. we propose a thin , “ critical training ” technique which reduces the number of trained synapses while maintaining high brain predictivity and improves over previous computer vision attempts to minimize trained components , 4. we combine these three techniques to build models with two orders of magnitude fewer supervised synaptic updates but high brain predictivity relative to a fully trained model Code and pre-trained models are available through GitHub : https : //anonymous.4open . science/r/anonymous-3A61/ . 2 MODELING PRIMATE VISION . We evaluate all models on a suite of ventral stream benchmarks in Brain-Score ( Schrimpf et al. , 2018 ; 2020 ) , and we base the new models presented here on the CORnet-S architecture , one of the most accurate models of adult primate visual processing ( Kubilius et al. , 2019 ) . Brain-Score benchmarks . To obtain quantified scores for brain-likeness , we use a thorough set of benchmarks from Brain-Score ( Schrimpf et al. , 2018 ) . To keep scores comparable , we only included those neural benchmarks from Brain-Score ( Schrimpf et al. , 2018 ) with the same predictivity metric . All benchmarks feed the same images to a candidate model that were used for primate experiments while “ recording ” activations or measuring behavioral outputs . Specifically , the V1 and V2 benchmarks present 315 images of naturalistic textures and compare model representations to primate single-unit recordings from Freeman et al . ( 2013 ) ( 102 V1 and 103 V2 neurons ) ; the V4 and IT benchmarks present 2,560 naturalistic images and compare models to primate Utah array recordings from Majaj et al . ( 2015 ) ( 88 V4 and 168 IT electrodes ) . A linear regression is fit from model to primate representations in response to 90 % of the images and its prediction score on the held-out 10 % of images is evaluated with Pearson correlation , cross-validated 10 times . The behavioral benchmark presents 240 images and compares model to primate behavioral responses from Rajalingham et al . ( 2018 ) . A logistic classifier is fit on models ’ penultimate representations on 2,160 separate labeled images . The classifier is then used to estimate probabilities for 240 held-out images . Per-image confusion patterns between model and primate are compared with a Pearson correlation . All benchmark scores are normalized by the respective ceiling . We primarily report the average brain predictivity score as the mean of V1 , V2 , V4 , IT , and behavioral scores . We note that the Brain-Score benchmarks in this study are based on limited data and thus present a possible limitation . Nonetheless , they are the most extensive set of primate ventral stream neuronal and behavioral benchmarks that is currently available and the scores generalize to new experiments ( Kubilius et al. , 2019 ) . Brain-Score provides separate sets of data as public benchmarks which we use to determine the type of distribution in Section 4 , and the layer-to-region commitments of reference models . CORnet-S. One of the current best model architectures on the Brain-Score benchmarks is CORnet-S ( Kubilius et al. , 2019 ) , a shallow recurrent model which anatomically commits to ventral stream regions . CORnet-S has four computational areas , analogous to the ventral visual areas V1 , V2 , V4 , and IT , and a linear decoder that maps from neurons in the model ’ s last visual area to its behavioral choices . The recurrent circuitry ( Figure 3B ) uses up- and down-sampling convolutions to process features and is identical in each of the models visual areas ( except for V1COR ) , but varies by the total number of neurons in each area . We base all models developed here on the CORnet-S architecture and use the same hyper-parameters as proposed in ( Kubilius et al. , 2019 ) . Representations are read out at the end of anatomically corresponding areas . 3 HIGH SCORES IN BRAIN PREDICTIVITY CAN BE ACHIEVED WITH FEW SUPERVISED UPDATES . We evaluated the brain predictivity scores of CORnet-S variants that were trained with a combination of fewer epochs and images . Models were trained with an initial learning rate of 0.1 , divided by 10 when loss did not improve over 3 epochs , and stopping after three decrements . Figure 1 shows model scores on neural and behavioral Brain-Score measures , relative to a model trained for 43 epochs on all 1.28M labeled ImageNet images . In Panel A , we compare the average score over the five brain measures of various models to the number of supervised updates that each model was trained with , defined as the number of labeled images times the number of epochs . While a fully trained model reaches an average score of .42 after 55,040,000 supervised updates ( 43 epochs × 1.28M images ) , a model with only 100,000 updates already achieves 50 % of that score , and 1,000,000 updates increase brain predictivity scores to 76 % . Models are close to convergence score after 10,000,000 supervised updates with performance nearly equal to full training ( 97 % ) . Scores grow logarithmically with an approximate 5 % score increase for every order of magnitude more supervised updates . Figures 1B and C show individual neural and behavioral scores of models trained with fewer training epochs or labeled images independently . Early to mid visual representations ( V1 , V2 , and V4 scores ) are especially closely met with only few supervised updates , reaching 50 % of the final trained model in fractions of the first epoch ( Figure 1B ) . After only one full iteration over the training set , V1 , V2 , and V4 scores are close to their final score ( all > 80 % ) while IT requires two epochs to reach a comparable level . Behavioral scores take slightly longer to converge ( > 80 % after 7 epochs ) . Similarly , when training until convergence with fractions of the 1.28M total images , 50,000 images are sufficient to obtain high neural scores ( 80 % of full training in V1 , V2 , V4 , IT ) . Behavioral scores again require more training : half the standard number of labeled images is needed to surpass 80 % . Concretely relating supervised updates to primate ventral stream development , Seibert ( 2018 ) establishes that no more than∼4 months – or 10 million seconds – of waking visual experience is needed to reach adult-level primate IT cortex ( as assessed by its capability to support adult level object recognition ) . From this estimate , we can compute how many supervised updates per second different models in Figure 1A would require ( assuming those updates are evenly distributed over the 10 million seconds ) . For instance , the fully trained model ’ s 55 million supervised updates translate to 5.5 updates every second , whereas the model with 1 million updates and 76 % relative brain predictivity translates to one labeled image update every 10 seconds which appears more plausible given the upper limit of 2-3 saccades per second in humans ( Yarbus , 1967 ; Gibaldi & Sabatini , 2020 ) .
The paper is about ANN being best-known models of developed primate visual systems. However this fact does not yet mean that the way those systems are trained is also similar. This distinction and a step towards answering this question is the main motivation of this work. The authors demonstrate a set of ideas that while drastically reducing the number of updates maintain high Brain Predictability according to the BrainScore. The significance of this result in my opinion largely depends on how well we can map those observations and methods to biological meaning and knowledge on how primate brains are trained (see the discussion point below).
SP:45d0d17b384044473db2e2e164c56558044d2542
Wiring Up Vision: Minimizing Supervised Synaptic Updates Needed to Produce a Primate Ventral Stream
1 INTRODUCTION . Particular artificial neural networks ( ANNs ) are the leading mechanistic models of visual processing in the primate visual ventral stream ( Schrimpf et al. , 2020 ; Kubilius et al. , 2019 ; Dapello et al. , 2020 ) . After training on large-scale datasets such as ImageNet ( Deng et al. , 2009 ) by updating weights based on labeled images , internal representations of these ANNs partly match neural representations in the primate visual system from early visual cortex V1 through V2 and V4 to high-level IT ( Yamins et al. , 2014 ; Khaligh-Razavi & Kriegeskorte , 2014 ; Cadena et al. , 2017 ; Tang et al. , 2018 ; Schrimpf et al. , 2018 ; Kubilius et al. , 2019 ) , and model object recognition behavior can partly account for primate object recognition behavior ( Rajalingham et al. , 2018 ; Schrimpf et al. , 2018 ) . Recently , such models have been criticized due to how their learning departs from brain development because they require many more labeled examples than is reasonable for biological systems ’ limited waking ( visual ) experience ( Seibert , 2018 ; Zador , 2019 ) . For example , all the current top models of the primate ventral stream rely on trillions of supervised synaptic updates , i.e . the training of millions of parameters with millions of labeled examples over dozens of epochs . In biological systems , on the other hand , the at-birth synaptic wiring as encoded by the genome already provides structure that is sufficient for macaques to exhibit adult-like visual representations after a few months ( Movshon & Kiorpes , 1988 ; Kiorpes & Movshon , 2004 ; Seibert , 2018 ) , which restricts the amount of experience dependent learning . Furthermore , different neuronal populations in cortical circuits undergo different plasticity mechanisms : neurons in supragranular and infragranular layers adapt more rapidly than those in layer 4 which receives inputs from lower areas ( Diamond et al. , 1994 ; Schoups et al. , 2001 ) , while current artificial synapses , on the other hand , all change under the same plasticity mechanism . While current models provide a basic understanding of the neural mechanisms of adult ventral stream inference , can we start to build models that provide an understanding of how the ventral stream “ wires itself up ” – models of the initial state at birth and how it develops during postnatal life ? Related Work . Several papers have addressed related questions in machine learning : Distilled student networks can be trained on the outputs of a teacher network ( Hinton et al. , 2015 ; Cho & Hariharan , 2019 ; Tian et al. , 2019 ) , and , in pruning studies , networks with knocked out synapses perform reasonably well ( Cheney et al. , 2017 ; Morcos et al. , 2018 ) , demonstrating that models with many trained parameters can be compressed ( Wu et al. , 2018 ) which is further supported by the convergence of training gradients onto a small subspace ( Gur-Ari et al. , 2018 ) . Tian et al . ( 2020 ) show that a pre-trained encoder ’ s fixed features can be used to train a thin decoder with performance close to full fine-tuning and recent theoretically-driven work has found that training only BatchNorm layers ( Frankle et al. , 2021 ) or determining the right parameters from a large pool of weights ( Frankle et al. , 2019 ; Ramanujan et al. , 2019 ) can already achieve high classification accuracy . Unsupervised approaches are also starting to develop useful representations without requiring many labels by inferring internal labels such as clusters or representational similarity ( Caron et al. , 2018 ; Wu et al. , 2018 ; Zhuang et al. , 2019 ; Hénaff et al. , 2019 ; Konkle & Alvarez , 2020 ; Zhuang et al. , 2020 ) . Many attempts are also being made to make the learning algorithms themselves more biologically plausible ( e.g . Lillicrap et al. , 2016 ; Scellier & Bengio , 2017 ; Pozzi et al. , 2020 ) . Nevertheless , all of these approaches require many synaptic updates in the form of labeled samples or precise machinery to determine the right set of weights . In this work , we take first steps of relating findings in machine learning to neuroscience and using such models to explore hypotheses about the product of evolution ( a model ’ s “ birth state ” ) while simultaneously reducing the number of supervised synaptic updates ( a model ’ s visual experience dependent development ) without sacrificing high brain predictivity . Our contributions follow from a framework in which evolution endows the visual system with a well-chosen , yet still largely random “ birth ” pattern of synaptic connectivity ( architecture + initialization ) , and developmental learning corresponds to training a fraction of the synaptic weights using very few supervised labels . We do not view the proposed changes as fully biological models of post-natal development , only that they more concretely correspond to biology than current models . Solving the entire problem of development all at once is too much for one study , but even partial improvements in this direction will likely be informative to further work . Specifically , 1. we build models with a fraction of supervised updates ( training epochs and labeled images ) that retain high similarity to the primate ventral visual stream ( quantified by a brain predictivity score from benchmarks on Brain-Score ( Schrimpf et al. , 2018 ) ) and find that layers corresponding to higher visual regions such as IT are most dependent on training , 2. we improve the “ at-birth ” synaptic connectivity to show that even low-capacity evolutionarily encoded information might lead to reasonable initial representations with no training at all , 3. we propose a thin , “ critical training ” technique which reduces the number of trained synapses while maintaining high brain predictivity and improves over previous computer vision attempts to minimize trained components , 4. we combine these three techniques to build models with two orders of magnitude fewer supervised synaptic updates but high brain predictivity relative to a fully trained model Code and pre-trained models are available through GitHub : https : //anonymous.4open . science/r/anonymous-3A61/ . 2 MODELING PRIMATE VISION . We evaluate all models on a suite of ventral stream benchmarks in Brain-Score ( Schrimpf et al. , 2018 ; 2020 ) , and we base the new models presented here on the CORnet-S architecture , one of the most accurate models of adult primate visual processing ( Kubilius et al. , 2019 ) . Brain-Score benchmarks . To obtain quantified scores for brain-likeness , we use a thorough set of benchmarks from Brain-Score ( Schrimpf et al. , 2018 ) . To keep scores comparable , we only included those neural benchmarks from Brain-Score ( Schrimpf et al. , 2018 ) with the same predictivity metric . All benchmarks feed the same images to a candidate model that were used for primate experiments while “ recording ” activations or measuring behavioral outputs . Specifically , the V1 and V2 benchmarks present 315 images of naturalistic textures and compare model representations to primate single-unit recordings from Freeman et al . ( 2013 ) ( 102 V1 and 103 V2 neurons ) ; the V4 and IT benchmarks present 2,560 naturalistic images and compare models to primate Utah array recordings from Majaj et al . ( 2015 ) ( 88 V4 and 168 IT electrodes ) . A linear regression is fit from model to primate representations in response to 90 % of the images and its prediction score on the held-out 10 % of images is evaluated with Pearson correlation , cross-validated 10 times . The behavioral benchmark presents 240 images and compares model to primate behavioral responses from Rajalingham et al . ( 2018 ) . A logistic classifier is fit on models ’ penultimate representations on 2,160 separate labeled images . The classifier is then used to estimate probabilities for 240 held-out images . Per-image confusion patterns between model and primate are compared with a Pearson correlation . All benchmark scores are normalized by the respective ceiling . We primarily report the average brain predictivity score as the mean of V1 , V2 , V4 , IT , and behavioral scores . We note that the Brain-Score benchmarks in this study are based on limited data and thus present a possible limitation . Nonetheless , they are the most extensive set of primate ventral stream neuronal and behavioral benchmarks that is currently available and the scores generalize to new experiments ( Kubilius et al. , 2019 ) . Brain-Score provides separate sets of data as public benchmarks which we use to determine the type of distribution in Section 4 , and the layer-to-region commitments of reference models . CORnet-S. One of the current best model architectures on the Brain-Score benchmarks is CORnet-S ( Kubilius et al. , 2019 ) , a shallow recurrent model which anatomically commits to ventral stream regions . CORnet-S has four computational areas , analogous to the ventral visual areas V1 , V2 , V4 , and IT , and a linear decoder that maps from neurons in the model ’ s last visual area to its behavioral choices . The recurrent circuitry ( Figure 3B ) uses up- and down-sampling convolutions to process features and is identical in each of the models visual areas ( except for V1COR ) , but varies by the total number of neurons in each area . We base all models developed here on the CORnet-S architecture and use the same hyper-parameters as proposed in ( Kubilius et al. , 2019 ) . Representations are read out at the end of anatomically corresponding areas . 3 HIGH SCORES IN BRAIN PREDICTIVITY CAN BE ACHIEVED WITH FEW SUPERVISED UPDATES . We evaluated the brain predictivity scores of CORnet-S variants that were trained with a combination of fewer epochs and images . Models were trained with an initial learning rate of 0.1 , divided by 10 when loss did not improve over 3 epochs , and stopping after three decrements . Figure 1 shows model scores on neural and behavioral Brain-Score measures , relative to a model trained for 43 epochs on all 1.28M labeled ImageNet images . In Panel A , we compare the average score over the five brain measures of various models to the number of supervised updates that each model was trained with , defined as the number of labeled images times the number of epochs . While a fully trained model reaches an average score of .42 after 55,040,000 supervised updates ( 43 epochs × 1.28M images ) , a model with only 100,000 updates already achieves 50 % of that score , and 1,000,000 updates increase brain predictivity scores to 76 % . Models are close to convergence score after 10,000,000 supervised updates with performance nearly equal to full training ( 97 % ) . Scores grow logarithmically with an approximate 5 % score increase for every order of magnitude more supervised updates . Figures 1B and C show individual neural and behavioral scores of models trained with fewer training epochs or labeled images independently . Early to mid visual representations ( V1 , V2 , and V4 scores ) are especially closely met with only few supervised updates , reaching 50 % of the final trained model in fractions of the first epoch ( Figure 1B ) . After only one full iteration over the training set , V1 , V2 , and V4 scores are close to their final score ( all > 80 % ) while IT requires two epochs to reach a comparable level . Behavioral scores take slightly longer to converge ( > 80 % after 7 epochs ) . Similarly , when training until convergence with fractions of the 1.28M total images , 50,000 images are sufficient to obtain high neural scores ( 80 % of full training in V1 , V2 , V4 , IT ) . Behavioral scores again require more training : half the standard number of labeled images is needed to surpass 80 % . Concretely relating supervised updates to primate ventral stream development , Seibert ( 2018 ) establishes that no more than∼4 months – or 10 million seconds – of waking visual experience is needed to reach adult-level primate IT cortex ( as assessed by its capability to support adult level object recognition ) . From this estimate , we can compute how many supervised updates per second different models in Figure 1A would require ( assuming those updates are evenly distributed over the 10 million seconds ) . For instance , the fully trained model ’ s 55 million supervised updates translate to 5.5 updates every second , whereas the model with 1 million updates and 76 % relative brain predictivity translates to one labeled image update every 10 seconds which appears more plausible given the upper limit of 2-3 saccades per second in humans ( Yarbus , 1967 ; Gibaldi & Sabatini , 2020 ) .
This paper presents an empirical study that elucidates potential mechanisms through which models of adult-like visual streams can "develop" from less specific/coarser model instantiations. In particular, the authors consider existing ventral stream models whose internal representations and behavior are most brain-like (amongst several other models) and probe how these fair in impoverished regimes of available labeled data and model plasticity (number of "trainable" synapses). They introduce a novel weight initialization mechanism, Weight Compression (WC), that allows their models to retain good performance even at the beginning of training, before any synaptic update. They also explore a particular methodology for fine-tuning, Critical Training (CT), that selectively updates parameters that seem to yield the most benefit. Finally, they explore these methods/algorithms' transfer performance from one ventral stream model (CORnet-S) to two additional models (ResNet-50 and MobileNet).
SP:45d0d17b384044473db2e2e164c56558044d2542
Stability analysis of SGD through the normalized loss function
1 INTRODUCTION . In the last few years , deep learning has succeeded in establishing state-of-the-art performances in a wide variety of tasks in fields like computer vision , natural language processing and bioinformatics ( LeCun et al. , 2015 ) . Understanding when and how these networks generalize better is important to keep improving their performance . Many works starting mainly from Neyshabur et al . ( 2015 ) , Zhang et al . ( 2017 ) and Keskar et al . ( 2017 ) hint a rich interplay between regularization and the optimization process of learning the weights of the network . The idea is that a form of inductive bias can be realized implicitly by the optimization algorithm . The most popular algorithm to train neural networks is stochastic gradient descent ( SGD ) . It is therefore of great interest to study the generalization properties of this algorithm . An approach that is particularly well suited to investigate learning algorithms directly is the framework of stability ( Bousquet & Elisseeff , 2002 ) , ( Elisseeff et al. , 2005 ) . It is argued in Nagarajan & Kolter ( 2019 ) that generalization bounds based on uniform convergence might be condemned to be essentially vacuous for deep networks . Stability bounds offer a possible alternative by trying to bound directly the generalization error of the output of the algorithm . The seminal work of Hardt et al . ( 2016 ) exploits this framework to study SGD for both the convex and non-convex cases . The main intuitive idea is to look at how much changing one example in the training set can generate a different trajectory when running SGD . If the two trajectories must remain close to each other then the algorithm has better stability . This raises the question of how to best measure the distance between two classifiers . Our work investigates a measure of distance respecting invariances in homogeneous neural networks ( and linear classifiers ) instead of the usual euclidean distance . The measure of distance we consider is directly related to analyzing stability with respect to the normalized loss function instead of the standard loss function used for training . In the convex case , we prove an upper bound on uniform stability with respect to the normalized loss function , which can then be used to prove a high probability bound on the test error of the output of SGD . In the non-convex case , we propose an analysis directly targeted toward homogeneous neural networks . We prove an upper bound on the on-average stability with respect to the normalized loss function , which can then be used to give a generalization bound on the test error . One nice advantage coming with our approach is that we do not need to assume that the loss function is bounded . Indeed , even if the loss function used for training is unbounded , the normalized loss is necessarily bounded . Our main results for neural networks involve a data-dependent quantity that we estimate during training in our numerical experiments . The quantity is the sum over each layer of the ratio between the norm of the gradient for this layer and the norm of the parameters for the layer . We observe that larger learning rates lead to trajectories in parameter space keeping this quantity smaller during training . There are two ways to get our data-dependent quantity smaller during training . The first is by facilitating convergence ( having smaller norms for the gradients ) . The second is by increasing the weights of the network . If the weights are larger , the same magnitude for an update in weight space results in a smaller change in angle ( see Figure 1 ) . In our experiments , larger learning rates are seen to be more favorable in both regards . Our main contributions are summarized as follows : 2 RELATED WORK . Normalized loss functions have been considered before ( Poggio et al. , 2019 ) , ( Liao et al. , 2018 ) . In Liao et al . ( 2018 ) , test error is seen to be well correlated with the normalized loss . This observation is one motivation for our study . We might expect generalization bounds on the test error to be better by using the normalized surrogate loss in the analysis . ( Poggio et al. , 2019 ) writes down a generalization bound based on Rademacher complexity but motivated by the possible limitations of uniform convergence for deep learning ( Nagarajan & Kolter , 2019 ) we take the stability approach instead . Generalization of SGD has been investigated before in a large body of literature . Soudry et al . ( 2018 ) showed that gradient descent converges to the max-margin solution for logistic regression and Lyu & Li ( 2019 ) provides an extension to deep non-linear homogeneous networks . Nacson et al . ( 2019 ) gives similar results for stochastic gradient descent . From the point of view of stability , starting from Hardt et al . ( 2016 ) without being exhaustive , a few representative examples are Bassily et al . ( 2020 ) , Yuan et al . ( 2019 ) , Kuzborskij & Lampert ( 2018 ) , Liu et al . ( 2017 ) , London ( 2017 ) . Since the work of Zhang et al . ( 2017 ) showing that currently used deep neural networks are so overparameterized that they can easily fit random labels , taking properties of the data distribution into account seems necessary to understand generalization of deep networks . In the context of stability , this means moving from uniform stability to on-average stability . This is the main concern of the work of Kuzborskij & Lampert ( 2018 ) . They develop data-dependent stability bounds for SGD by extending over the work of Hardt et al . ( 2016 ) . Their results have a dependence on the risk of the initialization point and the curvature of the initialization . They have to assume a bound on the noise of the stochastic gradient . We do not make this assumption in our work . Furthermore , we maintain in our bounds for neural networks the properties after the “ burn-in ” period and therefore closer to the final output since we are interested in the effect of the learning rate on the trajectory . This is motivated by the empirical work of Jastrzebski et al . ( 2020 ) arguing that in the early phase of training , the learning rate and batch size determine the properties of the trajectory after a “ break-even point ” . Another work interested in on-average stability is Zhou et al . ( 2021 ) . Differently from our work , their approach makes the extra assumptions that the variance of the stochastic gradients is bounded and also that the loss is bounded . Furthermore , our analysis directly exploits the structure of neural networks and the properties following from using homogeneous non-linearities . It has been observed in the early work of Keskar et al . ( 2017 ) that training with larger batch sizes can lead to a deterioration in test accuracy . The simplest strategy to reduce ( at least partially ) the gap with small batch training is to increase the learning rate ( He et al. , 2019 ) , ( Smith & Le , 2018 ) , ( Hoffer et al. , 2017 ) , ( Goyal et al. , 2017 ) . We choose this scenario to investigate empirically the relevance of our stability bound for SGD on neural networks . Note that the results in Hardt et al . ( 2016 ) are more favorable to smaller learning rates . It seems therefore important in order to get theory closer to practice to understand better in what sense larger learning rates can improve stability . 3 PRELIMINARIES . Let l ( w , z ) be a non-negative loss function . Furthermore , let A be a randomized algorithm and denote by A ( S ) the output of A when trained on training set S = { z1 , · · · , zn } ∼ Dn . The true risk for a classifier w is given as LD ( w ) : = Ez∼Dl ( w , z ) and the empirical risk is given by LS ( w ) : = 1 n ∑n i=1 l ( w , zi ) . When considering the 0− 1 loss of a classifier w , we will write L0−1D ( w ) . Furthermore , we will add a superscript α when the normalized losses lα are under consideration ( these will be defined more clearly in the subsequent sections respectively for the convex case and the non-convex case ) . Our main interest is to ensure small test error and so we want to bound L0−1D ( w ) . The usual approach is to minimize a surrogate loss upper bounding the 0− 1 loss . In this paper , we consider stochastic gradient descent with different batch sizes to minimize the empirical surrogate loss . The update rule of this algorithm for learning rates λt and a subset Bt ⊂ S of size B is given by wt+1 = wt − λt 1 B ∑ zj∈Bt ∇l ( wt , zj ) . ( 1 ) We assume sampling uniformly with replacement in order to form each batch of training examples . In order to investigate generalization of this algorithm , we consider the framework of stability ( Bousquet & Elisseeff , 2002 ) . We now give the definitions for uniform stability and on-average stability ( random pointwise hypothesis stability in Elisseeff et al . ( 2005 ) ) for randomized algorithms ( see also Hardt et al . ( 2016 ) and Kuzborskij & Lampert ( 2018 ) ) . The definitions can be formulated with respect to any loss function but since we will study stability with respect to the lα losses , we write the definitions in the context of this special case . Definition 1 The algorithm A is said to be αuni-uniformly stable if for all i ∈ { 1 , . . . , n } sup S , z′i , z E [ |lα ( A ( S ) , z ) − lα ( A ( S ( i ) ) , z ) | ] ≤ αuni . ( 2 ) Here , the expectation is taken over the randomness of A . The notation S ( i ) means that we replace the ith example of S with z′i . Definition 2 The algorithm A is said to be αav-on-average stable if for all i ∈ { 1 , . . . , n } E [ |lα ( A ( S ) , z ) − lα ( A ( S ( i ) ) , z ) | ] ≤ αav . ( 3 ) Here , the expectation is taken over S ∼ Dn , z ∼ D and the randomness of A . The notation S ( i ) means that we replace the ith example of S with z . Throughout the paper , ||·|| will denote the euclidean norm for vectors and the Frobenius norm for matrices . The proofs are given in Appendix A for the convex case and in Appendix B for the non-convex case . 4 CONVEX CASE : A FIRST STEP TOWARD THE NON-CONVEX CASE . Since the convex case is easier to handle , it can be seen as a good preparation for the non-convex case . Consider a linear classifier parameterized by either a vector of weights ( binary case ) or a matrix of weights ( multi-class case ) that we denote by w in both cases . The normalized losses are defined by lα ( w , z ) : = l ( α w ||w|| , z ) , ( 4 ) for α > 0 . In order to state the main result of this section , we need two common assumptions : L-Lipschitzness of l as a function of w and β-smoothness . Definition 3 The function l ( w , z ) is L−Lipschitz for all z in the domain ( with respect to w ) if for all w , w′ , z , |l ( w , z ) − l ( w′ , z ) |≤ L||w − w′|| . ( 5 ) Definition 4 The function l ( w , z ) is β−smooth if for all w , w′ , z , ||∇l ( w , z ) −∇l ( w′ , z ) ||≤ β||w − w′|| . ( 6 ) We are now ready to state the main result of this section . Theorem 1 Assume that l ( w , z ) is convex , β−smooth and L−Lipschitz for all z . Furthermore , assume that the initial point w0 satisfies ||w0||≥ K for some K such that K̂ = K −L ∑T−1 i=0 λi > 0 for a sequence of learning rates λi ≤ 2/β . SGD is then run with batch size B on loss function l ( w , z ) for T steps with the learning rates λt starting from w0 . Denote by αuni the uniform stability of this algorithm with respect to lα . Then , αuni ≤ α 2L2B nK̂ T−1∑ i=0 λi . ( 7 ) What is the main difference between our bound and the bound in Hardt et al . ( 2016 ) ( see theorem 7 in Appendix A ) ? Our bound takes into account the norm of the initialization . The meaning of the bound is that it is not enough to use small learning rates and a small number of epochs to guarantee good stability ( with respect to the normalized loss ) . We also need to take into account the norm of the parameters ( here the norm of the initialization ) to make sure that the “ effective ” learning rates are small . Note that all classifiers are contained in any ball around the origin even if the radius of the ball is arbitrarily small . Therefore , all control over stability is lost very close to the origin where even a small step ( in Euclidean distance ) can lead to a drastic change in the classifier . The norm of the initialization must therefore be large enough to ensure that the trajectory can not get too close to the origin ( in worst case , since uniform stability is considered ) . An alternative if the conditions of the theorem are too strong in some practical scenarios is to use on-average stability ( l = 1 layer in the results of section 5 ) . As a side note , we also incorporated the batch size into the bound which is not present in Hardt et al . ( 2016 ) ( only B = 1 is considered ) . From this result , it is now possible to obtain a high probability bound for the test error . The bound is over draws of training sets S but not over the randomness of A . 1 So , we actually have the expected 1It is possible to obtain a bound holding over the randomness of A by exploiting the framework of Elisseeff et al . ( 2005 ) . However , the term involving ρ in their theorem 15 does not converge to 0 when the size of the training set grows to infinity . test error over the randomness of A in the bound . This is reminiscent of PAC-Bayes bounds where here the posterior distribution would be induced from the randomness of the algorithm A. Theorem 2 Fix α > 0 . Let Mα : = sup { l ( w , z ) s.t . ||w||≤ α , ||x||≤ R } . Then , for any n > 1 and δ ∈ ( 0 , 1 ) , the following hold with probability greater or equal to 1− δ over draws of training sets S : ( 8 ) EAL0−1D ( A ( S ) ) ≤ EAL α S ( A ( S ) ) + α uni + ( 2n α uni +Mα ) √ ln ( 1/δ ) 2n . Proof : The proof is an application of McDiarmid ’ s concentration bound . Note that we do not need the training loss to be bounded since we consider the normalized loss which is bounded . The proof follows the same line as theorem 12 in Bousquet & Elisseeff ( 2002 ) and we do not replicate it here . Note that we need to use that uniform stability implies generalization in expectation which is proven for example in theorem 2.2 from Hardt et al . ( 2016 ) . Furthermore , a bound holding uniformly over all α ’ s can be obtained using standard techniques . Theorem 3 Let C > 0 . Assume that lα ( w , z ) is a convex function of α for all w , z and that αuni is a non-decreasing function of α . Then , for any n > 1 and δ ∈ ( 0 , 1 ) , the following hold with probability greater or equal to 1− δ over draws of training sets S : EAL0−1D ( A ( S ) ) ≤ inf α∈ ( 0 , C ] { EA max ( Lα/2S ( A ( S ) ) , L α S ( A ( S ) ) ) + α uni + ( 2n α uni + Mα ) √ 2 ln ( √ 2 ( 2 + log2 C − log2 α ) ) + ln ( 1/δ ) 2n } . In the next section , we investigate the non-convex case . We exploit on-average stability to obtain a data-dependent quantity in the bound . Note that it is also argued in Kuzborskij & Lampert ( 2018 ) that the worst case analysis of uniform stability might not be appropriate for deep learning .
This paper develops new stability bounds for SGD. The main difference from the existing studies is that they consider stability bounds for normalized loss functions where the parameters are normalized to have a norm of $1$. This paper considers both convex and nonconvex cases. For the convex case, the authors develop uniform stability bounds and high-probability bounds. For the nonconvex case, the authors develop on-average stability bounds for neural networks. Experimental results are also given.
SP:9070183afc9422af7dcef84aea785cb59bbba3ae
Stability analysis of SGD through the normalized loss function
1 INTRODUCTION . In the last few years , deep learning has succeeded in establishing state-of-the-art performances in a wide variety of tasks in fields like computer vision , natural language processing and bioinformatics ( LeCun et al. , 2015 ) . Understanding when and how these networks generalize better is important to keep improving their performance . Many works starting mainly from Neyshabur et al . ( 2015 ) , Zhang et al . ( 2017 ) and Keskar et al . ( 2017 ) hint a rich interplay between regularization and the optimization process of learning the weights of the network . The idea is that a form of inductive bias can be realized implicitly by the optimization algorithm . The most popular algorithm to train neural networks is stochastic gradient descent ( SGD ) . It is therefore of great interest to study the generalization properties of this algorithm . An approach that is particularly well suited to investigate learning algorithms directly is the framework of stability ( Bousquet & Elisseeff , 2002 ) , ( Elisseeff et al. , 2005 ) . It is argued in Nagarajan & Kolter ( 2019 ) that generalization bounds based on uniform convergence might be condemned to be essentially vacuous for deep networks . Stability bounds offer a possible alternative by trying to bound directly the generalization error of the output of the algorithm . The seminal work of Hardt et al . ( 2016 ) exploits this framework to study SGD for both the convex and non-convex cases . The main intuitive idea is to look at how much changing one example in the training set can generate a different trajectory when running SGD . If the two trajectories must remain close to each other then the algorithm has better stability . This raises the question of how to best measure the distance between two classifiers . Our work investigates a measure of distance respecting invariances in homogeneous neural networks ( and linear classifiers ) instead of the usual euclidean distance . The measure of distance we consider is directly related to analyzing stability with respect to the normalized loss function instead of the standard loss function used for training . In the convex case , we prove an upper bound on uniform stability with respect to the normalized loss function , which can then be used to prove a high probability bound on the test error of the output of SGD . In the non-convex case , we propose an analysis directly targeted toward homogeneous neural networks . We prove an upper bound on the on-average stability with respect to the normalized loss function , which can then be used to give a generalization bound on the test error . One nice advantage coming with our approach is that we do not need to assume that the loss function is bounded . Indeed , even if the loss function used for training is unbounded , the normalized loss is necessarily bounded . Our main results for neural networks involve a data-dependent quantity that we estimate during training in our numerical experiments . The quantity is the sum over each layer of the ratio between the norm of the gradient for this layer and the norm of the parameters for the layer . We observe that larger learning rates lead to trajectories in parameter space keeping this quantity smaller during training . There are two ways to get our data-dependent quantity smaller during training . The first is by facilitating convergence ( having smaller norms for the gradients ) . The second is by increasing the weights of the network . If the weights are larger , the same magnitude for an update in weight space results in a smaller change in angle ( see Figure 1 ) . In our experiments , larger learning rates are seen to be more favorable in both regards . Our main contributions are summarized as follows : 2 RELATED WORK . Normalized loss functions have been considered before ( Poggio et al. , 2019 ) , ( Liao et al. , 2018 ) . In Liao et al . ( 2018 ) , test error is seen to be well correlated with the normalized loss . This observation is one motivation for our study . We might expect generalization bounds on the test error to be better by using the normalized surrogate loss in the analysis . ( Poggio et al. , 2019 ) writes down a generalization bound based on Rademacher complexity but motivated by the possible limitations of uniform convergence for deep learning ( Nagarajan & Kolter , 2019 ) we take the stability approach instead . Generalization of SGD has been investigated before in a large body of literature . Soudry et al . ( 2018 ) showed that gradient descent converges to the max-margin solution for logistic regression and Lyu & Li ( 2019 ) provides an extension to deep non-linear homogeneous networks . Nacson et al . ( 2019 ) gives similar results for stochastic gradient descent . From the point of view of stability , starting from Hardt et al . ( 2016 ) without being exhaustive , a few representative examples are Bassily et al . ( 2020 ) , Yuan et al . ( 2019 ) , Kuzborskij & Lampert ( 2018 ) , Liu et al . ( 2017 ) , London ( 2017 ) . Since the work of Zhang et al . ( 2017 ) showing that currently used deep neural networks are so overparameterized that they can easily fit random labels , taking properties of the data distribution into account seems necessary to understand generalization of deep networks . In the context of stability , this means moving from uniform stability to on-average stability . This is the main concern of the work of Kuzborskij & Lampert ( 2018 ) . They develop data-dependent stability bounds for SGD by extending over the work of Hardt et al . ( 2016 ) . Their results have a dependence on the risk of the initialization point and the curvature of the initialization . They have to assume a bound on the noise of the stochastic gradient . We do not make this assumption in our work . Furthermore , we maintain in our bounds for neural networks the properties after the “ burn-in ” period and therefore closer to the final output since we are interested in the effect of the learning rate on the trajectory . This is motivated by the empirical work of Jastrzebski et al . ( 2020 ) arguing that in the early phase of training , the learning rate and batch size determine the properties of the trajectory after a “ break-even point ” . Another work interested in on-average stability is Zhou et al . ( 2021 ) . Differently from our work , their approach makes the extra assumptions that the variance of the stochastic gradients is bounded and also that the loss is bounded . Furthermore , our analysis directly exploits the structure of neural networks and the properties following from using homogeneous non-linearities . It has been observed in the early work of Keskar et al . ( 2017 ) that training with larger batch sizes can lead to a deterioration in test accuracy . The simplest strategy to reduce ( at least partially ) the gap with small batch training is to increase the learning rate ( He et al. , 2019 ) , ( Smith & Le , 2018 ) , ( Hoffer et al. , 2017 ) , ( Goyal et al. , 2017 ) . We choose this scenario to investigate empirically the relevance of our stability bound for SGD on neural networks . Note that the results in Hardt et al . ( 2016 ) are more favorable to smaller learning rates . It seems therefore important in order to get theory closer to practice to understand better in what sense larger learning rates can improve stability . 3 PRELIMINARIES . Let l ( w , z ) be a non-negative loss function . Furthermore , let A be a randomized algorithm and denote by A ( S ) the output of A when trained on training set S = { z1 , · · · , zn } ∼ Dn . The true risk for a classifier w is given as LD ( w ) : = Ez∼Dl ( w , z ) and the empirical risk is given by LS ( w ) : = 1 n ∑n i=1 l ( w , zi ) . When considering the 0− 1 loss of a classifier w , we will write L0−1D ( w ) . Furthermore , we will add a superscript α when the normalized losses lα are under consideration ( these will be defined more clearly in the subsequent sections respectively for the convex case and the non-convex case ) . Our main interest is to ensure small test error and so we want to bound L0−1D ( w ) . The usual approach is to minimize a surrogate loss upper bounding the 0− 1 loss . In this paper , we consider stochastic gradient descent with different batch sizes to minimize the empirical surrogate loss . The update rule of this algorithm for learning rates λt and a subset Bt ⊂ S of size B is given by wt+1 = wt − λt 1 B ∑ zj∈Bt ∇l ( wt , zj ) . ( 1 ) We assume sampling uniformly with replacement in order to form each batch of training examples . In order to investigate generalization of this algorithm , we consider the framework of stability ( Bousquet & Elisseeff , 2002 ) . We now give the definitions for uniform stability and on-average stability ( random pointwise hypothesis stability in Elisseeff et al . ( 2005 ) ) for randomized algorithms ( see also Hardt et al . ( 2016 ) and Kuzborskij & Lampert ( 2018 ) ) . The definitions can be formulated with respect to any loss function but since we will study stability with respect to the lα losses , we write the definitions in the context of this special case . Definition 1 The algorithm A is said to be αuni-uniformly stable if for all i ∈ { 1 , . . . , n } sup S , z′i , z E [ |lα ( A ( S ) , z ) − lα ( A ( S ( i ) ) , z ) | ] ≤ αuni . ( 2 ) Here , the expectation is taken over the randomness of A . The notation S ( i ) means that we replace the ith example of S with z′i . Definition 2 The algorithm A is said to be αav-on-average stable if for all i ∈ { 1 , . . . , n } E [ |lα ( A ( S ) , z ) − lα ( A ( S ( i ) ) , z ) | ] ≤ αav . ( 3 ) Here , the expectation is taken over S ∼ Dn , z ∼ D and the randomness of A . The notation S ( i ) means that we replace the ith example of S with z . Throughout the paper , ||·|| will denote the euclidean norm for vectors and the Frobenius norm for matrices . The proofs are given in Appendix A for the convex case and in Appendix B for the non-convex case . 4 CONVEX CASE : A FIRST STEP TOWARD THE NON-CONVEX CASE . Since the convex case is easier to handle , it can be seen as a good preparation for the non-convex case . Consider a linear classifier parameterized by either a vector of weights ( binary case ) or a matrix of weights ( multi-class case ) that we denote by w in both cases . The normalized losses are defined by lα ( w , z ) : = l ( α w ||w|| , z ) , ( 4 ) for α > 0 . In order to state the main result of this section , we need two common assumptions : L-Lipschitzness of l as a function of w and β-smoothness . Definition 3 The function l ( w , z ) is L−Lipschitz for all z in the domain ( with respect to w ) if for all w , w′ , z , |l ( w , z ) − l ( w′ , z ) |≤ L||w − w′|| . ( 5 ) Definition 4 The function l ( w , z ) is β−smooth if for all w , w′ , z , ||∇l ( w , z ) −∇l ( w′ , z ) ||≤ β||w − w′|| . ( 6 ) We are now ready to state the main result of this section . Theorem 1 Assume that l ( w , z ) is convex , β−smooth and L−Lipschitz for all z . Furthermore , assume that the initial point w0 satisfies ||w0||≥ K for some K such that K̂ = K −L ∑T−1 i=0 λi > 0 for a sequence of learning rates λi ≤ 2/β . SGD is then run with batch size B on loss function l ( w , z ) for T steps with the learning rates λt starting from w0 . Denote by αuni the uniform stability of this algorithm with respect to lα . Then , αuni ≤ α 2L2B nK̂ T−1∑ i=0 λi . ( 7 ) What is the main difference between our bound and the bound in Hardt et al . ( 2016 ) ( see theorem 7 in Appendix A ) ? Our bound takes into account the norm of the initialization . The meaning of the bound is that it is not enough to use small learning rates and a small number of epochs to guarantee good stability ( with respect to the normalized loss ) . We also need to take into account the norm of the parameters ( here the norm of the initialization ) to make sure that the “ effective ” learning rates are small . Note that all classifiers are contained in any ball around the origin even if the radius of the ball is arbitrarily small . Therefore , all control over stability is lost very close to the origin where even a small step ( in Euclidean distance ) can lead to a drastic change in the classifier . The norm of the initialization must therefore be large enough to ensure that the trajectory can not get too close to the origin ( in worst case , since uniform stability is considered ) . An alternative if the conditions of the theorem are too strong in some practical scenarios is to use on-average stability ( l = 1 layer in the results of section 5 ) . As a side note , we also incorporated the batch size into the bound which is not present in Hardt et al . ( 2016 ) ( only B = 1 is considered ) . From this result , it is now possible to obtain a high probability bound for the test error . The bound is over draws of training sets S but not over the randomness of A . 1 So , we actually have the expected 1It is possible to obtain a bound holding over the randomness of A by exploiting the framework of Elisseeff et al . ( 2005 ) . However , the term involving ρ in their theorem 15 does not converge to 0 when the size of the training set grows to infinity . test error over the randomness of A in the bound . This is reminiscent of PAC-Bayes bounds where here the posterior distribution would be induced from the randomness of the algorithm A. Theorem 2 Fix α > 0 . Let Mα : = sup { l ( w , z ) s.t . ||w||≤ α , ||x||≤ R } . Then , for any n > 1 and δ ∈ ( 0 , 1 ) , the following hold with probability greater or equal to 1− δ over draws of training sets S : ( 8 ) EAL0−1D ( A ( S ) ) ≤ EAL α S ( A ( S ) ) + α uni + ( 2n α uni +Mα ) √ ln ( 1/δ ) 2n . Proof : The proof is an application of McDiarmid ’ s concentration bound . Note that we do not need the training loss to be bounded since we consider the normalized loss which is bounded . The proof follows the same line as theorem 12 in Bousquet & Elisseeff ( 2002 ) and we do not replicate it here . Note that we need to use that uniform stability implies generalization in expectation which is proven for example in theorem 2.2 from Hardt et al . ( 2016 ) . Furthermore , a bound holding uniformly over all α ’ s can be obtained using standard techniques . Theorem 3 Let C > 0 . Assume that lα ( w , z ) is a convex function of α for all w , z and that αuni is a non-decreasing function of α . Then , for any n > 1 and δ ∈ ( 0 , 1 ) , the following hold with probability greater or equal to 1− δ over draws of training sets S : EAL0−1D ( A ( S ) ) ≤ inf α∈ ( 0 , C ] { EA max ( Lα/2S ( A ( S ) ) , L α S ( A ( S ) ) ) + α uni + ( 2n α uni + Mα ) √ 2 ln ( √ 2 ( 2 + log2 C − log2 α ) ) + ln ( 1/δ ) 2n } . In the next section , we investigate the non-convex case . We exploit on-average stability to obtain a data-dependent quantity in the bound . Note that it is also argued in Kuzborskij & Lampert ( 2018 ) that the worst case analysis of uniform stability might not be appropriate for deep learning .
This paper considers the generalization bound for stochastic gradient descent. The authors leverage normalized loss function to analyze the stability of SGD algorithms which further yields the generalization bound. They provide the on-average stability result for non-convex optimization under the ReLU neural network setting. The theoretical results deepen our understanding of the performance of the SGD algorithm and an experiment is provided to illustrate theoretical findings.
SP:9070183afc9422af7dcef84aea785cb59bbba3ae
Learning Neural Generative Dynamics for Molecular Conformation Generation
1 INTRODUCTION . Recently , we have witnessed the success of graph-based representations for molecular modeling in a variety of tasks such as property prediction ( Gilmer et al. , 2017 ) and molecule generation ( You et al. , 2018 ; Shi et al. , 2020 ) . However , a more natural and intrinsic representation of a molecule is its 3D structure , commonly known as the molecular geometry or conformation , which represents each atom by its 3D coordinate . The conformation of a molecule determines its biological and physical properties such as charge distribution , steric constraints , as well as interactions with other molecules . Furthermore , large molecules tend to comprise a number of rotatable bonds , which may induce flexible conformation changes and a large number of feasible conformations in nature . Generating valid and stable conformations of a given molecule remains very challenging . Experimentally , such structures are determined by expensive and time-consuming crystallography . Computational approaches based on Markov chain Monte Carlo ( MCMC ) or molecular dynamics ( MD ) ( De Vivo et al. , 2016 ) are computationally expensive , especially for large molecules ( Ballard et al. , 2015 ) . Machine learning methods have recently shown great potential for molecular conformation generation by training on a large collection of data to model the probability distribution of potential conformations R based on the molecular graph G , i.e. , p ( R|G ) . For example , Mansimov et al . ∗Equal contribution . Work was done during Shitong ’ s internship at Mila . 1Code is available at https : //github.com/DeepGraphLearning/CGCF-ConfGen . ( 2019 ) proposed a Conditional Variational Graph Autoencoders ( CVGAE ) for molecular conformation generation . A graph neural network ( Gilmer et al. , 2017 ) is first applied to the molecular graph to get the atom representations , based on which 3D coordinates are further generated . One limitation of such an approach is that by directly generating the 3D coordinates of atoms it fails to model the rotational and translational invariance of molecular conformations . To address this issue , instead of generating the 3D coordinates directly , Simm & Hernández-Lobato ( 2020 ) recently proposed to first model the molecule ’ s distance geometry ( i.e. , the distances between atoms ) —which are rotationally and translationally invariant—and then generate the molecular conformation based on the distance geometry through a post-processing algorithm ( Liberti et al. , 2014 ) . Similar to Mansimov et al . ( 2019 ) , a few layers of graph neural networks are applied to the molecular graph to learn the representations of different edges , which are further used to generate the distances of different edges independently . This approach is capable of more often generating valid molecular conformations . Although these new approaches have made tremendous progress , the problem remains very challenging and far from solved . First , each molecule may have multiple stable conformations around a number of states which are thermodynamically stable . In other words , the distribution p ( R|G ) is very complex and multi-modal . Models with high capacity are required to model such complex distributions . Second , existing approaches usually apply a few layers of graph neural networks to learn the representations of nodes ( or edges ) and then generate the 3D coordinates ( or distances ) based on their representations independently . Such approaches are necessarily limited to capturing a single mode of p ( R|G ) ( since the coordinates or distances are sampled independently ) and are incapable of modeling multimodal joint distributions and the form of the graph neural net computation makes it difficult to capture long-range dependencies between atoms , especially in large molecules . Inspired by the recent progress with deep generative models , this paper proposes a novel and principled probabilistic framework for molecular geometry generation , which addresses the above two limitations . Our framework combines the advantages of normalizing flows ( Dinh et al. , 2014 ) and energy-based approaches ( LeCun et al. , 2006 ) , which have a strong model capacity for modeling complex distributions , are flexible to model long-range dependency between atoms , and enjoy efficient sampling and training procedures . Similar to the work of Simm & Hernández-Lobato ( 2020 ) , we also first learn the distribution of distances d given the graph G , i.e. , p ( d|G ) , and define another distribution of conformations R given the distances d , i.e. , p ( R|d , G ) . Specifically , we propose a novel Conditional Graph Continuous Flow ( CGCF ) for distance geometry ( d ) generation conditioned on the molecular graph G. Given a molecular graph G , CGCF defines an invertible mapping between a base distribution ( e.g. , a multivariate normal distribution ) and the molecular distance geometry , using a virtually infinite number of graph transformation layers on atoms represented by a Neural Ordinary Differential Equations architecture ( Chen et al. , 2018 ) . Such an approach enjoys very high flexibility to model complex distributions of distance geometry . Once the molecular distance geometry d is generated , we further generate the 3D coordinates R by searching from the probability p ( R|d , G ) . Though the CGCF has a high capacity for modeling complex distributions , the distances of different edges are still independently updated in the transformations , which limits its capacity for modeling long-range dependency between atoms in the sampling process . Therefore , we further propose another unnormalized probability function , i.e. , an energy-based model ( EBM ) ( Hinton & Salakhutdinov , 2006 ; LeCun et al. , 2006 ; Ngiam et al. , 2011 ) , which acts as a tilting term of the flow-based distribution and directly models the joint distribution of R. Specifically , the EBM trains an energy function E ( R , G ) , which is approximated by a neural network . The flow- and energy-based models are combined in a novel way for joint training and mutual enhancement . First , energy-based methods are usually difficult to train due to the slow sampling process . In addition , the distribution of conformations is usually highly multi-modal , and the sampling procedures based on Gibbs sampling or Langevin Dynamics ( Bengio et al. , 2013a ; b ) tend to get trapped around modes , making it difficult to mix between different modes ( Bengio et al. , 2013a ) . Here we use the flow-based model as a proposal distribution for the energy model , which is capable to generate diverse samples for training energy models . Second , the flow-based model lacks the capacity to explicitly model the long-range dependencies between atoms , which we find can however be effectively modeled by an energy function E ( R , G ) . Our sampling process can be therefore viewed as a two-stage dynamic system , where we first take the flow-based model to quickly synthesize realistic conformations and then used the learned energy E ( R , G ) to refine the generated conformations through Langevin Dynamics . We conduct comprehensive experiments on several recently proposed benchmarks , including GEOM-QM9 , GEOM-Drugs ( Axelrod & Gomez-Bombarelli , 2020 ) and ISO17 ( Simm & Hernández-Lobato , 2020 ) . Numerical evaluations show that our proposed framework consistently outperforms the previous state-of-the-art ( GraphDG ) on both conformation generation and distance modeling tasks , with a clear margin . 2 PROBLEM DEFINITION AND PRELIMINARIES . 2.1 PROBLEM DEFINITION . Notations . Following existing work ( Simm & Hernández-Lobato , 2020 ) , each molecule is represented as an undirected graph G = 〈V , E〉 , where V is the set of nodes representing atoms and E is the set of edges representing inter-atomic bonds . Each node v in V is labeled with atomic properties such as element type . The edge in E connecting u and v is denoted as euv , and is labeled with its bond type . We also follow the previous work ( Simm & Hernández-Lobato , 2020 ) to expand the molecular graph with auxiliary bonds , which is elaborated in Appendix B . For the molecular 3D representation , each atom in V is assigned with a 3D position vector r ∈ R3 . We denote duv = ‖ru − rv‖2 as the Euclidean distance between the uth and vth atom . Therefore , we can represent all the positions { rv } v∈V as a matrix R ∈ R|V|×3 and all the distances between connected nodes { duv } euv∈E as a vector d ∈ R|E| . Problem Definition . The problem of molecular conformation generation is defined as a conditional generation process . More specifically , our goal is to model the conditional distribution of atomic positions R given the molecular graph G , i.e. , p ( R|G ) . 2.2 PRELIMINARIES . Continuous Normalizing Flow . A normalizing flow ( Dinh et al. , 2014 ; Rezende & Mohamed , 2015 ) defines a series of invertible deterministic transformations from an initial known distribution p ( z ) to a more complicated one p ( x ) . Recently , normalizing flows have been generalized from discrete number of layers to continuous ( Chen et al. , 2018 ; Grathwohl et al. , 2018 ) by defining the transformation fθ as a continuous-time dynamic ∂z ( t ) ∂t = fθ ( z ( t ) , t ) . Formally , with the latent variable z ( t0 ) ∼ p ( z ) at the start time , the continuous normalizing flow ( CNF ) defines the transformation x = z ( t0 ) + ∫ t1 t0 fθ ( z ( t ) , t ) dt . Then the exact density for pθ ( x ) can be computed by : log pθ ( x ) = log p ( z ( t0 ) ) − ∫ t1 t0 Tr ( ∂fθ ∂z ( t ) ) dt ( 1 ) where z ( t0 ) can be obtained by inverting the continuous dynamic z ( t0 ) = x + ∫ t0 t1 fθ ( z ( t ) , t ) dt . A black-box ordinary differential equation ( ODE ) solver can be applied to estimate the outputs and inputs gradients and optimize the CNF model ( Chen et al. , 2018 ; Grathwohl et al. , 2018 ) . Energy-based Models . Energy-based models ( EBMs ) ( Dayan et al. , 1995 ; Hinton & Salakhutdinov , 2006 ; LeCun et al. , 2006 ) use a scalar parametric energy function Eφ ( x ) to fit the data distribution . Formally , the energy function induces a density function with the Boltzmann distribution pφ ( x ) = exp ( −Eφ ( x ) ) /Z ( φ ) , where Z = ∫ exp ( −Eφ ( x ) ) dx denotes the partition function . EBM can be learned with Noise contrastive estimation ( NCE ) ( Gutmann & Hyvärinen , 2010 ) by treating the normalizing constant as a free parameter . Given the training examples from both the dataset and a noise distribution q ( x ) , φ can be estimated by maximizing the following objective function : J ( φ ) = Epdata [ log pφ ( x ) pφ ( x ) + q ( x ) ] + Eq [ log q ( x ) pφ ( x ) + q ( x ) ] , ( 2 ) which turns the estimation of EBM into a discriminative learning problem . Sampling from Eφ can be done with a variety of methods such as Markov chain Monte Carlo ( MCMC ) or Gibbs sampling ( Hinton & Salakhutdinov , 2006 ) , possibly accelerated using Langevin dynamics ( Du & Mordatch , 2019 ; Song et al. , 2020 ) , which leverages the gradient of the EBM to conduct sampling : xk = xk−1 − 2 ∇xEφ ( xk−1 ) + √ ω , ω ∼ N ( 0 , I ) , ( 3 ) where refers to the step size . x0 are the samples drawn from a random initial distribution and we take the xK withK Langevin dynamics steps as the generated samples of the stationary distribution . Published as a conference paper at ICLR 2021 < latexit sha1_base64= '' vIs0DtZMVgyrXYZyWvMVVQo2iJ8= '' > AAAB8nicbVDLSgMxFM3UV62vqks3wSK4kDIjBXVXcKHLCvYB06Fk0kwbmkmG5I5Qhn6GGxeKuPVr3Pk3ZtpZaOuBwOGce8m5J0wEN+C6305pbX1jc6u8XdnZ3ds/qB4edYxKNWVtqoTSvZAYJrhkbeAgWC/RjMShYN1wcpv73SemDVfyEaYJC2IykjzilICV/H5MYEyJyO5mg2rNrbtz4FXiFaSGCrQG1a/+UNE0ZhKoIMb4nptAkBENnAo2q/RTwxJCJ2TEfEsliZkJsnnkGT6zyhBHStsnAc/V3xsZiY2ZxqGdzCOaZS8X//P8FKLrIOMySYFJuvgoSgUGhfP78ZBrRkFMLSFUc5sV0zHRhIJtqWJL8JZPXiWdy7rXqN88NGrNi6KOMjpBp+gceegKNdE9aqE2okihZ/SK3hxwXpx352MxWnKKnWP0B87nD3aukVM= < /latexit > < latexit sha1_base64= '' ZURxyFRkumcoZhtLB9tuZDzUxpQ= '' > AAACFHicbVDLSgMxFM34rPU16rKbYBEqSJmRgroruNGNVLAP6JSSSTNtaJIZkoxQhln4E/6CW927E7fu3folZtpZ2NYDIYdz7uXee/yIUaUd59taWV1b39gsbBW3d3b39u2Dw5YKY4lJE4cslB0fKcKoIE1NNSOdSBLEfUba/vg689uPRCoaigc9iUiPo6GgAcVIG6lvlzyO9AgjltylFc/niZOewey/TU/7dtmpOlPAZeLmpAxyNPr2jzcIccyJ0JghpbquE+legqSmmJG06MWKRAiP0ZB0DRWIE9VLpkek8MQoAxiE0jyh4VT925EgrtSE+6YyW1ktepn4n9eNdXDZS6iIYk0Eng0KYgZ1CLNE4IBKgjWbGIKwpGZXiEdIIqxNbnNTfJ4WTSjuYgTLpHVedWvVq/tauV7J4ymAEjgGFeCCC1AHN6ABmgCDJ/ACXsGb9Wy9Wx/W56x0xcp7jsAcrK9foQCeKQ== < /latexit > < latexit sha1_base64= '' S5vzONPPGcE2Bnxqdal57hBhNUE= '' > AAACAnicbVDLSsNAFJ3UV62vqks3g0Wom5JIQd0V3LisYB+QhjKZTNqh8wgzE6GE7PwFt7p3J279Ebd+idM2C9t64MLhnHu5954wYVQb1/12ShubW9s75d3K3v7B4VH1+KSrZaow6WDJpOqHSBNGBekYahjpJ4ogHjLSCyd3M7/3RJSmUjyaaUICjkaCxhQjYyV/EPIsyutm6F4OqzW34c4B14lXkBoo0B5WfwaRxCknwmCGtPY9NzFBhpShmJG8Mkg1SRCeoBHxLRWIEx1k85NzeGGVCMZS2RIGztW/ExniWk95aDs5MmO96s3E/zw/NfFNkFGRpIYIvFgUpwwaCWf/w4gqgg2bWoKwovZWiMdIIWxsSktbQp5XbCjeagTrpHvV8JqN24dmrVUv4imDM3AO6sAD16AF7kEbdAAGEryAV/DmPDvvzofzuWgtOcXMKViC8/UL8JyXWw== < /latexit > < latexit sha1_base64= '' F31lh5CKHaiA3aXYW2ZI+Y7ONAQ= '' > AAAB/3icbVA9SwNBEJ2LXzF+RS1tFoNgIeFOAmoXEMQygvmA5Ah7m71kye7dsTsnhJDCv2CrvZ3Y+lNs/SVukitM4oOBx3szzMwLEikMuu63k1tb39jcym8Xdnb39g+Kh0cNE6ea8TqLZaxbATVciojXUaDkrURzqgLJm8Hwduo3n7g2Io4ecZRwX9F+JELBKFqpddft4IAj7RZLbtmdgawSLyMlyFDrFn86vZilikfIJDWm7bkJ+mOqUTDJJ4VOanhC2ZD2edvSiCpu/PHs3gk5s0qPhLG2FSGZqX8nxlQZM1KB7VQUB2bZm4r/ee0Uw2t/LKIkRR6x+aIwlQRjMn2e9ITmDOXIEsq0sLcSNqCaMrQRLWwJ1KRgQ/GWI1gljcuyVynfPFRK1YssnjycwCmcgwdXUIV7qEEdGEh4gVd4c56dd+fD+Zy35pxs5hgW4Hz9AkIZln0= < /latexit > < latexit sha1_base64= '' 3uFAD5t20r5hkITaCaR1FRhMgvY= '' > AAACAnicbVDLSsNAFJ3UV62vqks3g0Wom5JIQd0V3LisYB+QhjKZTNqh8wgzE6GE7PwFt7p3J279Ebd+idM2C9t64MLhnHu5954wYVQb1/12ShubW9s75d3K3v7B4VH1+KSrZaow6WDJpOqHSBNGBekYahjpJ4ogHjLSCyd3M7/3RJSmUjyaaUICjkaCxhQjYyV/EPIsyutm6F0OqzW34c4B14lXkBoo0B5WfwaRxCknwmCGtPY9NzFBhpShmJG8Mkg1SRCeoBHxLRWIEx1k85NzeGGVCMZS2RIGztW/ExniWk95aDs5MmO96s3E/zw/NfFNkFGRpIYIvFgUpwwaCWf/w4gqgg2bWoKwovZWiMdIIWxsSktbQp5XbCjeagTrpHvV8JqN24dmrVUv4imDM3AO6sAD16AF7kEbdAAGEryAV/DmPDvvzofzuWgtOcXMKViC8/UL8jGXXA== < /latexit > < latexit sha1_base64= '' BSPQokcnd67Ox4bSGWxni9WSepw= '' > AAACF3icbVBNS8NAEN3Ur1q/qh4FWSxCBSmJFNRbwYMeK9gPaErZbDft0t0k7E6EEnPzT/gXvOrdm3j16NVf4rbNwVYfDDzem2FmnhcJrsG2v6zc0vLK6lp+vbCxubW9U9zda+owVpQ1aChC1faIZoIHrAEcBGtHihHpCdbyRlcTv3XPlOZhcAfjiHUlGQTc55SAkXrFw6jnwpABKbueTPopfsCuJDCkRCTX6UmvWLIr9hT4L3EyUkIZ6r3it9sPaSxZAFQQrTuOHUE3IQo4FSwtuLFmEaEjMmAdQwMime4m0z9SfGyUPvZDZSoAPFV/TyREaj2Wnumc3KgXvYn4n9eJwb/oJjyIYmABnS3yY4EhxJNQcJ8rRkGMDSFUcXMrpkOiCAUT3dwWT6YFE4qzGMFf0jyrONXK5W21VDvN4smjA3SEyshB56iGblAdNRBFj+gZvaBX68l6s96tj1lrzspm9tEcrM8feuyfvQ== < /latexit > < latexit sha1_base64= '' dhDz+mg0jfbxnERYd0jVT19v2HI= '' > AAACGHicbZDLSsNAFIYnXmu9RV26cLAIFUpJpKDuCi50WcVeoAllMpm2Q2eSMDMRSszSl/AV3Orenbh159YncdJmYVt/GPj4zzmcM78XMSqVZX0bS8srq2vrhY3i5tb2zq65t9+SYSwwaeKQhaLjIUkYDUhTUcVIJxIEcY+Rtje6yurtByIkDYN7NY6Iy9EgoH2KkdJWzzyKyo7Hk7sUPsIM/LQCHY7UECOWXKenPbNkVa2J4CLYOZRArkbP/HH8EMecBAozJGXXtiLlJkgoihlJi04sSYTwCA1IV2OAOJFuMvlICk+048N+KPQLFJy4fycSxKUcc093ZjfK+Vpm/lfrxqp/4SY0iGJFAjxd1I8ZVCHMUoE+FQQrNtaAsKD6VoiHSCCsdHYzWzyeFnUo9nwEi9A6q9q16uVtrVSv5PEUwCE4BmVgg3NQBzegAZoAgyfwAl7Bm/FsvBsfxue0dcnIZw7AjIyvX4fin7c= < /latexit > < latexit sha1_base64= '' gQ1W5BUBQuSs4llOR92XD3cLttw= '' > AAAB/XicbVA9SwNBEJ2LXzF+RS1tFoOQKtyJoHYBG8so5gOSI+xt9pI1u3vH7p4QjsO/YKu9ndj6W2z9JW6SK0zig4HHezPMzAtizrRx3W+nsLa+sblV3C7t7O7tH5QPj1o6ShShTRLxSHUCrClnkjYNM5x2YkWxCDhtB+Obqd9+okqzSD6YSUx9gYeShYxgY6VWLxDpfdYvV9yaOwNaJV5OKpCj0S//9AYRSQSVhnCsdddzY+OnWBlGOM1KvUTTGJMxHtKupRILqv10dm2GzqwyQGGkbEmDZurfiRQLrScisJ0Cm5Fe9qbif143MeGVnzIZJ4ZKMl8UJhyZCE1fRwOmKDF8YgkmitlbERlhhYmxAS1sCURWsqF4yxGsktZ5zbuoXd9dVOrVPJ4inMApVMGDS6jDLTSgCQQe4QVe4c15dt6dD+dz3lpw8pljWIDz9QvyzpXD < /latexit > < latexit sha1_base64= '' OpcR7prbb0BxuXfNQa1FkN+WMYo= '' > AAACGHicbZDLSsNAFIYn9VbrLerShYNFqCAlkYK6K7jQZRV7gSaUyWTaDp1JwsxEKDFLX8JXcKt7d+LWnVufxEmbhW39YeDjP+dwzvxexKhUlvVtFJaWV1bXiuuljc2t7R1zd68lw1hg0sQhC0XHQ5IwGpCmooqRTiQI4h4jbW90ldXbD0RIGgb3ahwRl6NBQPsUI6WtnnkYVRyPJ3cpfIQZ+OkpdDhSQ4xYcp2e9MyyVbUmgotg51AGuRo988fxQxxzEijMkJRd24qUmyChKGYkLTmxJBHCIzQgXY0B4kS6yeQjKTzWjg/7odAvUHDi/p1IEJdyzD3dmd0o52uZ+V+tG6v+hZvQIIoVCfB0UT9mUIUwSwX6VBCs2FgDwoLqWyEeIoGw0tnNbPF4WtKh2PMRLELrrGrXqpe3tXK9ksdTBAfgCFSADc5BHdyABmgCDJ7AC3gFb8az8W58GJ/T1oKRz+yDGRlfv4aun7M= < /latexit > < latexit sha1_base64= '' lhItiocMBRqGObaIUKv7lTDqZ9g= '' > AAAB/XicbVBNSwMxEJ2tX7V+VT16CRbBg5RdKVRvBRE8VrAf0C4lm2bb2CS7JFmhLMW/4FXv3sSrv8Wrv8S03YNtfTDweG+GmXlBzJk2rvvt5NbWNza38tuFnd29/YPi4VFTR4kitEEiHql2gDXlTNKGYYbTdqwoFgGnrWB0M/VbT1RpFskHM46pL/BAspARbKzUvO114yHrFUtu2Z0BrRIvIyXIUO8Vf7r9iCSCSkM41rrjubHxU6wMI5xOCt1E0xiTER7QjqUSC6r9dHbtBJ1ZpY/CSNmSBs3UvxMpFlqPRWA7BTZDvexNxf+8TmLCKz9lMk4MlWS+KEw4MhGavo76TFFi+NgSTBSztyIyxAoTYwNa2BKIScGG4i1HsEqal2WvUr6+r5RqF1k8eTiBUzgHD6pQgzuoQwMIPMILvMKb8+y8Ox/O57w152Qzx7AA5+sXoUCVkw== < /latexit > < latexit sha1_base64= '' 8NEpmi0zn1Gl+TfONZYwYrCHrJU= '' > AAACFHicbVDLSsNAFJ34rPUVddnNYBEqlJJIQd0VRHRZxT6gCWUynbRDZ5IwMxFKyMKf8Bfc6t6duHXv1i9x0mZhWw9cOJxzL/fe40WMSmVZ38bK6tr6xmZhq7i9s7u3bx4ctmUYC0xaOGSh6HpIEkYD0lJUMdKNBEHcY6Tjja8yv/NIhKRh8KAmEXE5GgbUpxgpLfXN0nXfiUa04ng8uU+r0OFIjTBiyU162jfLVs2aAi4TOydlkKPZN3+cQYhjTgKFGZKyZ1uRchMkFMWMpEUnliRCeIyGpKdpgDiRbjJ9IoUnWhlAPxS6AgWn6t+JBHEpJ9zTndmNctHLxP+8Xqz8CzehQRQrEuDZIj9mUIUwSwQOqCBYsYkmCAuqb4V4hATCSuc2t8XjaVGHYi9GsEzaZzW7Xru8q5cb1TyeAiiBY1ABNjgHDXALmqAFMHgCL+AVvBnPxrvxYXzOWleMfOYIzMH4+gWBw54d < /latexit > < latexit sha1_base64= '' gQ1W5BUBQuSs4llOR92XD3cLttw= '' > AAAB/XicbVA9SwNBEJ2LXzF+RS1tFoOQKtyJoHYBG8so5gOSI+xt9pI1u3vH7p4QjsO/YKu9ndj6W2z9JW6SK0zig4HHezPMzAtizrRx3W+nsLa+sblV3C7t7O7tH5QPj1o6ShShTRLxSHUCrClnkjYNM5x2YkWxCDhtB+Obqd9+okqzSD6YSUx9gYeShYxgY6VWLxDpfdYvV9yaOwNaJV5OKpCj0S//9AYRSQSVhnCsdddzY+OnWBlGOM1KvUTTGJMxHtKupRILqv10dm2GzqwyQGGkbEmDZurfiRQLrScisJ0Cm5Fe9qbif143MeGVnzIZJ4ZKMl8UJhyZCE1fRwOmKDF8YgkmitlbERlhhYmxAS1sCURWsqF4yxGsktZ5zbuoXd9dVOrVPJ4inMApVMGDS6jDLTSgCQQe4QVe4c15dt6dD+dz3lpw8pljWIDz9QvyzpXD < /latexit > < latexit sha1_base64= '' ORiRlP3d8Ck3qImxG8IgZjn4WBQ= '' > AAAB+HicbVA9SwNBEJ2LXzF+RS1tFoNgIeFOAmoXsLFMwHxAcoS9zSRZsnt37O4J8cgvsNXeTmz9N7b+EjfJFSbxwcDjvRlm5gWx4Nq47reT29jc2t7J7xb29g8Oj4rHJ00dJYphg0UiUu2AahQ8xIbhRmA7VkhlILAVjO9nfusJleZR+GgmMfqSDkM+4IwaK9XjXrHklt05yDrxMlKCDLVe8afbj1giMTRMUK07nhsbP6XKcCZwWugmGmPKxnSIHUtDKlH76fzQKbmwSp8MImUrNGSu/p1IqdR6IgPbKakZ6VVvJv7ndRIzuPVTHsaJwZAtFg0SQUxEZl+TPlfIjJhYQpni9lbCRlRRZmw2S1sCOS3YULzVCNZJ87rsVcp39UqpepXFk4czOIdL8OAGqvAANWgAA4QXeIU359l5dz6cz0VrzslmTmEJztcvBTaTkA== < /latexit >
The authors of this manuscript proposed a generative dynamics system for the modelling and generation of 3D conformations of molecules. Specifically, there are three components: (1) conditional graph continuous flow (CGCF) to transform random noise to distances, (2)a closed-form distribution p(R|d, G), and (3) an energy-based tilting model (ETM) to capture long-range interactions and correct the position matrix distribution. The proposed framework was compared with two deep learning methods for conformation generations -- CVGAE & GraphDG, as well as the computational chemistry tool RDKit on GEOM-QM9, GEOM-Drugs, and ISO17 data sets. Comparisons in terms of COV and MAT scores show that the proposed method (particularly the one enhanced with ETM) can outperform baselines. Further comparisons of distances densities show that CGCF (but without ETM) worked best over baselines.
SP:11a4f15893b32b9391d04a507bed8528a130f533
Learning Neural Generative Dynamics for Molecular Conformation Generation
1 INTRODUCTION . Recently , we have witnessed the success of graph-based representations for molecular modeling in a variety of tasks such as property prediction ( Gilmer et al. , 2017 ) and molecule generation ( You et al. , 2018 ; Shi et al. , 2020 ) . However , a more natural and intrinsic representation of a molecule is its 3D structure , commonly known as the molecular geometry or conformation , which represents each atom by its 3D coordinate . The conformation of a molecule determines its biological and physical properties such as charge distribution , steric constraints , as well as interactions with other molecules . Furthermore , large molecules tend to comprise a number of rotatable bonds , which may induce flexible conformation changes and a large number of feasible conformations in nature . Generating valid and stable conformations of a given molecule remains very challenging . Experimentally , such structures are determined by expensive and time-consuming crystallography . Computational approaches based on Markov chain Monte Carlo ( MCMC ) or molecular dynamics ( MD ) ( De Vivo et al. , 2016 ) are computationally expensive , especially for large molecules ( Ballard et al. , 2015 ) . Machine learning methods have recently shown great potential for molecular conformation generation by training on a large collection of data to model the probability distribution of potential conformations R based on the molecular graph G , i.e. , p ( R|G ) . For example , Mansimov et al . ∗Equal contribution . Work was done during Shitong ’ s internship at Mila . 1Code is available at https : //github.com/DeepGraphLearning/CGCF-ConfGen . ( 2019 ) proposed a Conditional Variational Graph Autoencoders ( CVGAE ) for molecular conformation generation . A graph neural network ( Gilmer et al. , 2017 ) is first applied to the molecular graph to get the atom representations , based on which 3D coordinates are further generated . One limitation of such an approach is that by directly generating the 3D coordinates of atoms it fails to model the rotational and translational invariance of molecular conformations . To address this issue , instead of generating the 3D coordinates directly , Simm & Hernández-Lobato ( 2020 ) recently proposed to first model the molecule ’ s distance geometry ( i.e. , the distances between atoms ) —which are rotationally and translationally invariant—and then generate the molecular conformation based on the distance geometry through a post-processing algorithm ( Liberti et al. , 2014 ) . Similar to Mansimov et al . ( 2019 ) , a few layers of graph neural networks are applied to the molecular graph to learn the representations of different edges , which are further used to generate the distances of different edges independently . This approach is capable of more often generating valid molecular conformations . Although these new approaches have made tremendous progress , the problem remains very challenging and far from solved . First , each molecule may have multiple stable conformations around a number of states which are thermodynamically stable . In other words , the distribution p ( R|G ) is very complex and multi-modal . Models with high capacity are required to model such complex distributions . Second , existing approaches usually apply a few layers of graph neural networks to learn the representations of nodes ( or edges ) and then generate the 3D coordinates ( or distances ) based on their representations independently . Such approaches are necessarily limited to capturing a single mode of p ( R|G ) ( since the coordinates or distances are sampled independently ) and are incapable of modeling multimodal joint distributions and the form of the graph neural net computation makes it difficult to capture long-range dependencies between atoms , especially in large molecules . Inspired by the recent progress with deep generative models , this paper proposes a novel and principled probabilistic framework for molecular geometry generation , which addresses the above two limitations . Our framework combines the advantages of normalizing flows ( Dinh et al. , 2014 ) and energy-based approaches ( LeCun et al. , 2006 ) , which have a strong model capacity for modeling complex distributions , are flexible to model long-range dependency between atoms , and enjoy efficient sampling and training procedures . Similar to the work of Simm & Hernández-Lobato ( 2020 ) , we also first learn the distribution of distances d given the graph G , i.e. , p ( d|G ) , and define another distribution of conformations R given the distances d , i.e. , p ( R|d , G ) . Specifically , we propose a novel Conditional Graph Continuous Flow ( CGCF ) for distance geometry ( d ) generation conditioned on the molecular graph G. Given a molecular graph G , CGCF defines an invertible mapping between a base distribution ( e.g. , a multivariate normal distribution ) and the molecular distance geometry , using a virtually infinite number of graph transformation layers on atoms represented by a Neural Ordinary Differential Equations architecture ( Chen et al. , 2018 ) . Such an approach enjoys very high flexibility to model complex distributions of distance geometry . Once the molecular distance geometry d is generated , we further generate the 3D coordinates R by searching from the probability p ( R|d , G ) . Though the CGCF has a high capacity for modeling complex distributions , the distances of different edges are still independently updated in the transformations , which limits its capacity for modeling long-range dependency between atoms in the sampling process . Therefore , we further propose another unnormalized probability function , i.e. , an energy-based model ( EBM ) ( Hinton & Salakhutdinov , 2006 ; LeCun et al. , 2006 ; Ngiam et al. , 2011 ) , which acts as a tilting term of the flow-based distribution and directly models the joint distribution of R. Specifically , the EBM trains an energy function E ( R , G ) , which is approximated by a neural network . The flow- and energy-based models are combined in a novel way for joint training and mutual enhancement . First , energy-based methods are usually difficult to train due to the slow sampling process . In addition , the distribution of conformations is usually highly multi-modal , and the sampling procedures based on Gibbs sampling or Langevin Dynamics ( Bengio et al. , 2013a ; b ) tend to get trapped around modes , making it difficult to mix between different modes ( Bengio et al. , 2013a ) . Here we use the flow-based model as a proposal distribution for the energy model , which is capable to generate diverse samples for training energy models . Second , the flow-based model lacks the capacity to explicitly model the long-range dependencies between atoms , which we find can however be effectively modeled by an energy function E ( R , G ) . Our sampling process can be therefore viewed as a two-stage dynamic system , where we first take the flow-based model to quickly synthesize realistic conformations and then used the learned energy E ( R , G ) to refine the generated conformations through Langevin Dynamics . We conduct comprehensive experiments on several recently proposed benchmarks , including GEOM-QM9 , GEOM-Drugs ( Axelrod & Gomez-Bombarelli , 2020 ) and ISO17 ( Simm & Hernández-Lobato , 2020 ) . Numerical evaluations show that our proposed framework consistently outperforms the previous state-of-the-art ( GraphDG ) on both conformation generation and distance modeling tasks , with a clear margin . 2 PROBLEM DEFINITION AND PRELIMINARIES . 2.1 PROBLEM DEFINITION . Notations . Following existing work ( Simm & Hernández-Lobato , 2020 ) , each molecule is represented as an undirected graph G = 〈V , E〉 , where V is the set of nodes representing atoms and E is the set of edges representing inter-atomic bonds . Each node v in V is labeled with atomic properties such as element type . The edge in E connecting u and v is denoted as euv , and is labeled with its bond type . We also follow the previous work ( Simm & Hernández-Lobato , 2020 ) to expand the molecular graph with auxiliary bonds , which is elaborated in Appendix B . For the molecular 3D representation , each atom in V is assigned with a 3D position vector r ∈ R3 . We denote duv = ‖ru − rv‖2 as the Euclidean distance between the uth and vth atom . Therefore , we can represent all the positions { rv } v∈V as a matrix R ∈ R|V|×3 and all the distances between connected nodes { duv } euv∈E as a vector d ∈ R|E| . Problem Definition . The problem of molecular conformation generation is defined as a conditional generation process . More specifically , our goal is to model the conditional distribution of atomic positions R given the molecular graph G , i.e. , p ( R|G ) . 2.2 PRELIMINARIES . Continuous Normalizing Flow . A normalizing flow ( Dinh et al. , 2014 ; Rezende & Mohamed , 2015 ) defines a series of invertible deterministic transformations from an initial known distribution p ( z ) to a more complicated one p ( x ) . Recently , normalizing flows have been generalized from discrete number of layers to continuous ( Chen et al. , 2018 ; Grathwohl et al. , 2018 ) by defining the transformation fθ as a continuous-time dynamic ∂z ( t ) ∂t = fθ ( z ( t ) , t ) . Formally , with the latent variable z ( t0 ) ∼ p ( z ) at the start time , the continuous normalizing flow ( CNF ) defines the transformation x = z ( t0 ) + ∫ t1 t0 fθ ( z ( t ) , t ) dt . Then the exact density for pθ ( x ) can be computed by : log pθ ( x ) = log p ( z ( t0 ) ) − ∫ t1 t0 Tr ( ∂fθ ∂z ( t ) ) dt ( 1 ) where z ( t0 ) can be obtained by inverting the continuous dynamic z ( t0 ) = x + ∫ t0 t1 fθ ( z ( t ) , t ) dt . A black-box ordinary differential equation ( ODE ) solver can be applied to estimate the outputs and inputs gradients and optimize the CNF model ( Chen et al. , 2018 ; Grathwohl et al. , 2018 ) . Energy-based Models . Energy-based models ( EBMs ) ( Dayan et al. , 1995 ; Hinton & Salakhutdinov , 2006 ; LeCun et al. , 2006 ) use a scalar parametric energy function Eφ ( x ) to fit the data distribution . Formally , the energy function induces a density function with the Boltzmann distribution pφ ( x ) = exp ( −Eφ ( x ) ) /Z ( φ ) , where Z = ∫ exp ( −Eφ ( x ) ) dx denotes the partition function . EBM can be learned with Noise contrastive estimation ( NCE ) ( Gutmann & Hyvärinen , 2010 ) by treating the normalizing constant as a free parameter . Given the training examples from both the dataset and a noise distribution q ( x ) , φ can be estimated by maximizing the following objective function : J ( φ ) = Epdata [ log pφ ( x ) pφ ( x ) + q ( x ) ] + Eq [ log q ( x ) pφ ( x ) + q ( x ) ] , ( 2 ) which turns the estimation of EBM into a discriminative learning problem . Sampling from Eφ can be done with a variety of methods such as Markov chain Monte Carlo ( MCMC ) or Gibbs sampling ( Hinton & Salakhutdinov , 2006 ) , possibly accelerated using Langevin dynamics ( Du & Mordatch , 2019 ; Song et al. , 2020 ) , which leverages the gradient of the EBM to conduct sampling : xk = xk−1 − 2 ∇xEφ ( xk−1 ) + √ ω , ω ∼ N ( 0 , I ) , ( 3 ) where refers to the step size . x0 are the samples drawn from a random initial distribution and we take the xK withK Langevin dynamics steps as the generated samples of the stationary distribution . Published as a conference paper at ICLR 2021 < latexit sha1_base64= '' vIs0DtZMVgyrXYZyWvMVVQo2iJ8= '' > AAAB8nicbVDLSgMxFM3UV62vqks3wSK4kDIjBXVXcKHLCvYB06Fk0kwbmkmG5I5Qhn6GGxeKuPVr3Pk3ZtpZaOuBwOGce8m5J0wEN+C6305pbX1jc6u8XdnZ3ds/qB4edYxKNWVtqoTSvZAYJrhkbeAgWC/RjMShYN1wcpv73SemDVfyEaYJC2IykjzilICV/H5MYEyJyO5mg2rNrbtz4FXiFaSGCrQG1a/+UNE0ZhKoIMb4nptAkBENnAo2q/RTwxJCJ2TEfEsliZkJsnnkGT6zyhBHStsnAc/V3xsZiY2ZxqGdzCOaZS8X//P8FKLrIOMySYFJuvgoSgUGhfP78ZBrRkFMLSFUc5sV0zHRhIJtqWJL8JZPXiWdy7rXqN88NGrNi6KOMjpBp+gceegKNdE9aqE2okihZ/SK3hxwXpx352MxWnKKnWP0B87nD3aukVM= < /latexit > < latexit sha1_base64= '' ZURxyFRkumcoZhtLB9tuZDzUxpQ= '' > AAACFHicbVDLSgMxFM34rPU16rKbYBEqSJmRgroruNGNVLAP6JSSSTNtaJIZkoxQhln4E/6CW927E7fu3folZtpZ2NYDIYdz7uXee/yIUaUd59taWV1b39gsbBW3d3b39u2Dw5YKY4lJE4cslB0fKcKoIE1NNSOdSBLEfUba/vg689uPRCoaigc9iUiPo6GgAcVIG6lvlzyO9AgjltylFc/niZOewey/TU/7dtmpOlPAZeLmpAxyNPr2jzcIccyJ0JghpbquE+legqSmmJG06MWKRAiP0ZB0DRWIE9VLpkek8MQoAxiE0jyh4VT925EgrtSE+6YyW1ktepn4n9eNdXDZS6iIYk0Eng0KYgZ1CLNE4IBKgjWbGIKwpGZXiEdIIqxNbnNTfJ4WTSjuYgTLpHVedWvVq/tauV7J4ymAEjgGFeCCC1AHN6ABmgCDJ/ACXsGb9Wy9Wx/W56x0xcp7jsAcrK9foQCeKQ== < /latexit > < latexit sha1_base64= '' S5vzONPPGcE2Bnxqdal57hBhNUE= '' > AAACAnicbVDLSsNAFJ3UV62vqks3g0Wom5JIQd0V3LisYB+QhjKZTNqh8wgzE6GE7PwFt7p3J279Ebd+idM2C9t64MLhnHu5954wYVQb1/12ShubW9s75d3K3v7B4VH1+KSrZaow6WDJpOqHSBNGBekYahjpJ4ogHjLSCyd3M7/3RJSmUjyaaUICjkaCxhQjYyV/EPIsyutm6F4OqzW34c4B14lXkBoo0B5WfwaRxCknwmCGtPY9NzFBhpShmJG8Mkg1SRCeoBHxLRWIEx1k85NzeGGVCMZS2RIGztW/ExniWk95aDs5MmO96s3E/zw/NfFNkFGRpIYIvFgUpwwaCWf/w4gqgg2bWoKwovZWiMdIIWxsSktbQp5XbCjeagTrpHvV8JqN24dmrVUv4imDM3AO6sAD16AF7kEbdAAGEryAV/DmPDvvzofzuWgtOcXMKViC8/UL8JyXWw== < /latexit > < latexit sha1_base64= '' F31lh5CKHaiA3aXYW2ZI+Y7ONAQ= '' > AAAB/3icbVA9SwNBEJ2LXzF+RS1tFoNgIeFOAmoXEMQygvmA5Ah7m71kye7dsTsnhJDCv2CrvZ3Y+lNs/SVukitM4oOBx3szzMwLEikMuu63k1tb39jcym8Xdnb39g+Kh0cNE6ea8TqLZaxbATVciojXUaDkrURzqgLJm8Hwduo3n7g2Io4ecZRwX9F+JELBKFqpddft4IAj7RZLbtmdgawSLyMlyFDrFn86vZilikfIJDWm7bkJ+mOqUTDJJ4VOanhC2ZD2edvSiCpu/PHs3gk5s0qPhLG2FSGZqX8nxlQZM1KB7VQUB2bZm4r/ee0Uw2t/LKIkRR6x+aIwlQRjMn2e9ITmDOXIEsq0sLcSNqCaMrQRLWwJ1KRgQ/GWI1gljcuyVynfPFRK1YssnjycwCmcgwdXUIV7qEEdGEh4gVd4c56dd+fD+Zy35pxs5hgW4Hz9AkIZln0= < /latexit > < latexit sha1_base64= '' 3uFAD5t20r5hkITaCaR1FRhMgvY= '' > AAACAnicbVDLSsNAFJ3UV62vqks3g0Wom5JIQd0V3LisYB+QhjKZTNqh8wgzE6GE7PwFt7p3J279Ebd+idM2C9t64MLhnHu5954wYVQb1/12ShubW9s75d3K3v7B4VH1+KSrZaow6WDJpOqHSBNGBekYahjpJ4ogHjLSCyd3M7/3RJSmUjyaaUICjkaCxhQjYyV/EPIsyutm6F0OqzW34c4B14lXkBoo0B5WfwaRxCknwmCGtPY9NzFBhpShmJG8Mkg1SRCeoBHxLRWIEx1k85NzeGGVCMZS2RIGztW/ExniWk95aDs5MmO96s3E/zw/NfFNkFGRpIYIvFgUpwwaCWf/w4gqgg2bWoKwovZWiMdIIWxsSktbQp5XbCjeagTrpHvV8JqN24dmrVUv4imDM3AO6sAD16AF7kEbdAAGEryAV/DmPDvvzofzuWgtOcXMKViC8/UL8jGXXA== < /latexit > < latexit sha1_base64= '' BSPQokcnd67Ox4bSGWxni9WSepw= '' > AAACF3icbVBNS8NAEN3Ur1q/qh4FWSxCBSmJFNRbwYMeK9gPaErZbDft0t0k7E6EEnPzT/gXvOrdm3j16NVf4rbNwVYfDDzem2FmnhcJrsG2v6zc0vLK6lp+vbCxubW9U9zda+owVpQ1aChC1faIZoIHrAEcBGtHihHpCdbyRlcTv3XPlOZhcAfjiHUlGQTc55SAkXrFw6jnwpABKbueTPopfsCuJDCkRCTX6UmvWLIr9hT4L3EyUkIZ6r3it9sPaSxZAFQQrTuOHUE3IQo4FSwtuLFmEaEjMmAdQwMime4m0z9SfGyUPvZDZSoAPFV/TyREaj2Wnumc3KgXvYn4n9eJwb/oJjyIYmABnS3yY4EhxJNQcJ8rRkGMDSFUcXMrpkOiCAUT3dwWT6YFE4qzGMFf0jyrONXK5W21VDvN4smjA3SEyshB56iGblAdNRBFj+gZvaBX68l6s96tj1lrzspm9tEcrM8feuyfvQ== < /latexit > < latexit sha1_base64= '' dhDz+mg0jfbxnERYd0jVT19v2HI= '' > AAACGHicbZDLSsNAFIYnXmu9RV26cLAIFUpJpKDuCi50WcVeoAllMpm2Q2eSMDMRSszSl/AV3Orenbh159YncdJmYVt/GPj4zzmcM78XMSqVZX0bS8srq2vrhY3i5tb2zq65t9+SYSwwaeKQhaLjIUkYDUhTUcVIJxIEcY+Rtje6yurtByIkDYN7NY6Iy9EgoH2KkdJWzzyKyo7Hk7sUPsIM/LQCHY7UECOWXKenPbNkVa2J4CLYOZRArkbP/HH8EMecBAozJGXXtiLlJkgoihlJi04sSYTwCA1IV2OAOJFuMvlICk+048N+KPQLFJy4fycSxKUcc093ZjfK+Vpm/lfrxqp/4SY0iGJFAjxd1I8ZVCHMUoE+FQQrNtaAsKD6VoiHSCCsdHYzWzyeFnUo9nwEi9A6q9q16uVtrVSv5PEUwCE4BmVgg3NQBzegAZoAgyfwAl7Bm/FsvBsfxue0dcnIZw7AjIyvX4fin7c= < /latexit > < latexit sha1_base64= '' gQ1W5BUBQuSs4llOR92XD3cLttw= '' > AAAB/XicbVA9SwNBEJ2LXzF+RS1tFoOQKtyJoHYBG8so5gOSI+xt9pI1u3vH7p4QjsO/YKu9ndj6W2z9JW6SK0zig4HHezPMzAtizrRx3W+nsLa+sblV3C7t7O7tH5QPj1o6ShShTRLxSHUCrClnkjYNM5x2YkWxCDhtB+Obqd9+okqzSD6YSUx9gYeShYxgY6VWLxDpfdYvV9yaOwNaJV5OKpCj0S//9AYRSQSVhnCsdddzY+OnWBlGOM1KvUTTGJMxHtKupRILqv10dm2GzqwyQGGkbEmDZurfiRQLrScisJ0Cm5Fe9qbif143MeGVnzIZJ4ZKMl8UJhyZCE1fRwOmKDF8YgkmitlbERlhhYmxAS1sCURWsqF4yxGsktZ5zbuoXd9dVOrVPJ4inMApVMGDS6jDLTSgCQQe4QVe4c15dt6dD+dz3lpw8pljWIDz9QvyzpXD < /latexit > < latexit sha1_base64= '' OpcR7prbb0BxuXfNQa1FkN+WMYo= '' > AAACGHicbZDLSsNAFIYn9VbrLerShYNFqCAlkYK6K7jQZRV7gSaUyWTaDp1JwsxEKDFLX8JXcKt7d+LWnVufxEmbhW39YeDjP+dwzvxexKhUlvVtFJaWV1bXiuuljc2t7R1zd68lw1hg0sQhC0XHQ5IwGpCmooqRTiQI4h4jbW90ldXbD0RIGgb3ahwRl6NBQPsUI6WtnnkYVRyPJ3cpfIQZ+OkpdDhSQ4xYcp2e9MyyVbUmgotg51AGuRo988fxQxxzEijMkJRd24qUmyChKGYkLTmxJBHCIzQgXY0B4kS6yeQjKTzWjg/7odAvUHDi/p1IEJdyzD3dmd0o52uZ+V+tG6v+hZvQIIoVCfB0UT9mUIUwSwX6VBCs2FgDwoLqWyEeIoGw0tnNbPF4WtKh2PMRLELrrGrXqpe3tXK9ksdTBAfgCFSADc5BHdyABmgCDJ7AC3gFb8az8W58GJ/T1oKRz+yDGRlfv4aun7M= < /latexit > < latexit sha1_base64= '' lhItiocMBRqGObaIUKv7lTDqZ9g= '' > AAAB/XicbVBNSwMxEJ2tX7V+VT16CRbBg5RdKVRvBRE8VrAf0C4lm2bb2CS7JFmhLMW/4FXv3sSrv8Wrv8S03YNtfTDweG+GmXlBzJk2rvvt5NbWNza38tuFnd29/YPi4VFTR4kitEEiHql2gDXlTNKGYYbTdqwoFgGnrWB0M/VbT1RpFskHM46pL/BAspARbKzUvO114yHrFUtu2Z0BrRIvIyXIUO8Vf7r9iCSCSkM41rrjubHxU6wMI5xOCt1E0xiTER7QjqUSC6r9dHbtBJ1ZpY/CSNmSBs3UvxMpFlqPRWA7BTZDvexNxf+8TmLCKz9lMk4MlWS+KEw4MhGavo76TFFi+NgSTBSztyIyxAoTYwNa2BKIScGG4i1HsEqal2WvUr6+r5RqF1k8eTiBUzgHD6pQgzuoQwMIPMILvMKb8+y8Ox/O57w152Qzx7AA5+sXoUCVkw== < /latexit > < latexit sha1_base64= '' 8NEpmi0zn1Gl+TfONZYwYrCHrJU= '' > AAACFHicbVDLSsNAFJ34rPUVddnNYBEqlJJIQd0VRHRZxT6gCWUynbRDZ5IwMxFKyMKf8Bfc6t6duHXv1i9x0mZhWw9cOJxzL/fe40WMSmVZ38bK6tr6xmZhq7i9s7u3bx4ctmUYC0xaOGSh6HpIEkYD0lJUMdKNBEHcY6Tjja8yv/NIhKRh8KAmEXE5GgbUpxgpLfXN0nXfiUa04ng8uU+r0OFIjTBiyU162jfLVs2aAi4TOydlkKPZN3+cQYhjTgKFGZKyZ1uRchMkFMWMpEUnliRCeIyGpKdpgDiRbjJ9IoUnWhlAPxS6AgWn6t+JBHEpJ9zTndmNctHLxP+8Xqz8CzehQRQrEuDZIj9mUIUwSwQOqCBYsYkmCAuqb4V4hATCSuc2t8XjaVGHYi9GsEzaZzW7Xru8q5cb1TyeAiiBY1ABNjgHDXALmqAFMHgCL+AVvBnPxrvxYXzOWleMfOYIzMH4+gWBw54d < /latexit > < latexit sha1_base64= '' gQ1W5BUBQuSs4llOR92XD3cLttw= '' > AAAB/XicbVA9SwNBEJ2LXzF+RS1tFoOQKtyJoHYBG8so5gOSI+xt9pI1u3vH7p4QjsO/YKu9ndj6W2z9JW6SK0zig4HHezPMzAtizrRx3W+nsLa+sblV3C7t7O7tH5QPj1o6ShShTRLxSHUCrClnkjYNM5x2YkWxCDhtB+Obqd9+okqzSD6YSUx9gYeShYxgY6VWLxDpfdYvV9yaOwNaJV5OKpCj0S//9AYRSQSVhnCsdddzY+OnWBlGOM1KvUTTGJMxHtKupRILqv10dm2GzqwyQGGkbEmDZurfiRQLrScisJ0Cm5Fe9qbif143MeGVnzIZJ4ZKMl8UJhyZCE1fRwOmKDF8YgkmitlbERlhhYmxAS1sCURWsqF4yxGsktZ5zbuoXd9dVOrVPJ4inMApVMGDS6jDLTSgCQQe4QVe4c15dt6dD+dz3lpw8pljWIDz9QvyzpXD < /latexit > < latexit sha1_base64= '' ORiRlP3d8Ck3qImxG8IgZjn4WBQ= '' > AAAB+HicbVA9SwNBEJ2LXzF+RS1tFoNgIeFOAmoXsLFMwHxAcoS9zSRZsnt37O4J8cgvsNXeTmz9N7b+EjfJFSbxwcDjvRlm5gWx4Nq47reT29jc2t7J7xb29g8Oj4rHJ00dJYphg0UiUu2AahQ8xIbhRmA7VkhlILAVjO9nfusJleZR+GgmMfqSDkM+4IwaK9XjXrHklt05yDrxMlKCDLVe8afbj1giMTRMUK07nhsbP6XKcCZwWugmGmPKxnSIHUtDKlH76fzQKbmwSp8MImUrNGSu/p1IqdR6IgPbKakZ6VVvJv7ndRIzuPVTHsaJwZAtFg0SQUxEZl+TPlfIjJhYQpni9lbCRlRRZmw2S1sCOS3YULzVCNZJ87rsVcp39UqpepXFk4czOIdL8OAGqvAANWgAA4QXeIU359l5dz6cz0VrzslmTmEJztcvBTaTkA== < /latexit >
This paper presents an approach to generate diverse small molecule conformations given its graph by combining a conditional flow-based model with an energy-based model. Sampling is performed in two separate stages: 1) a normalizing flow produces a distribution over interatomic distances (which is then postprocessed into cartesian coordinates), 2) sampled coordinates are refined by Langevin dynamics with gradient signal produced from an energy-based model. The models are trained separately.
SP:11a4f15893b32b9391d04a507bed8528a130f533
MC-LSTM: Mass-conserving LSTM
1 INTRODUCTION . Inductive biases enabled the success of CNNs and LSTMs . One of the greatest success stories of deep learning is Convolutional Neural Networks ( CNNs ) ( Fukushima , 1980 ; LeCun & Bengio , 1998 ; Schmidhuber , 2015 ; LeCun et al. , 2015 ) whose proficiency can be attributed to their strong inductive bias towards visual tasks ( Cohen & Shashua , 2017 ; Gaier & Ha , 2019 ) . The effect of this inductive bias has been demonstrated by CNNs that solve vision-related tasks with random weights , meaning without learning ( He et al. , 2016 ; Gaier & Ha , 2019 ; Ulyanov et al. , 2020 ) . Another success story is Long Short-Term Memory ( LSTM ) ( Hochreiter , 1991 ; Hochreiter & Schmidhuber , 1997 ) , which has a strong inductive bias toward storing information through its memory cells . This inductive bias allows LSTM to excel at speech , text , and language tasks ( Sutskever et al. , 2014 ; Bohnet et al. , 2018 ; Kochkina et al. , 2017 ; Liu & Guo , 2019 ) , as well as timeseries prediction . Even with random weights and only a learned linear output layer LSTM is better at predicting timeseries than reservoir methods ( Schmidhuber et al. , 2007 ) . In a seminal paper on biases in machine learning , Mitchell ( 1980 ) stated that “ biases and initial knowledge are at the heart of the ability to generalize beyond observed data ” . Therefore , choosing an appropriate architecture and inductive bias for deep neural networks is key to generalization . Mechanisms beyond storing are required for real-world applications . While LSTM can store information over time , real-world applications require mechanisms that go beyond storing . Many real-world systems are governed by conservation laws related to mass , energy , momentum , charge , or particle counts , which are often expressed through continuity equations . In physical systems , different types of energies , mass or particles have to be conserved ( Evans & Hanney , 2005 ; Rabitz et al. , 1999 ; van der Schaft et al. , 1996 ) , in hydrology it is the amount of water ( Freeze & Harlan , 1969 ; Beven , 2011 ) , in traffic and transportation the number of vehicles ( Vanajakshi & Rilett , 2004 ; Xiao & Duan , 2020 ; Zhao et al. , 2017 ) , and in logistics the amount of goods , money or products . A real-world task could be to predict outgoing goods from a warehouse based on a general state of the warehouse , i.e. , how many goods are in storage , and incoming supplies . If the predictions are not precise , then they do not lead to an optimal control of the production process . For modeling such systems , certain inputs must be conserved but also redistributed across storage locations within the system . We will All code to reproduce the results will be made available on GitHub . refer to conserved inputs as mass , but note that this can be any type of conserved quantity . We argue that for modeling such systems , specialized mechanisms should be used to represent locations & whereabouts , objects , or storage & placing locations and thus enable conservation . Conservation laws should pervade machine learning models in the physical world . Since a large part of machine learning models are developed to be deployed in the real world , in which conservation laws are omnipresent rather than the exception , these models should adhere to them automatically and benefit from them . However , standard deep learning approaches struggle at conserving quantities across layers or timesteps ( Beucler et al. , 2019b ; Greydanus et al. , 2019 ; Song & Hopke , 1996 ; Yitian & Gu , 2003 ) , and often solve a task by exploiting spurious correlations ( Szegedy et al. , 2014 ; Lapuschkin et al. , 2019 ) . Thus , an inductive bias of deep learning approaches via mass conservation over time in an open system , where mass can be added and removed , could lead to a higher generalization performance than standard deep learning for the above-mentioned tasks . A mass-conserving LSTM . In this work , we introduce Mass-Conserving LSTM ( MC-LSTM ) , a variant of LSTM that enforces mass conservation by design . MC-LSTM is a recurrent neural network with an architecture inspired by the gating mechanism in LSTMs . MC-LSTM has a strong inductive bias to guarantee the conservation of mass . This conservation is implemented by means of left-stochastic matrices , which ensure the sum of the memory cells in the network represents the current mass in the system . These left-stochastic matrices also enforce the mass to be conserved through time . The MC-LSTM gates operate as control units on mass flux . Inputs are divided into a subset of mass inputs , which are propagated through time and are conserved , and a subset of auxiliary inputs , which serve as inputs to the gates for controlling mass fluxes . We demonstrate that MC-LSTMs excel at tasks where conservation of mass is required and that it is highly apt at solving real-world problems in the physical domain . Contributions . We propose a novel neural network architecture based on LSTM that conserves quantities , such as mass , energy , or count , of a specified set of inputs . We show properties of this novel architecture , called MC-LSTM , and demonstrate that these properties render it a powerful neural arithmetic unit . Further , we show its applicability in real-world areas of traffic forecasting and modeling the pendulum . In hydrology , large-scale benchmark experiments reveal that MC-LSTM has powerful predictive quality and can supply interpretable representations . 2 MASS-CONSERVING LSTM . The original LSTM introduced memory cells to Recurrent Neural Networks ( RNNs ) , which alleviate the vanishing gradient problem ( Hochreiter , 1991 ) . This is achieved by means of a fixed recurrent self-connection of the memory cells . If we denote the values in the memory cells at time t by ct , this recurrence can be formulated as ct = ct−1 + f ( xt , ht−1 ) , ( 1 ) where x and h are , respectively , the forward inputs and recurrent inputs , and f is some function that computes the increment for the memory cells . Here , we used the original formulation of LSTM without forget gate ( Hochreiter & Schmidhuber , 1997 ) , but in all experiments we also consider LSTM with forget gate ( Gers et al. , 2000 ) . MC-LSTMs modify this recurrence to guarantee the conservation of the mass input.The key idea is to use the memory cells from LSTMs as mass accumulators , or mass storage . The conservation law is implemented by three architectural changes . First , the increment , computed by f in Eq . ( 1 ) , has to distribute mass from inputs into accumulators . Second , the mass that leaves MC-LSTM must also disappear from the accumulators . Third , mass has to be redistributed between mass accumulators . These changes mean that all gates explicitly represent mass fluxes . Since , in general , not all inputs must be conserved , we distinguish between mass inputs , x , and auxiliary inputs , a . The former represents the quantity to be conserved and will fill the mass accumulators in MC-LSTM . The auxiliary inputs are used to control the gates . To keep the notation uncluttered , and without loss of generality , we use a single mass input at each timestep , xt , to introduce the architecture . The forward pass of MC-LSTM at timestep t can be specified as follows : mttot = R t · ct−1 + it · xt ( 2 ) ct = ( 1− ot ) mttot ( 3 ) ht = ot mttot . ( 4 ) where it and ot are the input- and output gates , respectively , andR is a positive left-stochastic matrix , i.e. , 1T ·R = 1 , for redistributing mass in the accumulators . The total mass mtot is the redistributed mass , Rt · ct−1 , plus the mass influx , or new mass , it · xt . The current mass in the system is stored in ct . Note the differences between Eq . ( 1 ) and Eq . ( 3 ) . First , the increment of the memory cells no longer depends on ht . Instead , mass inputs are distributed by means of the normalized i ( see Eq . 5 ) . Furthermore , Rt replaces the implicit identity matrix of LSTM to redistribute mass among memory cells . Finally , Eq . ( 3 ) introduces 1 − ot as a forget gate on the total mass , mtot . Together with Eq . ( 4 ) , this assures that no outgoing mass is stored in the accumulators . This formulation has some similarity to Gated Recurrent Units ( GRU ) ( Cho et al. , 2014 ) , however the gates are not used for mixing the old and new cell state , but for splitting off the output . Basic gating and redistribution . The MC-LSTM gates at timestep t are computed as follows : it = softmax ( W i · at +U i · ct−1 ‖ct−1‖1 + bi ) ( 5 ) ot = σ ( W o · at +Uo · ct−1 ‖ct−1‖1 + bo ) ( 6 ) Rt = softmax ( Br ) , ( 7 ) where the softmax operator is applied column-wise , σ is the logistic sigmoid function , andW i , bi , W o , bo , and Br are learnable model parameters . Note that for the input gate and redistribution matrix , the requirement is that they are column normalized . This can also be achieved by other means than using the softmax function . For example , an alternative way to ensure a column-normalized matrixRt is to use a normalized logistic , σ̃ ( rkj ) = σ ( rkj ) ∑ n σ ( rkn ) . Also note that MC-LSTMs compute the gates from the memory cells , directly . This is in contrast with the original LSTM , which uses the activations from the previous time step . The accumulated values from the memory cells , ct , are normalized to counter saturation of the sigmoids and to supply probability vectors that represent the current distribution of the mass across cell states We use this variation e.g . in our experiments with neural arithmetics ( see Sec . 5.1 ) . Time-dependent redistribution . It can also be useful to predict a redistribution matrix for each sample and timestep , similar to how the gates are computed : Rt = softmax ( Wr · at + Ur · ct−1 ‖ct−1‖1 +Br ) , ( 8 ) where the parameters Wr and Ur are weight tensors and their multiplications result inK×K matrices . Again , the softmax function is applied column-wise . This version collapses to a time-independent redistribution matrix if Wr and Ur are equal to 0 . Thus , there exists the option to initialize Wr and Ur with weights that are small in absolute value compared to the weights ofBr , to favour learning time-independent redistribution matrices . We use this variant in the hydrology experiments ( see Sec . 5.4 ) . Redistribution via a hypernetwork . Even more general , a hypernetwork ( Schmidhuber , 1992 ; Ha et al. , 2017 ) that we denote with g can be used to procure R. The hypernetwork has to produce a column-normalized , square matrix Rt = g ( a0 , . . . , at , c0 , . . . , ct−1 ) . Notably , a hypernetwork can be used to design an autoregressive version of MC-LSTMs , if the network additionally predicts auxiliary inputs for the next time step . We use this variant in the pendulum experiments ( see Sec . 5.3 ) .
In this paper the authors propose a novel architecture, called Mass-Conserving LSTM (MC-LSTM) based on LSTM. The authors base their work over the hypothesis that the real world is based over conservation laws related to mass, energy, etc. Thus, they propose that also the quantities involved in deep learning models should be conserved. To do so, they aim at exploiting the memory cells of the LSTM as mass accumulators and then force the conservation laws via the model equations. The authors finally show successfully the potential of this novel network into three experimental settings where several types of “conservation” are required (e.g. mass conservation, energy conservation, etc).
SP:fdd497d17b5a12017b4ceb377de57bfc18ebd815
MC-LSTM: Mass-conserving LSTM
1 INTRODUCTION . Inductive biases enabled the success of CNNs and LSTMs . One of the greatest success stories of deep learning is Convolutional Neural Networks ( CNNs ) ( Fukushima , 1980 ; LeCun & Bengio , 1998 ; Schmidhuber , 2015 ; LeCun et al. , 2015 ) whose proficiency can be attributed to their strong inductive bias towards visual tasks ( Cohen & Shashua , 2017 ; Gaier & Ha , 2019 ) . The effect of this inductive bias has been demonstrated by CNNs that solve vision-related tasks with random weights , meaning without learning ( He et al. , 2016 ; Gaier & Ha , 2019 ; Ulyanov et al. , 2020 ) . Another success story is Long Short-Term Memory ( LSTM ) ( Hochreiter , 1991 ; Hochreiter & Schmidhuber , 1997 ) , which has a strong inductive bias toward storing information through its memory cells . This inductive bias allows LSTM to excel at speech , text , and language tasks ( Sutskever et al. , 2014 ; Bohnet et al. , 2018 ; Kochkina et al. , 2017 ; Liu & Guo , 2019 ) , as well as timeseries prediction . Even with random weights and only a learned linear output layer LSTM is better at predicting timeseries than reservoir methods ( Schmidhuber et al. , 2007 ) . In a seminal paper on biases in machine learning , Mitchell ( 1980 ) stated that “ biases and initial knowledge are at the heart of the ability to generalize beyond observed data ” . Therefore , choosing an appropriate architecture and inductive bias for deep neural networks is key to generalization . Mechanisms beyond storing are required for real-world applications . While LSTM can store information over time , real-world applications require mechanisms that go beyond storing . Many real-world systems are governed by conservation laws related to mass , energy , momentum , charge , or particle counts , which are often expressed through continuity equations . In physical systems , different types of energies , mass or particles have to be conserved ( Evans & Hanney , 2005 ; Rabitz et al. , 1999 ; van der Schaft et al. , 1996 ) , in hydrology it is the amount of water ( Freeze & Harlan , 1969 ; Beven , 2011 ) , in traffic and transportation the number of vehicles ( Vanajakshi & Rilett , 2004 ; Xiao & Duan , 2020 ; Zhao et al. , 2017 ) , and in logistics the amount of goods , money or products . A real-world task could be to predict outgoing goods from a warehouse based on a general state of the warehouse , i.e. , how many goods are in storage , and incoming supplies . If the predictions are not precise , then they do not lead to an optimal control of the production process . For modeling such systems , certain inputs must be conserved but also redistributed across storage locations within the system . We will All code to reproduce the results will be made available on GitHub . refer to conserved inputs as mass , but note that this can be any type of conserved quantity . We argue that for modeling such systems , specialized mechanisms should be used to represent locations & whereabouts , objects , or storage & placing locations and thus enable conservation . Conservation laws should pervade machine learning models in the physical world . Since a large part of machine learning models are developed to be deployed in the real world , in which conservation laws are omnipresent rather than the exception , these models should adhere to them automatically and benefit from them . However , standard deep learning approaches struggle at conserving quantities across layers or timesteps ( Beucler et al. , 2019b ; Greydanus et al. , 2019 ; Song & Hopke , 1996 ; Yitian & Gu , 2003 ) , and often solve a task by exploiting spurious correlations ( Szegedy et al. , 2014 ; Lapuschkin et al. , 2019 ) . Thus , an inductive bias of deep learning approaches via mass conservation over time in an open system , where mass can be added and removed , could lead to a higher generalization performance than standard deep learning for the above-mentioned tasks . A mass-conserving LSTM . In this work , we introduce Mass-Conserving LSTM ( MC-LSTM ) , a variant of LSTM that enforces mass conservation by design . MC-LSTM is a recurrent neural network with an architecture inspired by the gating mechanism in LSTMs . MC-LSTM has a strong inductive bias to guarantee the conservation of mass . This conservation is implemented by means of left-stochastic matrices , which ensure the sum of the memory cells in the network represents the current mass in the system . These left-stochastic matrices also enforce the mass to be conserved through time . The MC-LSTM gates operate as control units on mass flux . Inputs are divided into a subset of mass inputs , which are propagated through time and are conserved , and a subset of auxiliary inputs , which serve as inputs to the gates for controlling mass fluxes . We demonstrate that MC-LSTMs excel at tasks where conservation of mass is required and that it is highly apt at solving real-world problems in the physical domain . Contributions . We propose a novel neural network architecture based on LSTM that conserves quantities , such as mass , energy , or count , of a specified set of inputs . We show properties of this novel architecture , called MC-LSTM , and demonstrate that these properties render it a powerful neural arithmetic unit . Further , we show its applicability in real-world areas of traffic forecasting and modeling the pendulum . In hydrology , large-scale benchmark experiments reveal that MC-LSTM has powerful predictive quality and can supply interpretable representations . 2 MASS-CONSERVING LSTM . The original LSTM introduced memory cells to Recurrent Neural Networks ( RNNs ) , which alleviate the vanishing gradient problem ( Hochreiter , 1991 ) . This is achieved by means of a fixed recurrent self-connection of the memory cells . If we denote the values in the memory cells at time t by ct , this recurrence can be formulated as ct = ct−1 + f ( xt , ht−1 ) , ( 1 ) where x and h are , respectively , the forward inputs and recurrent inputs , and f is some function that computes the increment for the memory cells . Here , we used the original formulation of LSTM without forget gate ( Hochreiter & Schmidhuber , 1997 ) , but in all experiments we also consider LSTM with forget gate ( Gers et al. , 2000 ) . MC-LSTMs modify this recurrence to guarantee the conservation of the mass input.The key idea is to use the memory cells from LSTMs as mass accumulators , or mass storage . The conservation law is implemented by three architectural changes . First , the increment , computed by f in Eq . ( 1 ) , has to distribute mass from inputs into accumulators . Second , the mass that leaves MC-LSTM must also disappear from the accumulators . Third , mass has to be redistributed between mass accumulators . These changes mean that all gates explicitly represent mass fluxes . Since , in general , not all inputs must be conserved , we distinguish between mass inputs , x , and auxiliary inputs , a . The former represents the quantity to be conserved and will fill the mass accumulators in MC-LSTM . The auxiliary inputs are used to control the gates . To keep the notation uncluttered , and without loss of generality , we use a single mass input at each timestep , xt , to introduce the architecture . The forward pass of MC-LSTM at timestep t can be specified as follows : mttot = R t · ct−1 + it · xt ( 2 ) ct = ( 1− ot ) mttot ( 3 ) ht = ot mttot . ( 4 ) where it and ot are the input- and output gates , respectively , andR is a positive left-stochastic matrix , i.e. , 1T ·R = 1 , for redistributing mass in the accumulators . The total mass mtot is the redistributed mass , Rt · ct−1 , plus the mass influx , or new mass , it · xt . The current mass in the system is stored in ct . Note the differences between Eq . ( 1 ) and Eq . ( 3 ) . First , the increment of the memory cells no longer depends on ht . Instead , mass inputs are distributed by means of the normalized i ( see Eq . 5 ) . Furthermore , Rt replaces the implicit identity matrix of LSTM to redistribute mass among memory cells . Finally , Eq . ( 3 ) introduces 1 − ot as a forget gate on the total mass , mtot . Together with Eq . ( 4 ) , this assures that no outgoing mass is stored in the accumulators . This formulation has some similarity to Gated Recurrent Units ( GRU ) ( Cho et al. , 2014 ) , however the gates are not used for mixing the old and new cell state , but for splitting off the output . Basic gating and redistribution . The MC-LSTM gates at timestep t are computed as follows : it = softmax ( W i · at +U i · ct−1 ‖ct−1‖1 + bi ) ( 5 ) ot = σ ( W o · at +Uo · ct−1 ‖ct−1‖1 + bo ) ( 6 ) Rt = softmax ( Br ) , ( 7 ) where the softmax operator is applied column-wise , σ is the logistic sigmoid function , andW i , bi , W o , bo , and Br are learnable model parameters . Note that for the input gate and redistribution matrix , the requirement is that they are column normalized . This can also be achieved by other means than using the softmax function . For example , an alternative way to ensure a column-normalized matrixRt is to use a normalized logistic , σ̃ ( rkj ) = σ ( rkj ) ∑ n σ ( rkn ) . Also note that MC-LSTMs compute the gates from the memory cells , directly . This is in contrast with the original LSTM , which uses the activations from the previous time step . The accumulated values from the memory cells , ct , are normalized to counter saturation of the sigmoids and to supply probability vectors that represent the current distribution of the mass across cell states We use this variation e.g . in our experiments with neural arithmetics ( see Sec . 5.1 ) . Time-dependent redistribution . It can also be useful to predict a redistribution matrix for each sample and timestep , similar to how the gates are computed : Rt = softmax ( Wr · at + Ur · ct−1 ‖ct−1‖1 +Br ) , ( 8 ) where the parameters Wr and Ur are weight tensors and their multiplications result inK×K matrices . Again , the softmax function is applied column-wise . This version collapses to a time-independent redistribution matrix if Wr and Ur are equal to 0 . Thus , there exists the option to initialize Wr and Ur with weights that are small in absolute value compared to the weights ofBr , to favour learning time-independent redistribution matrices . We use this variant in the hydrology experiments ( see Sec . 5.4 ) . Redistribution via a hypernetwork . Even more general , a hypernetwork ( Schmidhuber , 1992 ; Ha et al. , 2017 ) that we denote with g can be used to procure R. The hypernetwork has to produce a column-normalized , square matrix Rt = g ( a0 , . . . , at , c0 , . . . , ct−1 ) . Notably , a hypernetwork can be used to design an autoregressive version of MC-LSTMs , if the network additionally predicts auxiliary inputs for the next time step . We use this variant in the pendulum experiments ( see Sec . 5.3 ) .
The paper provides an interesting and novel LSTM structure named MC-LSTM, which extends the inductive bias of LSTM to deal with some real-world problems limited by conservation laws. The authors do some experiments related to traffic forecasting and hydrology to illustrate the effectiveness of MC-LSTM. The new architecture is well-suited for predicting some physical systems, which is valuable.
SP:fdd497d17b5a12017b4ceb377de57bfc18ebd815
Apollo: An Adaptive Parameter-wised Diagonal Quasi-Newton Method for Nonconvex Stochastic Optimization
1 INTRODUCTION . Nonconvex stochastic optimization is of core practical importance in many fields of machine learning , in particular for training deep neural networks ( DNNs ) . First-order gradient-based optimization algorithms , conceptually attractive due to their linear efficiency on both the time and memory complexity , have led to tremendous progress and impressive successes . A number of advanced first-order algorithms have emerged over the years to pursue fast and stable convergence , among which stochastic gradient descent ( SGD ) ( Robbins & Monro , 1951 ; LeCun et al. , 1998 ) , equipped with momentum ( Rumelhart et al. , 1985 ; Qian , 1999 ; Bottou & Bousquet , 2008 ) , has stood out for its simplicity and effectiveness across a wide range of applications ( Hinton & Salakhutdinov , 2006 ; Hinton et al. , 2012 ; Graves , 2013 ) . However , one disadvantage of SGD is that the gradients in different directions are scaled uniformly , resulting in limited convergence speed and sensitive choice of learning rate , and thus has spawned a lot of recent interests in accelerating SGD from the algorithmic and practical perspectives . Recently , many adaptive first-order optimization methods have been proposed to achieve rapid training progress with element-wise scaled learning rates , and we can only mention a few here due to space limits . In their pioneering work , Duchi et al . ( 2011 ) proposed AdaGrad , which scales the gradient by the square root of the accumulative square gradients from the first iteration . While AdaGrad works well for sparse settings , its performance significantly degrades for dense settings , primarily due to the monotonic increase of the accumulation . Subsequently , several methods have been proposed with the intuition to limit the accumulation to a small window of past iterations , and in particular exponentially reduce the weight of earlier iterations . Notable works incorporating this method are RMSProp ( Tieleman & Hinton , 2012 ) , AdaDelta ( Zeiler , 2012 ) , and Adam ( Kingma & Ba , 2015 ) , among which Adam has become the default optimization algorithm across many deep learning applications because of its fast convergence speed and relatively consistent selections of hyper-parameters ( Ruder , 2016 ; Zhang et al. , 2020 ) . However , it has been observed that these adaptive optimization methods may converge to bad/suspicious local optima , resulting in worse generalization ability than their non-adaptive counterparts ( Wilson et al. , 2017 ) , or fail to converge due to unstable and extreme learning rates ( Luo et al. , 2019 ) . Quasi-Newton methods have been widely used in solving convex optimization problems , due to their efficient computation and fast convergence rate ( Broyden , 1967 ; Dennis & Moré , 1977 ) . However , the stochastic , high-dimensional and nonconvex nature of many machine learning tasks , such as training deep neural networks , has rendered many classical quasi-Newton methods ineffective and/or inefficient ( Keskar & Berahas , 2016 ; Wang et al. , 2017 ; Yao et al. , 2020 ) . Indeed , in many natural language processing ( NLP ) and computer vision ( CV ) tasks ( He et al. , 2016 ; Ma & Hovy , 2016 ; Luo et al. , 2019 ) , SGD ( with momentum ) is chosen as the optimizer , benefiting from its stable and efficient training and outstanding generalization . In this work , we develop APOLLO , a quasi-Newton method for nonconvex stochastic optimization to simultaneously tackle the aforementioned challenges of stochastic variance , nonconvexity and inefficiency . Algorithmically , APOLLO dynamically incorporates the curvature of the objective function with diagonally approximated Hessian . It only requires first-order gradients and updates the approximation of the Hessian diagonally so that it satisfies a parameter-wise version of the weak secant condition ( Wolfe , 1959 ) . To handle nonconvexity , we replace the Hessian with its rectified absolute value , the computation of which is also efficient under our diagonal approximation , yielding an efficient optimization algorithm with linear complexity for both time and memory ( §3 ) . Experimentally , through three tasks on CV and NLP with popular deep neural networks , including ResNets ( He et al. , 2016 ) , LSTMs ( Hochreiter & Schmidhuber , 1997 ) and Transformers ( Vaswani et al. , 2017 ) , we demonstrate that APOLLO significantly outperforms SGD and variants of Adam , in terms of both convergence speed and generalization performance ( §4 ) . 2 BACKGROUNDS . In this section , we set up the notations on nonconvex stochastic optimization , briefly review the ( quasi- ) Newton methods , and discuss the problems of applying quasi-Newton methods to nonconvex stochastic optimization that we attempt to study in the rest of the paper . 2.1 NONCONVEX STOCHASTIC OPTIMIZATION . In this paper , we consider the following nonconvex stochastic optimization problem : min θ∈Rd f ( θ ) = E [ l ( θ ; Γ ) ] ( 1 ) where l : Rd ×Rn → R is a continuously differentiable ( and possible nonconvex ) function , θ ∈ Rd denotes the parameter to be optimized , Γ ∈ Rn denotes a random variable with distribution function P , and E [ · ] denotes the expectation w.r.t Γ . Intuitively , Γ incorporates noises in f , leading to a stochastic objective function . A special case of ( 1 ) that arises frequently in machine learning is the empirical risk minimization problem : min θ∈Rd f ( θ ) = 1 N N∑ i=1 li ( θ ) ( 2 ) where li : Rd → R is the loss function corresponding to the i-th data , and N is the number of data samples that is assumed to be extremely large . Objective functions may also have other sources of noise than data subsampling , such as dropout ( Srivastava et al. , 2014 ) in deep neural networks . Decoupled Parameters . In this work , we consider a setting of decoupled parameters : θ = { θ ( l ) , l = 1 , . . . , L } . Intuitively , under this setting the parameter θ is decoupled into a sequence of parameters serving different functionalities . For example , in neural network training the parameters of a neural network can be naturally decoupled into the parameters of different layers or modules . 2.2 NEWTON AND QUASI-NEWTON METHODS . Newton ’ s method usually employs the following updates to solve ( 1 ) : θt+1 = θt −H−1t gt ( 3 ) where gt = ∇f ( θt ) is the gradient at θt and Ht = ∇2f ( θt ) is the Hessian matrix . The convergence rate of Newton ’ s method is quadratic under standard assumptions ( Nocedal & Wright , 2006 ) . However , major challenges with this method are i ) the expensive computation of the inverse Hessian at every iteration and the corresponding quadratic memory complexity ; and ii ) the limitation to convex functions ( nonconvexity results in negative curvature of Ht and misleads the update directions ) . A standard alternative to Newton ’ s method is a class of quasi-Newton methods , which have been widely used in solving convex deterministic optimization problem : θt+1 = θt − ηtB−1t gt ( 4 ) where ηt is the stepsize ( a.k.a learning rate ) , Bt is an approximation to the Hessian matrix ∇2f ( θt ) at θt , which is updated based on the well-known secant equation : Bt+1 = argmin B ‖B −Bt‖ s.t . Bt+1st = yt ( secant equation ) ( 5 ) where st = θt+1−θt and yt = gt+1−gt . Bt+1 is , in the sense of some matrix norm , the closest toBt among all symmetric matrices that satisfy the secant equation . Each choice of the matrix norm results in a different update formula , such as DFP ( Davidon , 1991 ; Fletcher , 1987 ) and BFGS ( Broyden , 1970 ; Fletcher , 1970 ; Goldfarb , 1970 ; Shanno , 1970 ) . The popularity of this method is due to the fact that only the gradient of the objective function is required at each iteration . Since no second derivatives ( Hessian ) are required , quasi-Newton methods are sometimes more efficient than Newton ’ s method , especially when the computation of Hessian is expensive . To further reduce memory cost , one seminal work is the limited memory BFGS ( L-BFGS ) ( Liu & Nocedal , 1989 ; Byrd et al. , 1995 ) that achieves desirable linear computational and memory complexity by approximating the Hessian as a series of sum of first order information from previous iterations . 2.3 PROBLEMS OF QUASI-NEWTON METHODS . Despite their impressive successes on convex deterministic optimization , quasi-Newton methods suffer from their own problems in more challenging scenarios . In this section , we mainly discuss three problems preventing quasi-Newton methods from being applied to the scenario of largescale nonconvex stochastic optimization . Due to these problems , no quasi-Newton methods ( to our best knowledge ) designed for nonconvex optimization consistently outperform adaptive firstorder algorithms w.r.t convergence speed and generalization performance . The main goal of this work is to algorithmically design and experimentally demonstrate a novel quasi-Newton method , in hope of improving the convergence speed and generalization performance of nonconvex stochastic optimization eventually . Stochastic Variance . One challenge of quasi-Newton methods on nonconvex stochastic optimization ( 1 ) is the variance introduced by the stochastic nature of the problem . At each iteration , only the stochastic gradient gt is available , which is an unbiased estimation of the gradient∇f ( θt ) and may lead to an erroneous approximation of Hessian ( Byrd et al. , 2011 ) . Nonconvexity . Another key challenge in designing such quasi-Newton methods lies in the difficulty of preserving the positive-definiteness of Bt in ( 5 ) , due to the nonconvexity of the objective function . What is worse is that performing line search is infeasible in the stochastic setting , due to the presence of noise in the stochastic gradients ( Wang et al. , 2017 ) . Computational and Memory Efficiency . Even though quasi-Newton methods are more efficient than Newton ’ s method , the time and memory complexities are still relatively large compared with adaptive first-order methods . For instance , L-BFGS requires to store first-order information from m previous iterations with commonly m ≥ 5 , which is still too expensive for deep neural networks containing millions of parameters . Moreover , adapting quasi-Newton methods to nonconvex stochastic optimization probably introduces additional computation , further slowing down these methods . 3 ADAPTIVE PARAMETER-WISE DIAGONAL QUASI-NEWTON . With the end goal of designing an efficient quasi-Newton method to solve the problem in ( 1 ) in mind , we first propose to approximate the Hessian with a diagonal matrix , whose elements are determined by the variational approach subject to the parameter-wise weak secant equation ( §3.1 ) . Then , we explain our stepsize bias correction technique to reduce the stochastic variance in §3.2 . To handle nonconvexity , we directly use the rectified absolute value of the diagonally approximated Hessian as the preconditioning of the gradient ( §3.3 ) . The initialization technique of APOLLO allows us to eliminate one hyper-parameter ( §3.4 ) . At last , we provide a theoretical analysis of APOLLO ’ s convergence in both convex optimization and nonconvex stochastic optimization ( §3.5 ) . The pseudo-code is shown in Algorithm 1 . 3.1 QUASI-NEWTON METHODS WITH DIAGONAL HESSIAN APPROXIMATION . As discussed in Bordes et al . ( 2009 ) , designing an efficient stochastic quasi-Newton algorithm involves a careful trade-off between the sparsity of the approximation matrix Bt and the quality of its approximation of the Hessian Ht , and diagonal approximation is a reasonable choice ( Becker et al. , 1988 ; Zhu et al. , 1999 ) . If B is chosen to be a diagonal matrix satisfying ( 5 ) , one can obtain a formula similar to the SGD-QN algorithm ( Bordes et al. , 2009 ) . An alternative of the secant equation in the updating formula ( 5 ) , as first introduced by Nazareth ( 1995 ) , is the weak secant equation ( Dennis & Wolkowicz , 1993 ) : Bt+1 = argmin B ‖B −Bt‖ s.t . sTt Bt+1st = s T t yt ( weak secant equation ) ( 6 ) The motivation of using the weak secant condition in diagonal quasi-Newton method is straightforward : the standard mean-value theorem might not necessarily hold for vector-valued functions expressed in the secant equation , Bt+1st = yt ≈ ∇2f ( θt ) st . Thus , we do not know whether there exists a vector θ̃ ∈ Rd such that yt = ∇2f ( θ̃ ) st ( Dennis & Moré , 1977 ) . On the other hand , the Taylor theorem ensures that there exists such θ̃ that sTt yt = s T t ∇2f ( θ̃ ) st , leading to the reasonable assumption of the weak secant condition ( 6 ) . Based on the variational technique ( Zhu et al. , 1999 ) , the solution of ( 6 ) with Frobenius norm is : Λ , Bt+1 −Bt = sTt yt − sTt Btst ‖st‖44 Diag ( s2t ) ( 7 ) where s2t is the element-wise square vector of st , Diag ( s 2 t ) is the diagonal matrix with diagonal elements from vector s2t , and ‖ · ‖4 is the 4-norm of a vector . Parameter-Wise Weak Secant Condition . However , in optimization problems with highdimensional parameter space , such as training deep neural networks with millions of parameters , the weak secant condition might be too flexible to produce a good Hessian approximation . In the setting of decoupled parameters ( §2.1 ) , we propose a parameter-wise version of the weak secant equation to achieve a trade-off between the secant and weak secant conditions : for each parameter θ ( l ) ∈ θ , we update B corresponding to θ ( l ) by solving ( 6 ) individually . Remarkably , the secant condition restricts B with an equation of a d-dimensional vector , while the weak secant condition relaxes it with a 1-dimensional scalar . The parameter-wise weak secant condition expresses the restriction as a l-dimension vector ( 1 < l < d ) , resulting in a reasonable trade-off . The updating formula is the same as ( 7 ) for each parameter-wise B .
The paper proposes a Quasi-Newton inspired optimization algorithm for Stochastic Optimization named APOLLO. It adjusts a previously known update formula to better suit Deep Learning by using 1) a layer-wise diagonal approximation to the Hessian, 2) an exponential average of gradients to address the noise. Overall the algorithm shows promising results on the assigned experiments.
SP:69cc1499e1ffdff113346180dd31c60fb1059872
Apollo: An Adaptive Parameter-wised Diagonal Quasi-Newton Method for Nonconvex Stochastic Optimization
1 INTRODUCTION . Nonconvex stochastic optimization is of core practical importance in many fields of machine learning , in particular for training deep neural networks ( DNNs ) . First-order gradient-based optimization algorithms , conceptually attractive due to their linear efficiency on both the time and memory complexity , have led to tremendous progress and impressive successes . A number of advanced first-order algorithms have emerged over the years to pursue fast and stable convergence , among which stochastic gradient descent ( SGD ) ( Robbins & Monro , 1951 ; LeCun et al. , 1998 ) , equipped with momentum ( Rumelhart et al. , 1985 ; Qian , 1999 ; Bottou & Bousquet , 2008 ) , has stood out for its simplicity and effectiveness across a wide range of applications ( Hinton & Salakhutdinov , 2006 ; Hinton et al. , 2012 ; Graves , 2013 ) . However , one disadvantage of SGD is that the gradients in different directions are scaled uniformly , resulting in limited convergence speed and sensitive choice of learning rate , and thus has spawned a lot of recent interests in accelerating SGD from the algorithmic and practical perspectives . Recently , many adaptive first-order optimization methods have been proposed to achieve rapid training progress with element-wise scaled learning rates , and we can only mention a few here due to space limits . In their pioneering work , Duchi et al . ( 2011 ) proposed AdaGrad , which scales the gradient by the square root of the accumulative square gradients from the first iteration . While AdaGrad works well for sparse settings , its performance significantly degrades for dense settings , primarily due to the monotonic increase of the accumulation . Subsequently , several methods have been proposed with the intuition to limit the accumulation to a small window of past iterations , and in particular exponentially reduce the weight of earlier iterations . Notable works incorporating this method are RMSProp ( Tieleman & Hinton , 2012 ) , AdaDelta ( Zeiler , 2012 ) , and Adam ( Kingma & Ba , 2015 ) , among which Adam has become the default optimization algorithm across many deep learning applications because of its fast convergence speed and relatively consistent selections of hyper-parameters ( Ruder , 2016 ; Zhang et al. , 2020 ) . However , it has been observed that these adaptive optimization methods may converge to bad/suspicious local optima , resulting in worse generalization ability than their non-adaptive counterparts ( Wilson et al. , 2017 ) , or fail to converge due to unstable and extreme learning rates ( Luo et al. , 2019 ) . Quasi-Newton methods have been widely used in solving convex optimization problems , due to their efficient computation and fast convergence rate ( Broyden , 1967 ; Dennis & Moré , 1977 ) . However , the stochastic , high-dimensional and nonconvex nature of many machine learning tasks , such as training deep neural networks , has rendered many classical quasi-Newton methods ineffective and/or inefficient ( Keskar & Berahas , 2016 ; Wang et al. , 2017 ; Yao et al. , 2020 ) . Indeed , in many natural language processing ( NLP ) and computer vision ( CV ) tasks ( He et al. , 2016 ; Ma & Hovy , 2016 ; Luo et al. , 2019 ) , SGD ( with momentum ) is chosen as the optimizer , benefiting from its stable and efficient training and outstanding generalization . In this work , we develop APOLLO , a quasi-Newton method for nonconvex stochastic optimization to simultaneously tackle the aforementioned challenges of stochastic variance , nonconvexity and inefficiency . Algorithmically , APOLLO dynamically incorporates the curvature of the objective function with diagonally approximated Hessian . It only requires first-order gradients and updates the approximation of the Hessian diagonally so that it satisfies a parameter-wise version of the weak secant condition ( Wolfe , 1959 ) . To handle nonconvexity , we replace the Hessian with its rectified absolute value , the computation of which is also efficient under our diagonal approximation , yielding an efficient optimization algorithm with linear complexity for both time and memory ( §3 ) . Experimentally , through three tasks on CV and NLP with popular deep neural networks , including ResNets ( He et al. , 2016 ) , LSTMs ( Hochreiter & Schmidhuber , 1997 ) and Transformers ( Vaswani et al. , 2017 ) , we demonstrate that APOLLO significantly outperforms SGD and variants of Adam , in terms of both convergence speed and generalization performance ( §4 ) . 2 BACKGROUNDS . In this section , we set up the notations on nonconvex stochastic optimization , briefly review the ( quasi- ) Newton methods , and discuss the problems of applying quasi-Newton methods to nonconvex stochastic optimization that we attempt to study in the rest of the paper . 2.1 NONCONVEX STOCHASTIC OPTIMIZATION . In this paper , we consider the following nonconvex stochastic optimization problem : min θ∈Rd f ( θ ) = E [ l ( θ ; Γ ) ] ( 1 ) where l : Rd ×Rn → R is a continuously differentiable ( and possible nonconvex ) function , θ ∈ Rd denotes the parameter to be optimized , Γ ∈ Rn denotes a random variable with distribution function P , and E [ · ] denotes the expectation w.r.t Γ . Intuitively , Γ incorporates noises in f , leading to a stochastic objective function . A special case of ( 1 ) that arises frequently in machine learning is the empirical risk minimization problem : min θ∈Rd f ( θ ) = 1 N N∑ i=1 li ( θ ) ( 2 ) where li : Rd → R is the loss function corresponding to the i-th data , and N is the number of data samples that is assumed to be extremely large . Objective functions may also have other sources of noise than data subsampling , such as dropout ( Srivastava et al. , 2014 ) in deep neural networks . Decoupled Parameters . In this work , we consider a setting of decoupled parameters : θ = { θ ( l ) , l = 1 , . . . , L } . Intuitively , under this setting the parameter θ is decoupled into a sequence of parameters serving different functionalities . For example , in neural network training the parameters of a neural network can be naturally decoupled into the parameters of different layers or modules . 2.2 NEWTON AND QUASI-NEWTON METHODS . Newton ’ s method usually employs the following updates to solve ( 1 ) : θt+1 = θt −H−1t gt ( 3 ) where gt = ∇f ( θt ) is the gradient at θt and Ht = ∇2f ( θt ) is the Hessian matrix . The convergence rate of Newton ’ s method is quadratic under standard assumptions ( Nocedal & Wright , 2006 ) . However , major challenges with this method are i ) the expensive computation of the inverse Hessian at every iteration and the corresponding quadratic memory complexity ; and ii ) the limitation to convex functions ( nonconvexity results in negative curvature of Ht and misleads the update directions ) . A standard alternative to Newton ’ s method is a class of quasi-Newton methods , which have been widely used in solving convex deterministic optimization problem : θt+1 = θt − ηtB−1t gt ( 4 ) where ηt is the stepsize ( a.k.a learning rate ) , Bt is an approximation to the Hessian matrix ∇2f ( θt ) at θt , which is updated based on the well-known secant equation : Bt+1 = argmin B ‖B −Bt‖ s.t . Bt+1st = yt ( secant equation ) ( 5 ) where st = θt+1−θt and yt = gt+1−gt . Bt+1 is , in the sense of some matrix norm , the closest toBt among all symmetric matrices that satisfy the secant equation . Each choice of the matrix norm results in a different update formula , such as DFP ( Davidon , 1991 ; Fletcher , 1987 ) and BFGS ( Broyden , 1970 ; Fletcher , 1970 ; Goldfarb , 1970 ; Shanno , 1970 ) . The popularity of this method is due to the fact that only the gradient of the objective function is required at each iteration . Since no second derivatives ( Hessian ) are required , quasi-Newton methods are sometimes more efficient than Newton ’ s method , especially when the computation of Hessian is expensive . To further reduce memory cost , one seminal work is the limited memory BFGS ( L-BFGS ) ( Liu & Nocedal , 1989 ; Byrd et al. , 1995 ) that achieves desirable linear computational and memory complexity by approximating the Hessian as a series of sum of first order information from previous iterations . 2.3 PROBLEMS OF QUASI-NEWTON METHODS . Despite their impressive successes on convex deterministic optimization , quasi-Newton methods suffer from their own problems in more challenging scenarios . In this section , we mainly discuss three problems preventing quasi-Newton methods from being applied to the scenario of largescale nonconvex stochastic optimization . Due to these problems , no quasi-Newton methods ( to our best knowledge ) designed for nonconvex optimization consistently outperform adaptive firstorder algorithms w.r.t convergence speed and generalization performance . The main goal of this work is to algorithmically design and experimentally demonstrate a novel quasi-Newton method , in hope of improving the convergence speed and generalization performance of nonconvex stochastic optimization eventually . Stochastic Variance . One challenge of quasi-Newton methods on nonconvex stochastic optimization ( 1 ) is the variance introduced by the stochastic nature of the problem . At each iteration , only the stochastic gradient gt is available , which is an unbiased estimation of the gradient∇f ( θt ) and may lead to an erroneous approximation of Hessian ( Byrd et al. , 2011 ) . Nonconvexity . Another key challenge in designing such quasi-Newton methods lies in the difficulty of preserving the positive-definiteness of Bt in ( 5 ) , due to the nonconvexity of the objective function . What is worse is that performing line search is infeasible in the stochastic setting , due to the presence of noise in the stochastic gradients ( Wang et al. , 2017 ) . Computational and Memory Efficiency . Even though quasi-Newton methods are more efficient than Newton ’ s method , the time and memory complexities are still relatively large compared with adaptive first-order methods . For instance , L-BFGS requires to store first-order information from m previous iterations with commonly m ≥ 5 , which is still too expensive for deep neural networks containing millions of parameters . Moreover , adapting quasi-Newton methods to nonconvex stochastic optimization probably introduces additional computation , further slowing down these methods . 3 ADAPTIVE PARAMETER-WISE DIAGONAL QUASI-NEWTON . With the end goal of designing an efficient quasi-Newton method to solve the problem in ( 1 ) in mind , we first propose to approximate the Hessian with a diagonal matrix , whose elements are determined by the variational approach subject to the parameter-wise weak secant equation ( §3.1 ) . Then , we explain our stepsize bias correction technique to reduce the stochastic variance in §3.2 . To handle nonconvexity , we directly use the rectified absolute value of the diagonally approximated Hessian as the preconditioning of the gradient ( §3.3 ) . The initialization technique of APOLLO allows us to eliminate one hyper-parameter ( §3.4 ) . At last , we provide a theoretical analysis of APOLLO ’ s convergence in both convex optimization and nonconvex stochastic optimization ( §3.5 ) . The pseudo-code is shown in Algorithm 1 . 3.1 QUASI-NEWTON METHODS WITH DIAGONAL HESSIAN APPROXIMATION . As discussed in Bordes et al . ( 2009 ) , designing an efficient stochastic quasi-Newton algorithm involves a careful trade-off between the sparsity of the approximation matrix Bt and the quality of its approximation of the Hessian Ht , and diagonal approximation is a reasonable choice ( Becker et al. , 1988 ; Zhu et al. , 1999 ) . If B is chosen to be a diagonal matrix satisfying ( 5 ) , one can obtain a formula similar to the SGD-QN algorithm ( Bordes et al. , 2009 ) . An alternative of the secant equation in the updating formula ( 5 ) , as first introduced by Nazareth ( 1995 ) , is the weak secant equation ( Dennis & Wolkowicz , 1993 ) : Bt+1 = argmin B ‖B −Bt‖ s.t . sTt Bt+1st = s T t yt ( weak secant equation ) ( 6 ) The motivation of using the weak secant condition in diagonal quasi-Newton method is straightforward : the standard mean-value theorem might not necessarily hold for vector-valued functions expressed in the secant equation , Bt+1st = yt ≈ ∇2f ( θt ) st . Thus , we do not know whether there exists a vector θ̃ ∈ Rd such that yt = ∇2f ( θ̃ ) st ( Dennis & Moré , 1977 ) . On the other hand , the Taylor theorem ensures that there exists such θ̃ that sTt yt = s T t ∇2f ( θ̃ ) st , leading to the reasonable assumption of the weak secant condition ( 6 ) . Based on the variational technique ( Zhu et al. , 1999 ) , the solution of ( 6 ) with Frobenius norm is : Λ , Bt+1 −Bt = sTt yt − sTt Btst ‖st‖44 Diag ( s2t ) ( 7 ) where s2t is the element-wise square vector of st , Diag ( s 2 t ) is the diagonal matrix with diagonal elements from vector s2t , and ‖ · ‖4 is the 4-norm of a vector . Parameter-Wise Weak Secant Condition . However , in optimization problems with highdimensional parameter space , such as training deep neural networks with millions of parameters , the weak secant condition might be too flexible to produce a good Hessian approximation . In the setting of decoupled parameters ( §2.1 ) , we propose a parameter-wise version of the weak secant equation to achieve a trade-off between the secant and weak secant conditions : for each parameter θ ( l ) ∈ θ , we update B corresponding to θ ( l ) by solving ( 6 ) individually . Remarkably , the secant condition restricts B with an equation of a d-dimensional vector , while the weak secant condition relaxes it with a 1-dimensional scalar . The parameter-wise weak secant condition expresses the restriction as a l-dimension vector ( 1 < l < d ) , resulting in a reasonable trade-off . The updating formula is the same as ( 7 ) for each parameter-wise B .
This paper presents the optimization method Apollo, a quasi-Newton method that relies on a parameter-wise version of the weak secant condition to allow for a diagonal approximation of the Hessian. Additionally, the issue of a potentially non-PSD approximation is addressed by replacing the approximation with a rectified absolute value. While the combination of techniques is interesting, my main hesitation comes from the limited discussion concerning other quasi-Newton methods for the same problem setting.
SP:69cc1499e1ffdff113346180dd31c60fb1059872
Benchmarking Unsupervised Object Representations for Video Sequences
1 INTRODUCTION . Humans understand the world in terms of objects . Being able to decompose our environment into independent objects that can interact with each other is an important prerequisite for reasoning and scene understanding . Similarly , an artificial intelligence system would benefit from the ability to both extract objects and their interactions from video streams , and keep track of them over time . Recently , there has been an increased interest in unsupervised learning of object-centric representations . The key insight of these methods is that the compositionality of visual scenes can be used to both discover ( Eslami et al. , 2016 ; Greff et al. , 2019 ; Burgess et al. , 2019 ) and track objects in videos ( Greff et al. , 2017 ; van Steenkiste et al. , 2018 ; Veerapaneni et al. , 2019 ) without supervision . However , it is currently not well understood how the learned visual representations of different models compare to each other quantitatively , since the models have been developed with different downstream tasks in mind and have not been evaluated using a common protocol . Hence , in this work , we propose a benchmark based on procedurally generated video sequences to test basic perceptual abilities of object-centric video models under various challenging tracking scenarios . An unsupervised object-based video representation should ( 1 ) effectively identify objects as they enter a scene , ( 2 ) accurately segment objects , as well as ( 3 ) maintain a consistent representation for each individual object in a scene over time . These perceptual abilities can be evaluated quantitatively in the established multi-object tracking framework ( Bernardin & Stiefelhagen , 2008 ; Milan et al. , 2016 ) . We propose to utilize this protocol for analyzing the strengths and weaknesses of different object-centric representation learning methods , independent of any specific downstream task , in order to uncover the different inductive biases hidden in their choice of architecture and loss formulation . We therefore compiled a benchmark consisting of three procedurally generated video datasets of varying levels of visual complexity and two generalization tests . Using this benchmark , we quantitatively compared three classes of object-centric models , leading to the following insights : • All of the models have shortcomings handling occlusion , albeit to different extents . • OP3 ( Veerapaneni et al. , 2019 ) performs strongest in terms of quantitative metrics , but exhibits a surprisingly strong dependency on color to separate objects and accumulates false positives when fewer objects than slots are present . • Spatial transformer models , TBA ( He et al. , 2019 ) and SCALOR ( Jiang et al. , 2020 ) , train most efficiently and feature explicit depth reasoning in combination with amodal masks , but are nevertheless outperformed by the simpler model , VIMON , lacking a depth or interaction model , suggesting that the proposed mechanisms may not yet work as intended . We will make our code , data , as well as a public leaderboard of results available . 2 RELATED WORK . Several recent lines of work propose to learn object-centric representations from visual inputs for static and dynamic scenes without explicit supervision . Though their results are promising , methods are currently restricted to handling synthetic datasets and as of yet are unable to scale to complex natural scenes . Furthermore , a systematic quantitative comparison of methods is lacking . Selecting and processing parts of an image via spatial attention has been one prominent approach for this task ( Mnih et al. , 2014 ; Eslami et al. , 2016 ; Kosiorek et al. , 2018 ; Burgess et al. , 2019 ; Yuan et al. , 2019 ; Crawford & Pineau , 2019 ; Locatello et al. , 2020 ) . As an alternative , spatial mixture models decompose scenes by performing image-space clustering of pixels that belong to individual objects ( Greff et al. , 2016 ; 2017 ; 2019 ; van Steenkiste et al. , 2018 ) . While some approaches aim at learning a suitable representation for downstream tasks ( Watters et al. , 2019a ; Veerapaneni et al. , 2019 ) , others target scene generation ( Engelcke et al. , 2019 ; von Kügelgen et al. , 2020 ) . We analyze three classes of models for processing videos , covering three models based on spatial attention and one based on spatial mixture modeling . Spatial attention models with unconstrained latent representations use per-object variational autoencoders , as introduced by Burgess et al . ( 2019 ) . von Kügelgen et al . ( 2020 ) adapts this approach for scene generation . So far , such methods have been designed for static images , but not for videos . We therefore extend MONET ( Burgess et al. , 2019 ) to be able to accumulate evidence over time for tracking , enabling us to include this class of approaches in our evaluation . Recent concurrent work on AlignNet ( Creswell et al. , 2020 ) applies MONET frame-by-frame and tracks objects by subsequently ordering the extracted objects consistently . Spatial attention models with factored latents use an explicit factorization of the latent representation into properties such as position , scale and appearance ( Eslami et al. , 2016 ; Crawford & Pineau , 2019 ) . These methods use spatial transformer networks ( Jaderberg et al. , 2015 ) to render per-object reconstructions from the factored latents ( Kosiorek et al. , 2018 ; He et al. , 2019 ; Jiang et al. , 2020 ) . SQAIR ( Kosiorek et al. , 2018 ) does not perform segmentation , identifying objects only at the bounding-box level . We select Tracking-by-Animation ( TBA ) ( He et al. , 2019 ) and SCALOR ( Jiang et al. , 2020 ) for analyzing spatial transformer methods in our experiments , which explicitly disentangle object shape and appearance , providing access to object masks . Spatial mixture models cluster pixels using a deep neural network trained with expectation maximization ( Greff et al. , 2017 ; van Steenkiste et al. , 2018 ) . IODINE ( Greff et al. , 2019 ) extends these methods with an iterative amortised variational inference procedure ( Marino et al. , 2018 ) , improving segmentation quality . SPACE ( Lin et al. , 2020 ) combines mixture models with spatial attention to improve scalability . To work with video sequences , OP3 ( Veerapaneni et al. , 2019 ) extends IODINE by modeling individual objects ’ dynamics as well as pairwise interactions . We therefore include OP3 in our analysis as a representative spatial mixture model . 3 OBJECT-CENTRIC REPRESENTATION BENCHMARK . To compare the different object-centric representation learning models on their basic perceptual abilities , we use the well-established multi-object tracking ( MOT ) protocol ( Bernardin & Stiefelhagen , 2008 ) . In this section , we describe the datasets and metrics considered in our benchmark , followed by a brief description of the models evaluated . 3.1 DATASETS . Current object-centric models are not capable of modeling complex natural scenes ( Burgess et al. , 2019 ; Greff et al. , 2019 ; Lin et al. , 2020 ) . Hence , we focus on synthetic datasets that resemble those which state-of-the-art models were designed for . Specifically , we evaluate on three synthetic datasets1 ( see Table 1 ) , which cover multiple levels of visual and motion complexity . Synthetic stimuli enable us to precisely generate challenging scenarios in a controllable manner in order to disentangle sources of difficulty and glean insights on what models specifically struggle with . We design different scenarios that test complexities that would occur in natural videos such as partial or complete occlusion as well as similar object appearances . Sprites-MOT ( SpMOT , Table 1 left ) , as proposed by He et al . ( 2019 ) , features simple 2D sprites moving linearly on a black background with objects moving in and out of frame during the sequence . Video-Multi-dSprites ( VMDS , Table 1 right ) is a video dataset we generated based on a colored , multi-object version of the dSprites dataset ( Matthey et al. , 2017 ) . Each video contains one to four sprites that move non-linearly and independently of each other with the possibility of partial or full occlusion . Besides the i.i.d . sampled training , validation and test sets of VMDS , we generate seven additional challenge sets that we use to study specific test situations we observed to be challenging , such as guaranteed occlusion , specific object properties , or out-of-distribution appearance variations . Video Objects Room ( VOR , Table 1 middle ) is a video dataset we generated based on the static Objects Room dataset ( Greff et al. , 2019 ) , which features static objects in a 3D room with a moving camera . For full details on the datasets and their generation , see Appendix B . 3.2 METRICS . Our evaluation protocol follows the multi-object tracking ( MOT ) challenge , a standard and widelyused benchmark for supervised object tracking ( Milan et al. , 2016 ) . The MOT challenge uses the CLEAR MOT metrics ( Bernardin & Stiefelhagen , 2008 ) , which quantitatively evaluate different performance aspects of object detection , tracking and segmentation . To compute these metrics , predictions have to be matched to ground truth . Unlike Bernardin & Stiefelhagen ( 2008 ) and Milan et al . ( 2016 ) , we use binary segmentation masks for this matching instead of bounding boxes , which helps us better understand the models ’ segmentation capabilities . We consider an intersection over union ( IoU ) greater than 0.5 as a match ( Voigtlaender et al. , 2019 ) . The error metrics used are the fraction of Misses ( Miss ) , ID switches ( ID S. ) and False Positives ( FPs ) relative to the number of ground truth masks . In addition , we report the Mean Squared Error ( MSE ) of the reconstructed image outputs summed over image channels and pixels . To quantify the overall number of failures , we use the MOT Accuracy ( MOTA ) , which measures the fraction of all failure cases compared to the total number of objects present in all frames . A model with 100 % MOTA perfectly tracks all objects without any misses , ID switches or false positives . To quantify the segmentation quality , we define MOT Precision ( MOTP ) as the average IoU of segmentation masks of all matches . A model with 100 % MOTP perfectly segments all tracked objects , but does not necessarily track all objects . Further , to quantify detection and tracking performance 1Datasets are available at this https URL . independent of false positives , we measure the Mostly Detected ( MD ) and Mostly Tracked ( MT ) metrics , the fraction of ground truth objects that have been detected and tracked for at least 80 % of their lifespan , respectively . If an ID switch occurs , an object is considered detected but not tracked . For full details regarding the matching process and the evaluation metrics , refer to Appendix A . 3.3 MODELS . We consider three classes of unsupervised object-centric representation learning models : ( 1 ) a spatial attention model with unconstrained latents , VIMON , which is our video extension of MONET ( Burgess et al. , 2019 ) ; ( 2 ) spatial transformer-based attention models , TBA ( He et al. , 2019 ) and SCALOR ( Jiang et al. , 2020 ) ; ( 3 ) a scene mixture model , OP3 ( Veerapaneni et al. , 2019 ) . At a high-level , these methods share a common structure which is illustrated in Fig . 1a . They decompose an image into a fixed number of slots ( Burgess et al. , 2019 ) , each of which contains an embedding zt , k and a mask mt , k of ( ideally ) a single object . These slots are then combined in a decoding step to reconstruct the image . Below , we briefly describe each method . Appendix C provides a detailed explanation in a unified mathematical framework . Video MONet ( VIMON ) is our video extension of MONET ( Burgess et al. , 2019 ) . MONET recurrently decomposes a static scene into slots , using an attention network to sequentially extract attention masks mk ∈ [ 0 , 1 ] H×W of individual objects k. A Variational Autoencoder ( VAE ) ( Kingma & Welling , 2014 ) encodes each slot into a latent representation zk ∈ RL of the corresponding object . We use MONET as a simple frame-by-frame baseline for detection and segmentation that does not employ temporal information . VIMON accumulates evidence about the objects over time to maintain a consistent object-slot assignment throughout the video . This is achieved by ( 1 ) seeding the attention network the predicted mask m̂t , k ∈ [ 0 , 1 ] H×W from the previous time step and ( 2 ) introducing a gated recurrent unit ( GRU ) ( Cho et al. , 2014 ) , which aggregates information over time for each slot separately , enabling it to encode motion information . For full details on MONET and VIMON , as well as ablations to provide context for the design decisions , refer to Appendix C.1 , C.2 and E.3 . Tracking-by-Animation ( TBA ) ( He et al. , 2019 ) is a spatial transformer-based attention model . Frames are encoded by a convolutional feature extractor f before being passed to a recurrent block g called Reprioritized Attentive Tracking ( RAT ) . RAT re-weights slot input features based on their cosine similarity with the slots from the previous time step and outputs latent representations for all K slots in parallel . Each slot latent is further decoded into a mid-level representation yt , k consisting of pose and depth parameters , as well as object appearance and shape templates ( see Fig . 1c ) . For rendering , a Spatial Transformer Network ( STN ) ( Jaderberg et al. , 2015 ) is used with an additional occlusion check based on the depth estimate . TBA is trained on frame reconstruction with an additional penalty for large object sizes to encourage compact bounding boxes . TBA can only process scenes with static backgrounds , as it preprocesses sequences using background subtraction ( Bloisi & Iocchi , 2012 ) . For full details on TBA , refer to Appendix C.3 . Object-centric Perception , Prediction , and Planning ( OP3 ) ( Veerapaneni et al. , 2019 ) extends IODINE ( Greff et al. , 2019 ) to operate on videos . IODINE decomposes an image into objects and represents them independently by starting from an initial guess of the segmentation of the entire frame , and subsequently iteratively refines it using the refinement network f ( Marino et al. , 2018 ) . In each refinement step m , the image is represented by K slots with latent representations zm , k . OP3 applies IODINE to each frame xt to extract latent representations zt , m , k , which are subsequently processed by a dynamics network d ( see Fig . 1e ) , which models both the individual dynamics of each slot k as well as the pairwise interaction between all combinations of slots , aggregating them into a prediction of the posterior parameters for the next time step t+ 1 for each slot k. For full details on IODINE and OP3 , refer to Appendix C.4 and C.5 , respectively . SCALable Object-oriented Representation ( SCALOR ) ( Jiang et al. , 2020 ) is a spatial transformer-based model that factors scenes into background and multiple foreground objects , which are tracked throughout the sequence . Frames are encoded using a convolutional LSTM f . In the proposal-rejection phase , the current frame t is divided into H ×W grid cells . For each grid cell a object latent variable zt , h , w is proposed , that is factored into existence , pose , depth and appearance parameters . Subsequently , proposed objects that significantly overlap with a propagated object are rejected . In the propagation phase , per object GRUs are updated for all objects present in the scene . Additionally , SCALOR has a background module to encode the background and its dynamics . Frame reconstructions are rendered using a background decoder and foreground STNs for object masks and appearance . For full details on SCALOR , refer to Appendix C.6 .
The paper proposes a benchmark for the evaluation of unsupervised learning of object-centric representation. The benchmark consists of three datasets, multi-object tracking metrics and of the evaluation of four methods. The proposed dataset consists of three sets of video sequences, procedurally generated, which are either generated from slight variations of existing works (Sprites-MOT) or on the basis of existing datasets (dSpirites, Video Object Room). For evaluation, authors propose to use a slight variation of the protocol of the MOT challenge for evaluation (with the addition of a Mostly Detected measure which does not penalize ID switches). As part of the paper, they also evaluate and discuss the performances of four object-centric representation models, one of them (Video MONet) being an extension of an existing approach, proposed as part of this paper, and the remaining being state of the art approaches for the task.
SP:9e9ae7233f8037f5ae0ef4b641027dd46b997324
Benchmarking Unsupervised Object Representations for Video Sequences
1 INTRODUCTION . Humans understand the world in terms of objects . Being able to decompose our environment into independent objects that can interact with each other is an important prerequisite for reasoning and scene understanding . Similarly , an artificial intelligence system would benefit from the ability to both extract objects and their interactions from video streams , and keep track of them over time . Recently , there has been an increased interest in unsupervised learning of object-centric representations . The key insight of these methods is that the compositionality of visual scenes can be used to both discover ( Eslami et al. , 2016 ; Greff et al. , 2019 ; Burgess et al. , 2019 ) and track objects in videos ( Greff et al. , 2017 ; van Steenkiste et al. , 2018 ; Veerapaneni et al. , 2019 ) without supervision . However , it is currently not well understood how the learned visual representations of different models compare to each other quantitatively , since the models have been developed with different downstream tasks in mind and have not been evaluated using a common protocol . Hence , in this work , we propose a benchmark based on procedurally generated video sequences to test basic perceptual abilities of object-centric video models under various challenging tracking scenarios . An unsupervised object-based video representation should ( 1 ) effectively identify objects as they enter a scene , ( 2 ) accurately segment objects , as well as ( 3 ) maintain a consistent representation for each individual object in a scene over time . These perceptual abilities can be evaluated quantitatively in the established multi-object tracking framework ( Bernardin & Stiefelhagen , 2008 ; Milan et al. , 2016 ) . We propose to utilize this protocol for analyzing the strengths and weaknesses of different object-centric representation learning methods , independent of any specific downstream task , in order to uncover the different inductive biases hidden in their choice of architecture and loss formulation . We therefore compiled a benchmark consisting of three procedurally generated video datasets of varying levels of visual complexity and two generalization tests . Using this benchmark , we quantitatively compared three classes of object-centric models , leading to the following insights : • All of the models have shortcomings handling occlusion , albeit to different extents . • OP3 ( Veerapaneni et al. , 2019 ) performs strongest in terms of quantitative metrics , but exhibits a surprisingly strong dependency on color to separate objects and accumulates false positives when fewer objects than slots are present . • Spatial transformer models , TBA ( He et al. , 2019 ) and SCALOR ( Jiang et al. , 2020 ) , train most efficiently and feature explicit depth reasoning in combination with amodal masks , but are nevertheless outperformed by the simpler model , VIMON , lacking a depth or interaction model , suggesting that the proposed mechanisms may not yet work as intended . We will make our code , data , as well as a public leaderboard of results available . 2 RELATED WORK . Several recent lines of work propose to learn object-centric representations from visual inputs for static and dynamic scenes without explicit supervision . Though their results are promising , methods are currently restricted to handling synthetic datasets and as of yet are unable to scale to complex natural scenes . Furthermore , a systematic quantitative comparison of methods is lacking . Selecting and processing parts of an image via spatial attention has been one prominent approach for this task ( Mnih et al. , 2014 ; Eslami et al. , 2016 ; Kosiorek et al. , 2018 ; Burgess et al. , 2019 ; Yuan et al. , 2019 ; Crawford & Pineau , 2019 ; Locatello et al. , 2020 ) . As an alternative , spatial mixture models decompose scenes by performing image-space clustering of pixels that belong to individual objects ( Greff et al. , 2016 ; 2017 ; 2019 ; van Steenkiste et al. , 2018 ) . While some approaches aim at learning a suitable representation for downstream tasks ( Watters et al. , 2019a ; Veerapaneni et al. , 2019 ) , others target scene generation ( Engelcke et al. , 2019 ; von Kügelgen et al. , 2020 ) . We analyze three classes of models for processing videos , covering three models based on spatial attention and one based on spatial mixture modeling . Spatial attention models with unconstrained latent representations use per-object variational autoencoders , as introduced by Burgess et al . ( 2019 ) . von Kügelgen et al . ( 2020 ) adapts this approach for scene generation . So far , such methods have been designed for static images , but not for videos . We therefore extend MONET ( Burgess et al. , 2019 ) to be able to accumulate evidence over time for tracking , enabling us to include this class of approaches in our evaluation . Recent concurrent work on AlignNet ( Creswell et al. , 2020 ) applies MONET frame-by-frame and tracks objects by subsequently ordering the extracted objects consistently . Spatial attention models with factored latents use an explicit factorization of the latent representation into properties such as position , scale and appearance ( Eslami et al. , 2016 ; Crawford & Pineau , 2019 ) . These methods use spatial transformer networks ( Jaderberg et al. , 2015 ) to render per-object reconstructions from the factored latents ( Kosiorek et al. , 2018 ; He et al. , 2019 ; Jiang et al. , 2020 ) . SQAIR ( Kosiorek et al. , 2018 ) does not perform segmentation , identifying objects only at the bounding-box level . We select Tracking-by-Animation ( TBA ) ( He et al. , 2019 ) and SCALOR ( Jiang et al. , 2020 ) for analyzing spatial transformer methods in our experiments , which explicitly disentangle object shape and appearance , providing access to object masks . Spatial mixture models cluster pixels using a deep neural network trained with expectation maximization ( Greff et al. , 2017 ; van Steenkiste et al. , 2018 ) . IODINE ( Greff et al. , 2019 ) extends these methods with an iterative amortised variational inference procedure ( Marino et al. , 2018 ) , improving segmentation quality . SPACE ( Lin et al. , 2020 ) combines mixture models with spatial attention to improve scalability . To work with video sequences , OP3 ( Veerapaneni et al. , 2019 ) extends IODINE by modeling individual objects ’ dynamics as well as pairwise interactions . We therefore include OP3 in our analysis as a representative spatial mixture model . 3 OBJECT-CENTRIC REPRESENTATION BENCHMARK . To compare the different object-centric representation learning models on their basic perceptual abilities , we use the well-established multi-object tracking ( MOT ) protocol ( Bernardin & Stiefelhagen , 2008 ) . In this section , we describe the datasets and metrics considered in our benchmark , followed by a brief description of the models evaluated . 3.1 DATASETS . Current object-centric models are not capable of modeling complex natural scenes ( Burgess et al. , 2019 ; Greff et al. , 2019 ; Lin et al. , 2020 ) . Hence , we focus on synthetic datasets that resemble those which state-of-the-art models were designed for . Specifically , we evaluate on three synthetic datasets1 ( see Table 1 ) , which cover multiple levels of visual and motion complexity . Synthetic stimuli enable us to precisely generate challenging scenarios in a controllable manner in order to disentangle sources of difficulty and glean insights on what models specifically struggle with . We design different scenarios that test complexities that would occur in natural videos such as partial or complete occlusion as well as similar object appearances . Sprites-MOT ( SpMOT , Table 1 left ) , as proposed by He et al . ( 2019 ) , features simple 2D sprites moving linearly on a black background with objects moving in and out of frame during the sequence . Video-Multi-dSprites ( VMDS , Table 1 right ) is a video dataset we generated based on a colored , multi-object version of the dSprites dataset ( Matthey et al. , 2017 ) . Each video contains one to four sprites that move non-linearly and independently of each other with the possibility of partial or full occlusion . Besides the i.i.d . sampled training , validation and test sets of VMDS , we generate seven additional challenge sets that we use to study specific test situations we observed to be challenging , such as guaranteed occlusion , specific object properties , or out-of-distribution appearance variations . Video Objects Room ( VOR , Table 1 middle ) is a video dataset we generated based on the static Objects Room dataset ( Greff et al. , 2019 ) , which features static objects in a 3D room with a moving camera . For full details on the datasets and their generation , see Appendix B . 3.2 METRICS . Our evaluation protocol follows the multi-object tracking ( MOT ) challenge , a standard and widelyused benchmark for supervised object tracking ( Milan et al. , 2016 ) . The MOT challenge uses the CLEAR MOT metrics ( Bernardin & Stiefelhagen , 2008 ) , which quantitatively evaluate different performance aspects of object detection , tracking and segmentation . To compute these metrics , predictions have to be matched to ground truth . Unlike Bernardin & Stiefelhagen ( 2008 ) and Milan et al . ( 2016 ) , we use binary segmentation masks for this matching instead of bounding boxes , which helps us better understand the models ’ segmentation capabilities . We consider an intersection over union ( IoU ) greater than 0.5 as a match ( Voigtlaender et al. , 2019 ) . The error metrics used are the fraction of Misses ( Miss ) , ID switches ( ID S. ) and False Positives ( FPs ) relative to the number of ground truth masks . In addition , we report the Mean Squared Error ( MSE ) of the reconstructed image outputs summed over image channels and pixels . To quantify the overall number of failures , we use the MOT Accuracy ( MOTA ) , which measures the fraction of all failure cases compared to the total number of objects present in all frames . A model with 100 % MOTA perfectly tracks all objects without any misses , ID switches or false positives . To quantify the segmentation quality , we define MOT Precision ( MOTP ) as the average IoU of segmentation masks of all matches . A model with 100 % MOTP perfectly segments all tracked objects , but does not necessarily track all objects . Further , to quantify detection and tracking performance 1Datasets are available at this https URL . independent of false positives , we measure the Mostly Detected ( MD ) and Mostly Tracked ( MT ) metrics , the fraction of ground truth objects that have been detected and tracked for at least 80 % of their lifespan , respectively . If an ID switch occurs , an object is considered detected but not tracked . For full details regarding the matching process and the evaluation metrics , refer to Appendix A . 3.3 MODELS . We consider three classes of unsupervised object-centric representation learning models : ( 1 ) a spatial attention model with unconstrained latents , VIMON , which is our video extension of MONET ( Burgess et al. , 2019 ) ; ( 2 ) spatial transformer-based attention models , TBA ( He et al. , 2019 ) and SCALOR ( Jiang et al. , 2020 ) ; ( 3 ) a scene mixture model , OP3 ( Veerapaneni et al. , 2019 ) . At a high-level , these methods share a common structure which is illustrated in Fig . 1a . They decompose an image into a fixed number of slots ( Burgess et al. , 2019 ) , each of which contains an embedding zt , k and a mask mt , k of ( ideally ) a single object . These slots are then combined in a decoding step to reconstruct the image . Below , we briefly describe each method . Appendix C provides a detailed explanation in a unified mathematical framework . Video MONet ( VIMON ) is our video extension of MONET ( Burgess et al. , 2019 ) . MONET recurrently decomposes a static scene into slots , using an attention network to sequentially extract attention masks mk ∈ [ 0 , 1 ] H×W of individual objects k. A Variational Autoencoder ( VAE ) ( Kingma & Welling , 2014 ) encodes each slot into a latent representation zk ∈ RL of the corresponding object . We use MONET as a simple frame-by-frame baseline for detection and segmentation that does not employ temporal information . VIMON accumulates evidence about the objects over time to maintain a consistent object-slot assignment throughout the video . This is achieved by ( 1 ) seeding the attention network the predicted mask m̂t , k ∈ [ 0 , 1 ] H×W from the previous time step and ( 2 ) introducing a gated recurrent unit ( GRU ) ( Cho et al. , 2014 ) , which aggregates information over time for each slot separately , enabling it to encode motion information . For full details on MONET and VIMON , as well as ablations to provide context for the design decisions , refer to Appendix C.1 , C.2 and E.3 . Tracking-by-Animation ( TBA ) ( He et al. , 2019 ) is a spatial transformer-based attention model . Frames are encoded by a convolutional feature extractor f before being passed to a recurrent block g called Reprioritized Attentive Tracking ( RAT ) . RAT re-weights slot input features based on their cosine similarity with the slots from the previous time step and outputs latent representations for all K slots in parallel . Each slot latent is further decoded into a mid-level representation yt , k consisting of pose and depth parameters , as well as object appearance and shape templates ( see Fig . 1c ) . For rendering , a Spatial Transformer Network ( STN ) ( Jaderberg et al. , 2015 ) is used with an additional occlusion check based on the depth estimate . TBA is trained on frame reconstruction with an additional penalty for large object sizes to encourage compact bounding boxes . TBA can only process scenes with static backgrounds , as it preprocesses sequences using background subtraction ( Bloisi & Iocchi , 2012 ) . For full details on TBA , refer to Appendix C.3 . Object-centric Perception , Prediction , and Planning ( OP3 ) ( Veerapaneni et al. , 2019 ) extends IODINE ( Greff et al. , 2019 ) to operate on videos . IODINE decomposes an image into objects and represents them independently by starting from an initial guess of the segmentation of the entire frame , and subsequently iteratively refines it using the refinement network f ( Marino et al. , 2018 ) . In each refinement step m , the image is represented by K slots with latent representations zm , k . OP3 applies IODINE to each frame xt to extract latent representations zt , m , k , which are subsequently processed by a dynamics network d ( see Fig . 1e ) , which models both the individual dynamics of each slot k as well as the pairwise interaction between all combinations of slots , aggregating them into a prediction of the posterior parameters for the next time step t+ 1 for each slot k. For full details on IODINE and OP3 , refer to Appendix C.4 and C.5 , respectively . SCALable Object-oriented Representation ( SCALOR ) ( Jiang et al. , 2020 ) is a spatial transformer-based model that factors scenes into background and multiple foreground objects , which are tracked throughout the sequence . Frames are encoded using a convolutional LSTM f . In the proposal-rejection phase , the current frame t is divided into H ×W grid cells . For each grid cell a object latent variable zt , h , w is proposed , that is factored into existence , pose , depth and appearance parameters . Subsequently , proposed objects that significantly overlap with a propagated object are rejected . In the propagation phase , per object GRUs are updated for all objects present in the scene . Additionally , SCALOR has a background module to encode the background and its dynamics . Frame reconstructions are rendered using a background decoder and foreground STNs for object masks and appearance . For full details on SCALOR , refer to Appendix C.6 .
The paper presents an empirical evaluation of a number of recent models for unsupervised object-based video modelling. Five different models are evaluated on three (partially novel) benchmarks, providing a unifying perspective on the relative performance of these models. Several common issues are identified and highlighted using challenge datasets: The reliance on color as a cue for object segmentation, occlusion, object size, and change in object appearance. The paper concludes with several ideas for alleviating these issues.
SP:9e9ae7233f8037f5ae0ef4b641027dd46b997324
Sharper Generalization Bounds for Learning with Gradient-dominated Objective Functions
1 INTRODUCTION . Stochastic optimization has found tremendous applications in training highly expressive machine learning models including deep neural networks ( DNNs ) ( Bottou et al. , 2018 ) , which are ubiquitous in modern learning architectures ( LeCun et al. , 2015 ) . Oftentimes , the models trained in this way have not only very small training errors or even interpolate the training examples , but also surprisingly generalize well to testing examples ( Zhang et al. , 2017 ) . While the low training error can be well explained by the over-parametrization of models and the efficiency of the optimization algorithm in identifying a local minimizer ( Bassily et al. , 2018 ; Vaswani et al. , 2019 ; Ma et al. , 2018 ) , it is still unclear how the highly expressive models also achieve a low testing error ( Ma et al. , 2018 ) . With the recent theoretical and empirical study , it is believed that a joint consideration of the interaction among the optimization algorithm , learning models and training examples is necessary to understand the generalization behavior ( Neyshabur et al. , 2017 ; Hardt et al. , 2016 ; Lin et al. , 2016 ) . The generalization error for stochastic optimization typically consists of an optimization error and an estimation error ( see e.g . Bousquet & Bottou ( 2008 ) ) . Optimization errors arise from the suboptimality of the output of the chosen optimization algorithms , while estimation errors refer to the discrepancy between the testing error and training error at the output model . There is a large amount of literature on studying the optimization error ( convergence ) of stochastic optimization algorithms ( Bottou et al. , 2018 ; Orabona , 2014 ; Karimi et al. , 2016 ; Ying & Zhou , 2017 ; Liu et al. , 2018 ) . In particular , the power of interpolation is clearly justified in boosting the convergence rate of stochastic gradient descent ( SGD ) ( Bassily et al. , 2018 ; Vaswani et al. , 2019 ; Ma et al. , 2018 ) . In contrast , there is far less work on studying estimation errors of optimization algorithms . In a seminal paper ( Hardt et al. , 2016 ) , the fundamental concept of algorithmic stability was used to study the generalization behavior of SGD , which was further improved and extended in Charles & Papailiopoulos ( 2018 ) ; Zhou et al . ( 2018b ) ; Yuan et al . ( 2019 ) ; Kuzborskij & Lampert ( 2018 ) . ∗Corresponding author : Yiming Ying However , these results are still not quite satisfactory in the following three aspects . Firstly , the existing stability bounds in non-convex learning require very small step sizes ( Hardt et al. , 2016 ) and yield suboptimal generalization bounds ( Yuan et al. , 2019 ; Charles & Papailiopoulos , 2018 ; Zhou et al. , 2018b ) . Secondly , majority of the existing work has focused on functions with a uniform Lipschitz constant which can be very large in practical models if not infinite ( Bousquet & Elisseeff , 2002 ; Hardt et al. , 2016 ; Charles & Papailiopoulos , 2018 ; Kuzborskij & Lampert , 2018 ) , e.g. , DNNs . Thirdly , the existing stability analysis fails to explain how the highly expressive models still generalize in an interpolation setting , which is observed for overparameterized DNNs ( Arora et al. , 2019 ; Brutzkus et al. , 2017 ; Bassily et al. , 2018 ; Belkin et al. , 2019 ) . In this paper , we make attempts to address the above three issues using novel stability analysis approaches . Our main contributions are summarized as follows . 1 . We develop general stability and generalization bounds for any learning algorithm to optimize ( non-convex ) β-gradient-dominated objectives . Specifically , we show that the excess generalization error is bounded by O ( 1/ ( nβ ) ) plus the convergence rate of the algorithm , where n is the sample size . This general theorem implies that overfitting will never happen in this case , and generalization would always improve as we increase the training accuracy , which is due to an implicit regularization effect of gradient dominance condition . In particular , we show that interpolation actually improves generalization for highly expressive models . In contrast to the existing discussions based on either hypothesis stability or uniform stability which imply at best a bound of O ( 1/ √ nβ ) , the main idea is to consider a weaker on-average stability measure which allows us to replace the uniform Lipschitz constant in Hardt et al . ( 2016 ) ; Kuzborskij & Lampert ( 2018 ) ; Charles & Papailiopoulos ( 2018 ) with the training error of the best model . 2 . We apply our general results to various stochastic optimization algorithms , and highlight the advantage over existing generalization analysis . For example , we derive an exponential convergence of testing errors for SGD in an interpolation setting , which complements the exponential convergence of optimization errors ( Bassily et al. , 2018 ; Vaswani et al. , 2019 ; Ma et al. , 2018 ) and extends the existing results ( Pillaud-Vivien et al. , 2018 ; Nitanda & Suzuki , 2019 ) from a strongly-convex setting to a non-convex setting . In particular , we show that stochastic variance-reduced optimization outperforms SGD by achieving a significantly faster convergence of testing errors , while this advantage is only shown in terms of optimization errors in the literature ( Reddi et al. , 2016 ; Lei et al. , 2017 ; Nguyen et al. , 2017 ; Zhou et al. , 2018a ; Wang et al. , 2019 ) . 2 RELATED WORK . Algorithmic Stability . We first review the related work on stability and generalization . Algorithmic stability is a fundamental concept in statistical learning theory ( Bousquet & Elisseeff , 2002 ; Elisseeff et al. , 2005 ) , which has a deep connection with learnability ( Shalev-Shwartz et al. , 2010 ; Rakhlin et al. , 2005 ) . The important uniform stability was introduced in Bousquet & Elisseeff ( 2002 ) , where the authors showed that empirical risk minimization ( ERM ) enjoys the uniform stability if the objective function is strongly convex . This concept was extended to study randomized algorithms such as bagging and bootstrap ( Elisseeff et al. , 2005 ) . An interesting trade-off between uniform stability and convergence was developed for iterative optimization algorithms , which was then used to study convergence lower bounds of different algorithms ( Chen et al. , 2018 ) . While generalization bounds based on stability are often stated in expectation , uniform stability was recently shown to guarantee almost optimal high-probability bounds based on elegant concentration inequalities for weakly-dependent random variables ( Maurer , 2017 ; Feldman & Vondrak , 2019 ; Bousquet et al. , 2020 ) . Other than the standard classification and regression setting , uniform stability was very successfully to study transfer learning ( Kuzborskij & Lampert , 2018 ) , PAC-Bayesian bounds ( London , 2017 ) , privacy learning ( Bassily et al. , 2019 ) and pairwise learning ( Lei et al. , 2020b ) . Some other stability measures include the uniform argument stability ( Liu et al. , 2017 ) , hypothesis stability ( Bousquet & Elisseeff , 2002 ) , hypothesis set stability ( Foster et al. , 2019 ) and on-average stability ( Shalev-Shwartz et al. , 2010 ) . An advantage of on-average stability is that it is weaker than the uniform stability and can imply better generalization by exploiting either the strong convexity of the objective function ( Shalev-Shwartz & Ben-David , 2014 , Corollary 13.7 ) or the more relaxed exp-concavity of loss functions ( Koren & Levy , 2015 ; Gonen & Shalev-Shwartz , 2017 ) . Since gradient-dominance condition is another relaxed extension of strong convexity , we use on-average stability to study generalization bounds . Generalization analysis . We now review related work on generalization analysis for stochastic optimization . In a seminal paper ( Hardt et al. , 2016 ) , the authors used the nonexpansiveness of gradient mapping to develop uniform stability bounds for SGD to optimize convex , strongly convex and even non-convex objective functions . This inspired some interesting work on stochastic optimization . An interesting data-dependent stability bound was developed for SGD , a nice property of which is that it shows how the initialization would affect generalization ( Kuzborskij & Lampert , 2018 ) . These stability bounds were integrated into a PAC-Bayesian analysis of SGD , yielding generalization bounds for arbitrary posterior distributions ( London , 2017 ) . Almost optimal generalization bounds were developed for differentially private stochastic convex optimization ( Bassily et al. , 2019 ) . The onaverage variance of stochastic gradients was used to refine the generalization analysis of SGD ( Hardt et al. , 2016 ) in non-convex optimization ( Zhou et al. , 2018b ) . The uniform stability was also studied for SGD implemented in a stagewise manner ( Yuan et al. , 2019 ) and stochastic gradient Langevin dynamics in a non-convex setting ( Li et al. , 2020 ; Mou et al. , 2018 ) . Very recently , the discussions in Hardt et al . ( 2016 ) were extended to tackle non-smooth ( Lei & Ying , 2020 ; Bassily et al. , 2020 ) and non-Lipscthiz functions ( Lei & Ying , 2020 ) . The most related work is Charles & Papailiopoulos ( 2018 ) , where some general hypothesis stability bounds were developed for learning algorithms that converge to optima . A very interesting point is that their bounds depend only on the convergence of the algorithm to a global minimum and the geometry of loss functions around the global minimum . However , their discussion imply at best the slow generalization bounds O ( 1/ √ nβ ) for β-gradientdominated objective functions , and can not explain the benefit of low optimization errors in helping generalization . The underlying reason is that they used the pointwise hypothesis stability and did not consider the smoothness of loss functions . We aim to improve these results by leveraging the weaker on-average stability and smoothness of loss functions . Other than the stability approach , there is interesting generalization analysis of SGD based on either a uniform convergence approach ( Lin et al. , 2016 ) , an integral operator approach ( Lin & Rosasco , 2017 ; Ying & Pontil , 2008 ; Dieuleveut & Bach , 2016 ; Dieuleveut et al. , 2017 ; Mücke et al. , 2019 ) or an information-theoretic approach ( Xu & Raginsky , 2017 ; Negrea et al. , 2019 ; Bu et al. , 2020 ) . 3 MAIN RESULTS . Let ρ be a probability measure defined on a sample spaceZ = X×Y withX ⊆ Rd andY ⊆ R , from which a training dataset S = { z1 , . . . , zn } is drawn independently and identically . The aim is to find a good model w from a model parameter spaceW based on the training dataset S. The performance of a prescribed model w on a single example z can be measured by a nonnegative loss function f ( w ; z ) , where f : W ×Z 7→ R+ . In machine learning we often apply an ( randomized ) algorithm A : ∪nZn 7→ W to S to produce an output modelA ( S ) ∈ W . Oftentimes , the constructed model w would have a small empirical risk FS ( w ) = 1n ∑n i=1 f ( w ; zi ) . However , we are mostly interested in the generalization performance of a model w on testing examples measured by the population ( true ) risk F ( w ) = Ez [ f ( w ; z ) ] , where Ez denotes the expectation with respect to ( w.r.t . ) z . The gap ES , A [ F ( A ( S ) ) −FS ( A ( S ) ) ] between the population risk and empirical risk is called the estimation error , which is due to the approximation of ρ by sampling . Here EA denotes the expectation w.r.t . the randomness of the algorithm A . For example , if A is SGD , then EA denotes the expectation w.r.t . the random indices of training examples selected for the gradient computation . A powerful tool to study the estimation error is the algorithmic stability ( Bousquet & Elisseeff , 2002 ; Elisseeff et al. , 2005 ; Shalev-Shwartz et al. , 2010 ; Hardt et al. , 2016 ) , which measures the sensitivity of the algorithm ’ s output w.r.t . the perturbation of a training dataset . Below we give formal definitions of stability measures , whose connection to generalization is established in Theorem A.1 . Definition 1 ( Uniform Stability ) . A randomized algorithmA has uniform stability if for all datasets S , S̃ ∈ Zn that differ by at most one example , we have supz EA [ f ( A ( S ) ; z ) − f ( A ( S̃ ) ; z ) ] ≤ . The following on-average stability is similar to the average-RO stability in Shalev-Shwartz et al . ( 2010 ) . The difference is we do not use an absolute value . Form ∈ N , we denote [ m ] = { 1 , . . . , m } . Definition 2 ( On-average Stability ) . Let S = { z1 , . . . , zn } and S̃ = { z̃1 , . . . , z̃n } be drawn independently from ρ . For each i ∈ [ n ] , denote S ( i ) = { z1 , . . . , zi−1 , z̃i , zi+1 , . . . , zn } . We say an algorithm A has on-average stability if 1n ∑n i=1 ES , S̃ , A [ f ( A ( S ( i ) ) ; zi ) − f ( A ( S ) ; zi ) ] ≤ . In this paper , we are interested in the excess generalization error F ( A ( S ) ) − F ( w∗ ) , where w∗ ∈ arg minw∈W F ( w ) is the best model with the least testing error ( population risk ) . For this purpose , we introduce some basic assumptions . A basic assumption in non-convex learning is the smoothness of loss functions ( Ghadimi & Lan , 2013 ; Karimi et al. , 2016 ) , meaning the gradients are Lipschitz continuous . Let ‖ · ‖2 denote the Euclidean norm and∇ denote the gradient operator . Assumption 1 ( Smoothness Assumption ) . We assume for all z ∈ Z , the differentiable function w 7→ f ( w ; z ) is L-smooth , i.e. , ‖∇f ( w ; z ) −∇f ( w′ ; z ) ‖2 ≤ L‖w −w′‖2 for all w , w′ ∈ W . Another assumption is the Polyak-Lojasiewicz ( PL ) condition on the objective function , which is common in non-convex optimization ( Zhou et al. , 2018b ; Reddi et al. , 2016 ; Karimi et al. , 2016 ; Wang et al. , 2019 ; Lei et al. , 2017 ) , and was shown to hold true for deep ( linear ) and shallow neural networks ( Hardt & Ma , 2016 ; Charles & Papailiopoulos , 2018 ; Li & Yuan , 2017 ) . Assumption 2 ( Polyak-Lojasiewicz Condition ) . Denote F̂S = infw′∈W FS ( w′ ) . We assume FS satisfies PL or gradient-dominated condition ( in expectation ) with parameter β > 0 , i.e. , ES [ FS ( w ) − F̂S ] ≤ 1 2β ES [ ‖∇FS ( w ) ‖22 ] , ∀w ∈ W. ( 3.1 ) It is worthy of mentioning that our results in this section continue to hold if the global PL condition is relaxed to a local PL condition , i.e. , ( 3.1 ) holds for w in a neighborhood of the minimizer of FS . The existing stability analysis often imposes a bounded gradient assumption below ( Bousquet & Elisseeff , 2002 ; Hardt et al. , 2016 ; Charles & Papailiopoulos , 2018 ; Yuan et al. , 2019 ; Kuzborskij & Lampert , 2018 ) . Indeed , the resulting stability bounds depend on the uniform Lipschitz constant G ( see eq . ( 3.4 ) ) , which can be prohibitively large in practical models , e.g. , DNNs , or even infinite , e.g . least squares regression in an unbounded domain . Assumption 3 ( Bounded Gradient Assumption ) . We assume ‖∇f ( w ; z ) ‖2 ≤ G for all w ∈ W , z ∈ Z and a constant G > 0 . Our main result to be proved in Appendix B removes Assumption 3 and replaces the uniform Lipschitz constant G by the minimal empirical risk F̂S , which is significantly smaller than the Lipschitz constant . Note the assumption L ≤ nβ/4 is mild , and the previous generalization bounds become vacuous as O ( 1 ) ( Yuan et al. , 2019 ; Charles & Papailiopoulos , 2018 ) if this assumption is violated . Theorem 1 ( Main Theorem ) . Let Assumptions 1 , 2 hold and wS = A ( S ) . If L ≤ nβ/4 , then E [ F ( wS ) − F̂S ] ≤ 16LE [ F̂S ] nβ + LE [ FS ( wS ) − F̂S ] 2β . ( 3.2 ) An important implication is as follows . Since E [ F̂S ] ≤ E [ FS ( w ∗ ) ] = F ( w∗ ) and F̂S ≤ FS ( wS ) , Eq . ( 3.2 ) implies an upper bound on the excess generalization error E [ F ( wS ) ] − F ( w∗ ) and E [ F ( wS ) − FS ( wS ) ] = O ( 1 nβ + E [ FS ( wS ) − F̂S ] β ) . ( 3.3 ) The above two terms can be explained as follows . The term O ( 1/ ( nβ ) ) reflects the intrinsic complexity of the problem , while E [ FS ( wS ) − F̂S ] is called the optimization error . An interesting observation is that the overfitting phenomenon would never happen for learning under the PL condition ( analogous to learning with strongly convex objectives where the global minimizer generalizes well ( Bousquet & Elisseeff , 2002 ) ) . Indeed , if the optimization algorithm finds more and more accurate solutions , it achieves the limiting generalization bound O ( 1/ ( nβ ) ) . This shows an important message that optimization can be beneficial to generalization . This seemingly counterintuitive phenomenon is due to the implicit regularization enforced by the PL condition ( analogous to the strong convexity condition ) . Another notable property is that Theorem 1 applies to any algorithm . We can plug any known optimization error bounds into it to immediately get generalization bounds . Remark 1 . We show that our result significantly improves the existing stability analysis . The work ( Charles & Papailiopoulos , 2018 ) showed the pointwise hypothesis stability is controlled by 2G 2 nβ + 2 √ 2G √ E [ FS ( wS ) − F̂S ] /β , which together with the connection between stability and generalization ( cf . ( A.1 ) ) , implies with probability 1− δ that F ( wS ) ≤ FS ( wS ) + ( M2 nδ + 24MG2 nβδ + 24MG √ 2E [ FS ( wS ) − F̂S ] √ βδ ) 1 2 . ( 3.4 ) The above bound requires the bounded gradient assumption ‖∇f ( w ; z ) ‖2 ≤ G and the bounded loss assumption 0 ≤ f ( w ; z ) ≤ M for all w ∈ W and z ∈ Z , which are successfully removed in our generalization analysis . Furthermore , our generalization bound significantly improves ( 3.4 ) . Indeed , assume E [ FS ( wS ) − F̂S ] ≤ 2β for some > 0 , then ( 3.3 ) implies E [ F ( wS ) ] = E [ FS ( wS ) ] +O ( 1 nβ + 2 ) , ( 3.5 ) while ( 3.4 ) becomes F ( wS ) = FS ( wS ) +O ( 1√ nβ + √ ) . To achieve the generalization guarantee O ( 1/ √ nβ ) , the above bound requires the optimization accuracy = O ( 1/ ( nβ ) ) , while our bound ( 3.5 ) only requires the accuracy = O ( 1/ √ nβ ) but gets the significantly better generalization bound 1/ ( nβ ) . We actually develop a better stability bound . Specifically , the pointwise hypothesis stability is bounded by O ( 1 nβ + ) in Charles & Papailiopoulos ( 2018 ) while we show that the on- average stability is bounded by O ( 1 nβ + 2 ) , which is significantly tighter if 1nβ ≤ ≤ 1 ( ignoring constant factors ) . It should be mentioned that Charles & Papailiopoulos ( 2018 ) did not impose a smoothness assumption . However , the smoothness assumption is widely used in non-convex optimization to derive meaningful rates ( Ghadimi & Lan , 2013 ) . As compared to probabilistic bounds in Charles & Papailiopoulos ( 2018 ) , our bounds are stated in expectation . The extension to highprobability bounds will lead to additional O ( 1/ √ n ) term ( Feldman & Vondrak , 2019 ) . Remark 2 ( Bounded gradient assumption ) . Very recently , the bounded gradient assumption was also removed for the stability analysis ( Lei & Ying , 2020 ) . However , their analysis considered SGD applied to convex loss functions . As a comparison , we study stability and generalization in a nonconvex learning setting , and our analysis applies to any stochastic optimization algorithms . Remark 3 . If A is ERM , Theorem 1 immediately implies E [ F ( wS ) − F̂S ] ≤ 16Lnβ E [ F̂S ] . If FS is β-strongly convex and L < nβ/2 , it was shown for ERM that E [ F ( wS ) − F̂S ] ≤ 48Lnβ E [ F̂S ] ( Shalev-Shwartz & Ben-David , 2014 , Corollary 13.7 ) . Their result is extended here from a strongly convex setting to a gradient-dominated setting , and from the particular ERM to any algorithm . As a direct corollary , we can derive the following optimistic bound in the interpolation setting , which is the most intriguing case for over-parameterized or highly expressive DNN models . Corollary 2 . Let Assumptions 1 , 2 hold and wS = A ( S ) . If E [ F̂S ] = 0 and L < nβ/2 , then E [ F ( wS ) ] ≤ L2βE [ FS ( wS ) ] . Remark 4 . Corollary 2 shows a benefit of interpolation in boosting the generalization by achieving a generalization bound O ( ) for any > 0 if we minimize FS sufficiently well . This benefit can not be explained by the existing discussions ( Hardt et al. , 2016 ; Charles & Papailiopoulos , 2018 ) as they imply the same generalization bound O ( 1/ √ nβ ) in the interpolation setting . Although it was observed that interpolation helps in training ( Bassily et al. , 2018 ; Vaswani et al. , 2019 ; Ma et al. , 2018 ; Oymak & Soltanolkotabi , 2020 ; Allen-Zhu et al. , 2019 ; Zou et al. , 2018 ) , it is still largely unclear , as indicated in Ma et al . ( 2018 ) , that how interpolation helps in generalization . Corollary 2 shows new insights on how interpolation from highly expressive models helps generalization . We now move on to the discussion on the critical assumption in Corollary 2 , i.e . L < nβ/2 . According to the proof , the two parameters L and β can be replaced by their local counterparts , i.e. , the smoothness and PL condition related to a particular minimizer w′ of FS ( i ) ( Eqs . ( B.6 ) , ( B.7 ) ) . For example , β can be replaced by 12‖∇FS ( w ′ ) ‖22/ ( FS ( w′ ) − F̂S ) , which can be larger than β . Below are some examples on explaining L/β < n/2 . As we will see , the quantity L/β reflects the complexity of the problem ( related to condition number as shown in Examples 1 , 2 ) . Therefore , the condition L/β < n/2 imposes implicitly a constraint on the complexity of the problems . This explains why the optimization algorithm would never overfit when applied to gradient-dominated objective functions if L/β < n/2 , as shown in Theorem 1 . Example 1 . Let φ : Rd 7→ Rm be a feature map , and ` : R×R 7→ R+ be a loss function which isL ` smooth and σ ` -strongly convex w.r.t . the first argument . Consider f ( w ; z ) = ` ( 〈w , φ ( xi ) 〉 , yi ) with 〈· , ·〉 being an inner product . Then , FS satisfies the PL condition with the parameter σ′min ( ΣS ) σ ` , where ΣS = 1n ∑n i=1 φ ( xi ) φ ( xi ) > is the empirical covariance matrix , A > denotes the transpose of a matrix A and σ′min ( A ) means the minimal non-zero singular value of A . The empirical counterpart ( we have an expectation w.r.t . S in PL condition ) of L/β is of the order of σmax ( ΣS ) /σ′min ( ΣS ) , where σmax ( A ) means the maximal singular value ( we give details in Appendix E.1 ) . Example 2 . Consider neural networks with a single hidden layer with d inputs , m hidden neurons and a single output neuron , for which the prediction function takes the form hv , w =∑m k=1 vkφ ( 〈wk , x〉 ) . Here wk ∈ Rd and vk ∈ R denote the weight of the edges connecting the k-th hidden node to the input and output node , respectively , while φ : R 7→ R is the activation function . Analogous to Arora et al . ( 2019 ) ; Oymak & Soltanolkotabi ( 2020 ) , we fix v = ( v1 , . . . , vm ) > with |vk| = a for some a > 0 and train w = ( w1 , w2 , . . . , wm ) > ∈ Rm×d from S. The loss function then takes the form f ( w ; z ) = ( v > φ ( wx ) −y ) 2 . If we consider the identity activation function , i.e. , φ ( t ) = t , then FS satisfies the PL condition with the parameter σmin ( ΣS ) , where σmin ( A ) denotes the minimal singular value of A and ΣS = 1n ∑n i=1 xix > i . The empirical counterpart of L/β is of the order of σmax ( ΣS ) /σmin ( ΣS ) ( we give details in Appendix E.2 for a general activation function ) . It is possible to get generalization bounds under some other conditions . Since one-point strong convexity condition together with smoothness assumption implies the PL condition ( Yuan et al. , 2019 ) , all our results apply to one-point strongly convex functions . We can also get generalization bounds for objective functions satisfying the quadratic growth condition ( Necoara et al. , 2018 ) , which is weaker than the PL condition . However , we need to impose a realizability condition which was also imposed in Charles & Papailiopoulos ( 2018 ) . The proof of Theorem 3 is given in Section C. Let w ( S ) denote the Euclidean projection of w onto the set of global minimizers of FS inW . Definition 3 ( Quadratic Growth Condition ) . We say FS : W 7→ R satisfies the quadratic growth condition ( in expectation ) with parameter β if E [ FS ( w ) −F̂S ] ≥ β2E [ ‖w−w ( S ) ‖22 ] for all w ∈ W . Theorem 3 . Let Assumption 1 hold and FS satisfy the quadratic growth condition with parameter β . If the problem is realizable , i.e. , E [ F̂S ] = 0 and L ≤ nβ/4 , then E [ F ( wS ) ] ≤ 2Lβ−1E [ FS ( wS ) ] . Finally , we consider any optimization algorithms applied to gradient-dominated and Lipschitz continuous functions . We do not require loss functions to be smooth here . It shows that the excess generalization bound can decay as fast as O ( 1/ ( nβ ) ) if we solve the optimization problem to a sufficient accuracy , which is much better than the generalization bound O ( 1/ √ nβ ) in Charles & Papailiopoulos ( 2018 ) . Recall the analysis in Charles & Papailiopoulos ( 2018 ) requires Assumptions 2 , 3 and a further assumption on boundedness of loss functions . The proof is given in Section C. Theorem 4 . Let Assumptions 2 , 3 hold and wS = A ( S ) . Then the following inequality holds E [ F ( wS ) − F̂S ] ≤ 2G 2 nβ + G ( E [ FS ( wS ) − F̂S ] ) 1 2 √ 2β .
This paper studies the generalization performance of stochastic algorithms in nonconvex optimization with gradient dominance condition. In detail, the authors suggest that for any algorithm, its generalization error can be bounded by $O(1/(n\beta))$ plus the optimization error of the algorithm, where $\beta$ is the gradient dominance parameter. The main idea for the authors to obtain such an improved bound is an advanced analysis based on a weaker on-average stability measure.
SP:8cbce41127c32edb148b2d6713f4ecec0efc6ff9
Sharper Generalization Bounds for Learning with Gradient-dominated Objective Functions
1 INTRODUCTION . Stochastic optimization has found tremendous applications in training highly expressive machine learning models including deep neural networks ( DNNs ) ( Bottou et al. , 2018 ) , which are ubiquitous in modern learning architectures ( LeCun et al. , 2015 ) . Oftentimes , the models trained in this way have not only very small training errors or even interpolate the training examples , but also surprisingly generalize well to testing examples ( Zhang et al. , 2017 ) . While the low training error can be well explained by the over-parametrization of models and the efficiency of the optimization algorithm in identifying a local minimizer ( Bassily et al. , 2018 ; Vaswani et al. , 2019 ; Ma et al. , 2018 ) , it is still unclear how the highly expressive models also achieve a low testing error ( Ma et al. , 2018 ) . With the recent theoretical and empirical study , it is believed that a joint consideration of the interaction among the optimization algorithm , learning models and training examples is necessary to understand the generalization behavior ( Neyshabur et al. , 2017 ; Hardt et al. , 2016 ; Lin et al. , 2016 ) . The generalization error for stochastic optimization typically consists of an optimization error and an estimation error ( see e.g . Bousquet & Bottou ( 2008 ) ) . Optimization errors arise from the suboptimality of the output of the chosen optimization algorithms , while estimation errors refer to the discrepancy between the testing error and training error at the output model . There is a large amount of literature on studying the optimization error ( convergence ) of stochastic optimization algorithms ( Bottou et al. , 2018 ; Orabona , 2014 ; Karimi et al. , 2016 ; Ying & Zhou , 2017 ; Liu et al. , 2018 ) . In particular , the power of interpolation is clearly justified in boosting the convergence rate of stochastic gradient descent ( SGD ) ( Bassily et al. , 2018 ; Vaswani et al. , 2019 ; Ma et al. , 2018 ) . In contrast , there is far less work on studying estimation errors of optimization algorithms . In a seminal paper ( Hardt et al. , 2016 ) , the fundamental concept of algorithmic stability was used to study the generalization behavior of SGD , which was further improved and extended in Charles & Papailiopoulos ( 2018 ) ; Zhou et al . ( 2018b ) ; Yuan et al . ( 2019 ) ; Kuzborskij & Lampert ( 2018 ) . ∗Corresponding author : Yiming Ying However , these results are still not quite satisfactory in the following three aspects . Firstly , the existing stability bounds in non-convex learning require very small step sizes ( Hardt et al. , 2016 ) and yield suboptimal generalization bounds ( Yuan et al. , 2019 ; Charles & Papailiopoulos , 2018 ; Zhou et al. , 2018b ) . Secondly , majority of the existing work has focused on functions with a uniform Lipschitz constant which can be very large in practical models if not infinite ( Bousquet & Elisseeff , 2002 ; Hardt et al. , 2016 ; Charles & Papailiopoulos , 2018 ; Kuzborskij & Lampert , 2018 ) , e.g. , DNNs . Thirdly , the existing stability analysis fails to explain how the highly expressive models still generalize in an interpolation setting , which is observed for overparameterized DNNs ( Arora et al. , 2019 ; Brutzkus et al. , 2017 ; Bassily et al. , 2018 ; Belkin et al. , 2019 ) . In this paper , we make attempts to address the above three issues using novel stability analysis approaches . Our main contributions are summarized as follows . 1 . We develop general stability and generalization bounds for any learning algorithm to optimize ( non-convex ) β-gradient-dominated objectives . Specifically , we show that the excess generalization error is bounded by O ( 1/ ( nβ ) ) plus the convergence rate of the algorithm , where n is the sample size . This general theorem implies that overfitting will never happen in this case , and generalization would always improve as we increase the training accuracy , which is due to an implicit regularization effect of gradient dominance condition . In particular , we show that interpolation actually improves generalization for highly expressive models . In contrast to the existing discussions based on either hypothesis stability or uniform stability which imply at best a bound of O ( 1/ √ nβ ) , the main idea is to consider a weaker on-average stability measure which allows us to replace the uniform Lipschitz constant in Hardt et al . ( 2016 ) ; Kuzborskij & Lampert ( 2018 ) ; Charles & Papailiopoulos ( 2018 ) with the training error of the best model . 2 . We apply our general results to various stochastic optimization algorithms , and highlight the advantage over existing generalization analysis . For example , we derive an exponential convergence of testing errors for SGD in an interpolation setting , which complements the exponential convergence of optimization errors ( Bassily et al. , 2018 ; Vaswani et al. , 2019 ; Ma et al. , 2018 ) and extends the existing results ( Pillaud-Vivien et al. , 2018 ; Nitanda & Suzuki , 2019 ) from a strongly-convex setting to a non-convex setting . In particular , we show that stochastic variance-reduced optimization outperforms SGD by achieving a significantly faster convergence of testing errors , while this advantage is only shown in terms of optimization errors in the literature ( Reddi et al. , 2016 ; Lei et al. , 2017 ; Nguyen et al. , 2017 ; Zhou et al. , 2018a ; Wang et al. , 2019 ) . 2 RELATED WORK . Algorithmic Stability . We first review the related work on stability and generalization . Algorithmic stability is a fundamental concept in statistical learning theory ( Bousquet & Elisseeff , 2002 ; Elisseeff et al. , 2005 ) , which has a deep connection with learnability ( Shalev-Shwartz et al. , 2010 ; Rakhlin et al. , 2005 ) . The important uniform stability was introduced in Bousquet & Elisseeff ( 2002 ) , where the authors showed that empirical risk minimization ( ERM ) enjoys the uniform stability if the objective function is strongly convex . This concept was extended to study randomized algorithms such as bagging and bootstrap ( Elisseeff et al. , 2005 ) . An interesting trade-off between uniform stability and convergence was developed for iterative optimization algorithms , which was then used to study convergence lower bounds of different algorithms ( Chen et al. , 2018 ) . While generalization bounds based on stability are often stated in expectation , uniform stability was recently shown to guarantee almost optimal high-probability bounds based on elegant concentration inequalities for weakly-dependent random variables ( Maurer , 2017 ; Feldman & Vondrak , 2019 ; Bousquet et al. , 2020 ) . Other than the standard classification and regression setting , uniform stability was very successfully to study transfer learning ( Kuzborskij & Lampert , 2018 ) , PAC-Bayesian bounds ( London , 2017 ) , privacy learning ( Bassily et al. , 2019 ) and pairwise learning ( Lei et al. , 2020b ) . Some other stability measures include the uniform argument stability ( Liu et al. , 2017 ) , hypothesis stability ( Bousquet & Elisseeff , 2002 ) , hypothesis set stability ( Foster et al. , 2019 ) and on-average stability ( Shalev-Shwartz et al. , 2010 ) . An advantage of on-average stability is that it is weaker than the uniform stability and can imply better generalization by exploiting either the strong convexity of the objective function ( Shalev-Shwartz & Ben-David , 2014 , Corollary 13.7 ) or the more relaxed exp-concavity of loss functions ( Koren & Levy , 2015 ; Gonen & Shalev-Shwartz , 2017 ) . Since gradient-dominance condition is another relaxed extension of strong convexity , we use on-average stability to study generalization bounds . Generalization analysis . We now review related work on generalization analysis for stochastic optimization . In a seminal paper ( Hardt et al. , 2016 ) , the authors used the nonexpansiveness of gradient mapping to develop uniform stability bounds for SGD to optimize convex , strongly convex and even non-convex objective functions . This inspired some interesting work on stochastic optimization . An interesting data-dependent stability bound was developed for SGD , a nice property of which is that it shows how the initialization would affect generalization ( Kuzborskij & Lampert , 2018 ) . These stability bounds were integrated into a PAC-Bayesian analysis of SGD , yielding generalization bounds for arbitrary posterior distributions ( London , 2017 ) . Almost optimal generalization bounds were developed for differentially private stochastic convex optimization ( Bassily et al. , 2019 ) . The onaverage variance of stochastic gradients was used to refine the generalization analysis of SGD ( Hardt et al. , 2016 ) in non-convex optimization ( Zhou et al. , 2018b ) . The uniform stability was also studied for SGD implemented in a stagewise manner ( Yuan et al. , 2019 ) and stochastic gradient Langevin dynamics in a non-convex setting ( Li et al. , 2020 ; Mou et al. , 2018 ) . Very recently , the discussions in Hardt et al . ( 2016 ) were extended to tackle non-smooth ( Lei & Ying , 2020 ; Bassily et al. , 2020 ) and non-Lipscthiz functions ( Lei & Ying , 2020 ) . The most related work is Charles & Papailiopoulos ( 2018 ) , where some general hypothesis stability bounds were developed for learning algorithms that converge to optima . A very interesting point is that their bounds depend only on the convergence of the algorithm to a global minimum and the geometry of loss functions around the global minimum . However , their discussion imply at best the slow generalization bounds O ( 1/ √ nβ ) for β-gradientdominated objective functions , and can not explain the benefit of low optimization errors in helping generalization . The underlying reason is that they used the pointwise hypothesis stability and did not consider the smoothness of loss functions . We aim to improve these results by leveraging the weaker on-average stability and smoothness of loss functions . Other than the stability approach , there is interesting generalization analysis of SGD based on either a uniform convergence approach ( Lin et al. , 2016 ) , an integral operator approach ( Lin & Rosasco , 2017 ; Ying & Pontil , 2008 ; Dieuleveut & Bach , 2016 ; Dieuleveut et al. , 2017 ; Mücke et al. , 2019 ) or an information-theoretic approach ( Xu & Raginsky , 2017 ; Negrea et al. , 2019 ; Bu et al. , 2020 ) . 3 MAIN RESULTS . Let ρ be a probability measure defined on a sample spaceZ = X×Y withX ⊆ Rd andY ⊆ R , from which a training dataset S = { z1 , . . . , zn } is drawn independently and identically . The aim is to find a good model w from a model parameter spaceW based on the training dataset S. The performance of a prescribed model w on a single example z can be measured by a nonnegative loss function f ( w ; z ) , where f : W ×Z 7→ R+ . In machine learning we often apply an ( randomized ) algorithm A : ∪nZn 7→ W to S to produce an output modelA ( S ) ∈ W . Oftentimes , the constructed model w would have a small empirical risk FS ( w ) = 1n ∑n i=1 f ( w ; zi ) . However , we are mostly interested in the generalization performance of a model w on testing examples measured by the population ( true ) risk F ( w ) = Ez [ f ( w ; z ) ] , where Ez denotes the expectation with respect to ( w.r.t . ) z . The gap ES , A [ F ( A ( S ) ) −FS ( A ( S ) ) ] between the population risk and empirical risk is called the estimation error , which is due to the approximation of ρ by sampling . Here EA denotes the expectation w.r.t . the randomness of the algorithm A . For example , if A is SGD , then EA denotes the expectation w.r.t . the random indices of training examples selected for the gradient computation . A powerful tool to study the estimation error is the algorithmic stability ( Bousquet & Elisseeff , 2002 ; Elisseeff et al. , 2005 ; Shalev-Shwartz et al. , 2010 ; Hardt et al. , 2016 ) , which measures the sensitivity of the algorithm ’ s output w.r.t . the perturbation of a training dataset . Below we give formal definitions of stability measures , whose connection to generalization is established in Theorem A.1 . Definition 1 ( Uniform Stability ) . A randomized algorithmA has uniform stability if for all datasets S , S̃ ∈ Zn that differ by at most one example , we have supz EA [ f ( A ( S ) ; z ) − f ( A ( S̃ ) ; z ) ] ≤ . The following on-average stability is similar to the average-RO stability in Shalev-Shwartz et al . ( 2010 ) . The difference is we do not use an absolute value . Form ∈ N , we denote [ m ] = { 1 , . . . , m } . Definition 2 ( On-average Stability ) . Let S = { z1 , . . . , zn } and S̃ = { z̃1 , . . . , z̃n } be drawn independently from ρ . For each i ∈ [ n ] , denote S ( i ) = { z1 , . . . , zi−1 , z̃i , zi+1 , . . . , zn } . We say an algorithm A has on-average stability if 1n ∑n i=1 ES , S̃ , A [ f ( A ( S ( i ) ) ; zi ) − f ( A ( S ) ; zi ) ] ≤ . In this paper , we are interested in the excess generalization error F ( A ( S ) ) − F ( w∗ ) , where w∗ ∈ arg minw∈W F ( w ) is the best model with the least testing error ( population risk ) . For this purpose , we introduce some basic assumptions . A basic assumption in non-convex learning is the smoothness of loss functions ( Ghadimi & Lan , 2013 ; Karimi et al. , 2016 ) , meaning the gradients are Lipschitz continuous . Let ‖ · ‖2 denote the Euclidean norm and∇ denote the gradient operator . Assumption 1 ( Smoothness Assumption ) . We assume for all z ∈ Z , the differentiable function w 7→ f ( w ; z ) is L-smooth , i.e. , ‖∇f ( w ; z ) −∇f ( w′ ; z ) ‖2 ≤ L‖w −w′‖2 for all w , w′ ∈ W . Another assumption is the Polyak-Lojasiewicz ( PL ) condition on the objective function , which is common in non-convex optimization ( Zhou et al. , 2018b ; Reddi et al. , 2016 ; Karimi et al. , 2016 ; Wang et al. , 2019 ; Lei et al. , 2017 ) , and was shown to hold true for deep ( linear ) and shallow neural networks ( Hardt & Ma , 2016 ; Charles & Papailiopoulos , 2018 ; Li & Yuan , 2017 ) . Assumption 2 ( Polyak-Lojasiewicz Condition ) . Denote F̂S = infw′∈W FS ( w′ ) . We assume FS satisfies PL or gradient-dominated condition ( in expectation ) with parameter β > 0 , i.e. , ES [ FS ( w ) − F̂S ] ≤ 1 2β ES [ ‖∇FS ( w ) ‖22 ] , ∀w ∈ W. ( 3.1 ) It is worthy of mentioning that our results in this section continue to hold if the global PL condition is relaxed to a local PL condition , i.e. , ( 3.1 ) holds for w in a neighborhood of the minimizer of FS . The existing stability analysis often imposes a bounded gradient assumption below ( Bousquet & Elisseeff , 2002 ; Hardt et al. , 2016 ; Charles & Papailiopoulos , 2018 ; Yuan et al. , 2019 ; Kuzborskij & Lampert , 2018 ) . Indeed , the resulting stability bounds depend on the uniform Lipschitz constant G ( see eq . ( 3.4 ) ) , which can be prohibitively large in practical models , e.g. , DNNs , or even infinite , e.g . least squares regression in an unbounded domain . Assumption 3 ( Bounded Gradient Assumption ) . We assume ‖∇f ( w ; z ) ‖2 ≤ G for all w ∈ W , z ∈ Z and a constant G > 0 . Our main result to be proved in Appendix B removes Assumption 3 and replaces the uniform Lipschitz constant G by the minimal empirical risk F̂S , which is significantly smaller than the Lipschitz constant . Note the assumption L ≤ nβ/4 is mild , and the previous generalization bounds become vacuous as O ( 1 ) ( Yuan et al. , 2019 ; Charles & Papailiopoulos , 2018 ) if this assumption is violated . Theorem 1 ( Main Theorem ) . Let Assumptions 1 , 2 hold and wS = A ( S ) . If L ≤ nβ/4 , then E [ F ( wS ) − F̂S ] ≤ 16LE [ F̂S ] nβ + LE [ FS ( wS ) − F̂S ] 2β . ( 3.2 ) An important implication is as follows . Since E [ F̂S ] ≤ E [ FS ( w ∗ ) ] = F ( w∗ ) and F̂S ≤ FS ( wS ) , Eq . ( 3.2 ) implies an upper bound on the excess generalization error E [ F ( wS ) ] − F ( w∗ ) and E [ F ( wS ) − FS ( wS ) ] = O ( 1 nβ + E [ FS ( wS ) − F̂S ] β ) . ( 3.3 ) The above two terms can be explained as follows . The term O ( 1/ ( nβ ) ) reflects the intrinsic complexity of the problem , while E [ FS ( wS ) − F̂S ] is called the optimization error . An interesting observation is that the overfitting phenomenon would never happen for learning under the PL condition ( analogous to learning with strongly convex objectives where the global minimizer generalizes well ( Bousquet & Elisseeff , 2002 ) ) . Indeed , if the optimization algorithm finds more and more accurate solutions , it achieves the limiting generalization bound O ( 1/ ( nβ ) ) . This shows an important message that optimization can be beneficial to generalization . This seemingly counterintuitive phenomenon is due to the implicit regularization enforced by the PL condition ( analogous to the strong convexity condition ) . Another notable property is that Theorem 1 applies to any algorithm . We can plug any known optimization error bounds into it to immediately get generalization bounds . Remark 1 . We show that our result significantly improves the existing stability analysis . The work ( Charles & Papailiopoulos , 2018 ) showed the pointwise hypothesis stability is controlled by 2G 2 nβ + 2 √ 2G √ E [ FS ( wS ) − F̂S ] /β , which together with the connection between stability and generalization ( cf . ( A.1 ) ) , implies with probability 1− δ that F ( wS ) ≤ FS ( wS ) + ( M2 nδ + 24MG2 nβδ + 24MG √ 2E [ FS ( wS ) − F̂S ] √ βδ ) 1 2 . ( 3.4 ) The above bound requires the bounded gradient assumption ‖∇f ( w ; z ) ‖2 ≤ G and the bounded loss assumption 0 ≤ f ( w ; z ) ≤ M for all w ∈ W and z ∈ Z , which are successfully removed in our generalization analysis . Furthermore , our generalization bound significantly improves ( 3.4 ) . Indeed , assume E [ FS ( wS ) − F̂S ] ≤ 2β for some > 0 , then ( 3.3 ) implies E [ F ( wS ) ] = E [ FS ( wS ) ] +O ( 1 nβ + 2 ) , ( 3.5 ) while ( 3.4 ) becomes F ( wS ) = FS ( wS ) +O ( 1√ nβ + √ ) . To achieve the generalization guarantee O ( 1/ √ nβ ) , the above bound requires the optimization accuracy = O ( 1/ ( nβ ) ) , while our bound ( 3.5 ) only requires the accuracy = O ( 1/ √ nβ ) but gets the significantly better generalization bound 1/ ( nβ ) . We actually develop a better stability bound . Specifically , the pointwise hypothesis stability is bounded by O ( 1 nβ + ) in Charles & Papailiopoulos ( 2018 ) while we show that the on- average stability is bounded by O ( 1 nβ + 2 ) , which is significantly tighter if 1nβ ≤ ≤ 1 ( ignoring constant factors ) . It should be mentioned that Charles & Papailiopoulos ( 2018 ) did not impose a smoothness assumption . However , the smoothness assumption is widely used in non-convex optimization to derive meaningful rates ( Ghadimi & Lan , 2013 ) . As compared to probabilistic bounds in Charles & Papailiopoulos ( 2018 ) , our bounds are stated in expectation . The extension to highprobability bounds will lead to additional O ( 1/ √ n ) term ( Feldman & Vondrak , 2019 ) . Remark 2 ( Bounded gradient assumption ) . Very recently , the bounded gradient assumption was also removed for the stability analysis ( Lei & Ying , 2020 ) . However , their analysis considered SGD applied to convex loss functions . As a comparison , we study stability and generalization in a nonconvex learning setting , and our analysis applies to any stochastic optimization algorithms . Remark 3 . If A is ERM , Theorem 1 immediately implies E [ F ( wS ) − F̂S ] ≤ 16Lnβ E [ F̂S ] . If FS is β-strongly convex and L < nβ/2 , it was shown for ERM that E [ F ( wS ) − F̂S ] ≤ 48Lnβ E [ F̂S ] ( Shalev-Shwartz & Ben-David , 2014 , Corollary 13.7 ) . Their result is extended here from a strongly convex setting to a gradient-dominated setting , and from the particular ERM to any algorithm . As a direct corollary , we can derive the following optimistic bound in the interpolation setting , which is the most intriguing case for over-parameterized or highly expressive DNN models . Corollary 2 . Let Assumptions 1 , 2 hold and wS = A ( S ) . If E [ F̂S ] = 0 and L < nβ/2 , then E [ F ( wS ) ] ≤ L2βE [ FS ( wS ) ] . Remark 4 . Corollary 2 shows a benefit of interpolation in boosting the generalization by achieving a generalization bound O ( ) for any > 0 if we minimize FS sufficiently well . This benefit can not be explained by the existing discussions ( Hardt et al. , 2016 ; Charles & Papailiopoulos , 2018 ) as they imply the same generalization bound O ( 1/ √ nβ ) in the interpolation setting . Although it was observed that interpolation helps in training ( Bassily et al. , 2018 ; Vaswani et al. , 2019 ; Ma et al. , 2018 ; Oymak & Soltanolkotabi , 2020 ; Allen-Zhu et al. , 2019 ; Zou et al. , 2018 ) , it is still largely unclear , as indicated in Ma et al . ( 2018 ) , that how interpolation helps in generalization . Corollary 2 shows new insights on how interpolation from highly expressive models helps generalization . We now move on to the discussion on the critical assumption in Corollary 2 , i.e . L < nβ/2 . According to the proof , the two parameters L and β can be replaced by their local counterparts , i.e. , the smoothness and PL condition related to a particular minimizer w′ of FS ( i ) ( Eqs . ( B.6 ) , ( B.7 ) ) . For example , β can be replaced by 12‖∇FS ( w ′ ) ‖22/ ( FS ( w′ ) − F̂S ) , which can be larger than β . Below are some examples on explaining L/β < n/2 . As we will see , the quantity L/β reflects the complexity of the problem ( related to condition number as shown in Examples 1 , 2 ) . Therefore , the condition L/β < n/2 imposes implicitly a constraint on the complexity of the problems . This explains why the optimization algorithm would never overfit when applied to gradient-dominated objective functions if L/β < n/2 , as shown in Theorem 1 . Example 1 . Let φ : Rd 7→ Rm be a feature map , and ` : R×R 7→ R+ be a loss function which isL ` smooth and σ ` -strongly convex w.r.t . the first argument . Consider f ( w ; z ) = ` ( 〈w , φ ( xi ) 〉 , yi ) with 〈· , ·〉 being an inner product . Then , FS satisfies the PL condition with the parameter σ′min ( ΣS ) σ ` , where ΣS = 1n ∑n i=1 φ ( xi ) φ ( xi ) > is the empirical covariance matrix , A > denotes the transpose of a matrix A and σ′min ( A ) means the minimal non-zero singular value of A . The empirical counterpart ( we have an expectation w.r.t . S in PL condition ) of L/β is of the order of σmax ( ΣS ) /σ′min ( ΣS ) , where σmax ( A ) means the maximal singular value ( we give details in Appendix E.1 ) . Example 2 . Consider neural networks with a single hidden layer with d inputs , m hidden neurons and a single output neuron , for which the prediction function takes the form hv , w =∑m k=1 vkφ ( 〈wk , x〉 ) . Here wk ∈ Rd and vk ∈ R denote the weight of the edges connecting the k-th hidden node to the input and output node , respectively , while φ : R 7→ R is the activation function . Analogous to Arora et al . ( 2019 ) ; Oymak & Soltanolkotabi ( 2020 ) , we fix v = ( v1 , . . . , vm ) > with |vk| = a for some a > 0 and train w = ( w1 , w2 , . . . , wm ) > ∈ Rm×d from S. The loss function then takes the form f ( w ; z ) = ( v > φ ( wx ) −y ) 2 . If we consider the identity activation function , i.e. , φ ( t ) = t , then FS satisfies the PL condition with the parameter σmin ( ΣS ) , where σmin ( A ) denotes the minimal singular value of A and ΣS = 1n ∑n i=1 xix > i . The empirical counterpart of L/β is of the order of σmax ( ΣS ) /σmin ( ΣS ) ( we give details in Appendix E.2 for a general activation function ) . It is possible to get generalization bounds under some other conditions . Since one-point strong convexity condition together with smoothness assumption implies the PL condition ( Yuan et al. , 2019 ) , all our results apply to one-point strongly convex functions . We can also get generalization bounds for objective functions satisfying the quadratic growth condition ( Necoara et al. , 2018 ) , which is weaker than the PL condition . However , we need to impose a realizability condition which was also imposed in Charles & Papailiopoulos ( 2018 ) . The proof of Theorem 3 is given in Section C. Let w ( S ) denote the Euclidean projection of w onto the set of global minimizers of FS inW . Definition 3 ( Quadratic Growth Condition ) . We say FS : W 7→ R satisfies the quadratic growth condition ( in expectation ) with parameter β if E [ FS ( w ) −F̂S ] ≥ β2E [ ‖w−w ( S ) ‖22 ] for all w ∈ W . Theorem 3 . Let Assumption 1 hold and FS satisfy the quadratic growth condition with parameter β . If the problem is realizable , i.e. , E [ F̂S ] = 0 and L ≤ nβ/4 , then E [ F ( wS ) ] ≤ 2Lβ−1E [ FS ( wS ) ] . Finally , we consider any optimization algorithms applied to gradient-dominated and Lipschitz continuous functions . We do not require loss functions to be smooth here . It shows that the excess generalization bound can decay as fast as O ( 1/ ( nβ ) ) if we solve the optimization problem to a sufficient accuracy , which is much better than the generalization bound O ( 1/ √ nβ ) in Charles & Papailiopoulos ( 2018 ) . Recall the analysis in Charles & Papailiopoulos ( 2018 ) requires Assumptions 2 , 3 and a further assumption on boundedness of loss functions . The proof is given in Section C. Theorem 4 . Let Assumptions 2 , 3 hold and wS = A ( S ) . Then the following inequality holds E [ F ( wS ) − F̂S ] ≤ 2G 2 nβ + G ( E [ FS ( wS ) − F̂S ] ) 1 2 √ 2β .
This paper mainly studies the generalization performance of stochastic algorithms. Compared with previous results which rely on Lipschitz condition, this paper assumes smoothness condition and Polyak-Lojasiewicz Condition, and then prove the excess generalization bound that is a summation of $\frac{1}{n\beta}$ and empirical optimization error. This result looks impressive, not only because the first term looks shaper than previous $\frac{1}{\sqrt{n}}$ of generalization bound , but also it implies optimization benefits generalization, which may help understand some empirical observations in modern machine learning. What's more, authors analyze some common stochastic algorithms as concrete examples to show the corresponding theoretical guarantee. Besides, the whole paper is well-written and easy to follow.
SP:8cbce41127c32edb148b2d6713f4ecec0efc6ff9
BASGD: Buffered Asynchronous SGD for Byzantine Learning
1 INTRODUCTION . Due to the wide application in cluster-based large-scale learning , federated learning ( Konevcnỳ et al. , 2016 ; Kairouz et al. , 2019 ) , edge computing ( Shi et al. , 2016 ) and so on , distributed learning has recently become a hot research topic ( Zinkevich et al. , 2010 ; Yang , 2013 ; Jaggi et al. , 2014 ; Shamir et al. , 2014 ; Zhang & Kwok , 2014 ; Ma et al. , 2015 ; Lee et al. , 2017 ; Lian et al. , 2017 ; Zhao et al. , 2017 ; Sun et al. , 2018 ; Wangni et al. , 2018 ; Zhao et al. , 2018 ; Zhou et al. , 2018 ; Yu et al. , 2019a ; b ; Haddadpour et al. , 2019 ) . Most traditional distributed learning methods are based on stochastic gradient descent ( SGD ) and its variants ( Bottou , 2010 ; Xiao , 2010 ; Duchi et al. , 2011 ; Johnson & Zhang , 2013 ; Shalev-Shwartz & Zhang , 2013 ; Zhang et al. , 2013 ; Lin et al. , 2014 ; Schmidt et al. , 2017 ; Zheng et al. , 2017 ; Zhao et al. , 2018 ) , and typically assume no failure or attack on workers . However , in real distributed learning applications with multiple networked machines ( nodes ) , different kinds of hardware or software failure may happen . Representative failure include bit-flipping in the communication media and the memory of some workers ( Xie et al. , 2019 ) . In this case , a small failure on some machines ( workers ) might cause a distributed learning method to fail . In addition , malicious attack should not be neglected in an open network where the manager ( or server ) generally has not much control on the workers , such as the cases of edge computing and federated learning . Some malicious workers may behave arbitrarily or even adversarially . Hence , Byzantine learning ( BL ) , which refers to distributed learning with failure or attack , has recently attracted much attention ( Diakonikolas et al. , 2017 ; Chen et al. , 2017 ; Blanchard et al. , 2017 ; Alistarh et al. , 2018 ; Damaskinos et al. , 2018 ; Xie et al. , 2019 ; Baruch et al. , 2019 ; Diakonikolas & Kane , 2019 ) . Existing BL methods can be divided into two main categories : synchronous BL ( SBL ) methods and asynchronous BL ( ABL ) methods . In SBL methods , the learning information , such as the gradient in SGD , of all workers will be aggregated in a synchronous way . On the contrary , in ABL methods the learning information of workers will be aggregated in an asynchronous way . Existing SBL methods mainly take two different ways to achieve resilience against Byzantine workers which refer to those workers with failure or attack . One way is to replace the simple averaging aggregation operation with some more robust aggregation operations , such as median and trimmed-mean ( Yin et al. , 2018 ) . Krum ( Blanchard et al. , 2017 ) and ByzantinePGD ( Yin et al. , 2019 ) take this way . The other way is to filter the suspicious learning information ( gradients ) before averaging . Representative examples include ByzantineSGD ( Alistarh et al. , 2018 ) and Zeno ( Xie et al. , 2019 ) . The advantage of SBL methods is that they are relatively simple and easy to be implemented . But SBL methods will result in slow convergence when there exist heterogeneous workers . Furthermore , in some applications like federated learning and edge computing , synchronization can not even be performed most of the time due to the offline workers ( clients or edge servers ) . Hence , ABL is preferred in these cases . To the best of our knowledge , there exist only two ABL methods : Kardam ( Damaskinos et al. , 2018 ) and Zeno++ ( Xie et al. , 2020 ) . Kardam introduces two filters to drop out suspicious learning information ( gradients ) , which can still achieve good performance when the communication delay is heavy . However , when in face of malicious attack , some work finds that Kardam also drops out most correct gradients in order to filter all faulty ( failure ) gradients . Hence , Kardam can not resist malicious attack ( Xie et al. , 2020 ) . Zeno++ scores each received gradient , and determines whether to accept it according to the score . But Zeno++ needs to store some training instances on server for scoring . In practical applications , storing data on server will increase the risk of privacy leakage or even face legal risk . Therefore , under the general setting where server has no access to any training instances , there have not existed ABL methods to resist malicious attack . In this paper , we propose a novel method , called buffered asynchronous stochastic gradient descent ( BASGD ) , for ABL . The main contributions of BASGD are listed as follows : • To the best of our knowledge , BASGD is the first ABL method that can resist malicious attack without storing any instances on server . Compared with those methods which need to store instances on server , BASGD takes less risk of privacy leakage . • BASGD is theoretically proved to be convergent , and be able to resist failure or attack . • Empirical results show that BASGD significantly outperforms vanilla ASGD and other ABL baselines when there exist failure or malicious attack on workers . In particular , BASGD can still converge under malicious attack , when ASGD and other ABL methods fail . 2 PRELIMINARY . This section presents the preliminary of this paper , including the distributed learning framework used in this paper and the definition of Byzantine worker . 2.1 DISTRIBUTED LEARNING FRAMEWORK . Many machine learning models , such as logistic regression and deep neural networks , can be formulated as the following finite sum optimization problem : min w∈Rd F ( w ) = 1 n n∑ i=1 f ( w ; zi ) , ( 1 ) where w is the parameter to learn , d is the dimension of parameter , n is the number of training instances , f ( w ; zi ) is the empirical loss on the training instance zi . The goal of distributed learning is to solve the problem in ( 1 ) by designing learning algorithms based on multiple networked machines . Although there have appeared many distributed learning frameworks , in this paper we focus on the widely used Parameter Server ( PS ) framework ( Li et al. , 2014 ) . In a PS framework , there are several workers and one or more servers . Each worker can only communicate with server ( s ) . There may exist more than one server in a PS framework , but for the problem of this paper servers can be logically conceived as a unity . Without loss of generality , we will assume there is only one server in this paper . Training instances are disjointedly distributed across m workers . Let Dk denote the index set of training instances on worker k , we have ∪mk=1Dk = { 1 , 2 , . . . , n } and Dk ∩ Dk′ = ∅ if k 6= k′ . In this paper , we assume that server has no access to any training instances . If two instances have the same value , they are still deemed as two distinct instances . Namely , zi may equal zi′ ( i 6= i′ ) . One popular asynchronous method to solve the problem in ( 1 ) under the PS framework is ASGD ( Dean et al. , 2012 ) ( see Algorithm 1 in Appendix A ) . In this paper , we assume each worker samples one instance for gradient computation each time , and do not separately discuss the mini-batch case . In PS based ASGD , server is responsible for updating and maintaining the latest parameter . The number of iterations that server has already executed is used as the global logical clock of server . At the beginning , iteration number t = 0 . Each time a SGD step is executed , t will increase by 1 immediately . The parameter after t iterations is denoted as wt . If server sends parameters to worker k at iteration t′ , some SGD steps may have been excuted before server receives gradient from worker k next time at iteration t. Thus , we define the delay of worker k at iteration t as τ tk = t− t′ . Worker k is heavily delayed at iteration t if τ tk > τmax , where τmax is a pre-defined non-negative constant . 2.2 BYZANTINE WORKER . For workers that have sent gradients ( one or more ) to server at iteration t , we call worker k loyal worker if it has finished all the tasks without any fault and each sent gradient is correctly received by the server . Otherwise , worker k is called Byzantine worker . If worker k is a Byzantine worker , it means the received gradient from worker k is not credible , which can be an arbitrary value . In ASGD , there is one received gradient at a time . Formally , we denote the gradient received from worker k at iteration t as gtk . Then , we have : gtk = { ∇f ( wt ′ ; zi ) , if worker k is loyal at iteration t ; arbitrary value , if worker k is Byzantine at iteration t , where 0 ≤ t′ ≤ t , and i is randomly sampled from Dk . Our definition of Byzantine worker is consistent with most previous works ( Blanchard et al. , 2017 ; Xie et al. , 2019 ; 2020 ) . Either accidental failure or malicious attack will result in Byzantine workers . 3 BUFFERED ASYNCHRONOUS SGD . In synchronous BL , gradients from all workers are received at each iteration . During this process , we can compare the gradients with each other , and then filter suspicious ones , or use more robust aggregation rules such as median and trimmed-mean for updating . However , in asynchronous BL , only one gradient is received by the server at a time . Without any training instances stored on server , it is difficult for server to identify whether a received gradient is credible or not . In order to deal with this problem in asynchronous BL , we propose a novel method called buffered asynchronous SGD ( BASGD ) . BASGD introduces B buffers ( 0 < B ≤ m ) on server , and the gradient used for updating parameters will be aggregated from these buffers . The detail of the learning procedure of BASGD is presented in Algorithm 2 in Appendix A . In this section , we will introduce the details of the two key components of BASGD : buffer and aggregation function . 3.1 BUFFER . In BASGD , the m workers do the same job as that in ASGD , while the updating rule on server is modified . More specifically , there are B buffers ( 0 < B ≤ m ) on server . When a gradient g from worker s is received , it will be temporarily stored in buffer b , where b = s mod B , as illustrated in Figure 1 . Only when each buffer has stored at least one gradient , a new SGD step will be executed . Please note that no matter whether a SGD step is executed or not , the server will immediately send the latest parameters back to the worker after receiving a gradient . Hence , BASGD introduces no barrier , and is an asynchronous algorithm . For each buffer b , more than one gradient may have been received at iteration t. We will store the average of these gradients ( denoted by hb ) in buffer b . Assume that there are already ( N − 1 ) gradients g1 , g2 , . . . , gN−1 which should be stored in buffer b , and hb ( old ) = 1N−1 ∑N−1 i=1 gi . When the N -th gradient gN is received , the new average value in buffer b should be : hb ( new ) = 1 N ∑N i=1 gi = N−1 N · hb ( old ) + 1 N · gN . This is the updating rule for each buffer b when a gradient is received . We use N tb to denote the total number of gradients stored in buffer b at the t-th iteration . After the parameter w is updated , all buffers will be zeroed out at once . With the benefit of buffers , server has access to B candidate gradients when updating parameter . Thus , a more reliable ( robust ) gradient can be aggregated from the B gradients of buffers , if a proper aggregation function Aggr ( · ) is chosen .
The paper proposes a practical asynchronous stochastic gradient descent for Byzantine distributed learning where some of transmitted gradients are likely to be replaced by arbitrary vectors. Specifically, the server temporarily stores gradients on multiple (namely $B$) buffers and performs a proper robust aggregation to compute a more robust from them. When $B = 1$, BASGD is reduced to ASGD. They also conduct experiments to show the performance of BASGD.
SP:28b164b471496b8f4c07128fa107df88a9dac3e9
BASGD: Buffered Asynchronous SGD for Byzantine Learning
1 INTRODUCTION . Due to the wide application in cluster-based large-scale learning , federated learning ( Konevcnỳ et al. , 2016 ; Kairouz et al. , 2019 ) , edge computing ( Shi et al. , 2016 ) and so on , distributed learning has recently become a hot research topic ( Zinkevich et al. , 2010 ; Yang , 2013 ; Jaggi et al. , 2014 ; Shamir et al. , 2014 ; Zhang & Kwok , 2014 ; Ma et al. , 2015 ; Lee et al. , 2017 ; Lian et al. , 2017 ; Zhao et al. , 2017 ; Sun et al. , 2018 ; Wangni et al. , 2018 ; Zhao et al. , 2018 ; Zhou et al. , 2018 ; Yu et al. , 2019a ; b ; Haddadpour et al. , 2019 ) . Most traditional distributed learning methods are based on stochastic gradient descent ( SGD ) and its variants ( Bottou , 2010 ; Xiao , 2010 ; Duchi et al. , 2011 ; Johnson & Zhang , 2013 ; Shalev-Shwartz & Zhang , 2013 ; Zhang et al. , 2013 ; Lin et al. , 2014 ; Schmidt et al. , 2017 ; Zheng et al. , 2017 ; Zhao et al. , 2018 ) , and typically assume no failure or attack on workers . However , in real distributed learning applications with multiple networked machines ( nodes ) , different kinds of hardware or software failure may happen . Representative failure include bit-flipping in the communication media and the memory of some workers ( Xie et al. , 2019 ) . In this case , a small failure on some machines ( workers ) might cause a distributed learning method to fail . In addition , malicious attack should not be neglected in an open network where the manager ( or server ) generally has not much control on the workers , such as the cases of edge computing and federated learning . Some malicious workers may behave arbitrarily or even adversarially . Hence , Byzantine learning ( BL ) , which refers to distributed learning with failure or attack , has recently attracted much attention ( Diakonikolas et al. , 2017 ; Chen et al. , 2017 ; Blanchard et al. , 2017 ; Alistarh et al. , 2018 ; Damaskinos et al. , 2018 ; Xie et al. , 2019 ; Baruch et al. , 2019 ; Diakonikolas & Kane , 2019 ) . Existing BL methods can be divided into two main categories : synchronous BL ( SBL ) methods and asynchronous BL ( ABL ) methods . In SBL methods , the learning information , such as the gradient in SGD , of all workers will be aggregated in a synchronous way . On the contrary , in ABL methods the learning information of workers will be aggregated in an asynchronous way . Existing SBL methods mainly take two different ways to achieve resilience against Byzantine workers which refer to those workers with failure or attack . One way is to replace the simple averaging aggregation operation with some more robust aggregation operations , such as median and trimmed-mean ( Yin et al. , 2018 ) . Krum ( Blanchard et al. , 2017 ) and ByzantinePGD ( Yin et al. , 2019 ) take this way . The other way is to filter the suspicious learning information ( gradients ) before averaging . Representative examples include ByzantineSGD ( Alistarh et al. , 2018 ) and Zeno ( Xie et al. , 2019 ) . The advantage of SBL methods is that they are relatively simple and easy to be implemented . But SBL methods will result in slow convergence when there exist heterogeneous workers . Furthermore , in some applications like federated learning and edge computing , synchronization can not even be performed most of the time due to the offline workers ( clients or edge servers ) . Hence , ABL is preferred in these cases . To the best of our knowledge , there exist only two ABL methods : Kardam ( Damaskinos et al. , 2018 ) and Zeno++ ( Xie et al. , 2020 ) . Kardam introduces two filters to drop out suspicious learning information ( gradients ) , which can still achieve good performance when the communication delay is heavy . However , when in face of malicious attack , some work finds that Kardam also drops out most correct gradients in order to filter all faulty ( failure ) gradients . Hence , Kardam can not resist malicious attack ( Xie et al. , 2020 ) . Zeno++ scores each received gradient , and determines whether to accept it according to the score . But Zeno++ needs to store some training instances on server for scoring . In practical applications , storing data on server will increase the risk of privacy leakage or even face legal risk . Therefore , under the general setting where server has no access to any training instances , there have not existed ABL methods to resist malicious attack . In this paper , we propose a novel method , called buffered asynchronous stochastic gradient descent ( BASGD ) , for ABL . The main contributions of BASGD are listed as follows : • To the best of our knowledge , BASGD is the first ABL method that can resist malicious attack without storing any instances on server . Compared with those methods which need to store instances on server , BASGD takes less risk of privacy leakage . • BASGD is theoretically proved to be convergent , and be able to resist failure or attack . • Empirical results show that BASGD significantly outperforms vanilla ASGD and other ABL baselines when there exist failure or malicious attack on workers . In particular , BASGD can still converge under malicious attack , when ASGD and other ABL methods fail . 2 PRELIMINARY . This section presents the preliminary of this paper , including the distributed learning framework used in this paper and the definition of Byzantine worker . 2.1 DISTRIBUTED LEARNING FRAMEWORK . Many machine learning models , such as logistic regression and deep neural networks , can be formulated as the following finite sum optimization problem : min w∈Rd F ( w ) = 1 n n∑ i=1 f ( w ; zi ) , ( 1 ) where w is the parameter to learn , d is the dimension of parameter , n is the number of training instances , f ( w ; zi ) is the empirical loss on the training instance zi . The goal of distributed learning is to solve the problem in ( 1 ) by designing learning algorithms based on multiple networked machines . Although there have appeared many distributed learning frameworks , in this paper we focus on the widely used Parameter Server ( PS ) framework ( Li et al. , 2014 ) . In a PS framework , there are several workers and one or more servers . Each worker can only communicate with server ( s ) . There may exist more than one server in a PS framework , but for the problem of this paper servers can be logically conceived as a unity . Without loss of generality , we will assume there is only one server in this paper . Training instances are disjointedly distributed across m workers . Let Dk denote the index set of training instances on worker k , we have ∪mk=1Dk = { 1 , 2 , . . . , n } and Dk ∩ Dk′ = ∅ if k 6= k′ . In this paper , we assume that server has no access to any training instances . If two instances have the same value , they are still deemed as two distinct instances . Namely , zi may equal zi′ ( i 6= i′ ) . One popular asynchronous method to solve the problem in ( 1 ) under the PS framework is ASGD ( Dean et al. , 2012 ) ( see Algorithm 1 in Appendix A ) . In this paper , we assume each worker samples one instance for gradient computation each time , and do not separately discuss the mini-batch case . In PS based ASGD , server is responsible for updating and maintaining the latest parameter . The number of iterations that server has already executed is used as the global logical clock of server . At the beginning , iteration number t = 0 . Each time a SGD step is executed , t will increase by 1 immediately . The parameter after t iterations is denoted as wt . If server sends parameters to worker k at iteration t′ , some SGD steps may have been excuted before server receives gradient from worker k next time at iteration t. Thus , we define the delay of worker k at iteration t as τ tk = t− t′ . Worker k is heavily delayed at iteration t if τ tk > τmax , where τmax is a pre-defined non-negative constant . 2.2 BYZANTINE WORKER . For workers that have sent gradients ( one or more ) to server at iteration t , we call worker k loyal worker if it has finished all the tasks without any fault and each sent gradient is correctly received by the server . Otherwise , worker k is called Byzantine worker . If worker k is a Byzantine worker , it means the received gradient from worker k is not credible , which can be an arbitrary value . In ASGD , there is one received gradient at a time . Formally , we denote the gradient received from worker k at iteration t as gtk . Then , we have : gtk = { ∇f ( wt ′ ; zi ) , if worker k is loyal at iteration t ; arbitrary value , if worker k is Byzantine at iteration t , where 0 ≤ t′ ≤ t , and i is randomly sampled from Dk . Our definition of Byzantine worker is consistent with most previous works ( Blanchard et al. , 2017 ; Xie et al. , 2019 ; 2020 ) . Either accidental failure or malicious attack will result in Byzantine workers . 3 BUFFERED ASYNCHRONOUS SGD . In synchronous BL , gradients from all workers are received at each iteration . During this process , we can compare the gradients with each other , and then filter suspicious ones , or use more robust aggregation rules such as median and trimmed-mean for updating . However , in asynchronous BL , only one gradient is received by the server at a time . Without any training instances stored on server , it is difficult for server to identify whether a received gradient is credible or not . In order to deal with this problem in asynchronous BL , we propose a novel method called buffered asynchronous SGD ( BASGD ) . BASGD introduces B buffers ( 0 < B ≤ m ) on server , and the gradient used for updating parameters will be aggregated from these buffers . The detail of the learning procedure of BASGD is presented in Algorithm 2 in Appendix A . In this section , we will introduce the details of the two key components of BASGD : buffer and aggregation function . 3.1 BUFFER . In BASGD , the m workers do the same job as that in ASGD , while the updating rule on server is modified . More specifically , there are B buffers ( 0 < B ≤ m ) on server . When a gradient g from worker s is received , it will be temporarily stored in buffer b , where b = s mod B , as illustrated in Figure 1 . Only when each buffer has stored at least one gradient , a new SGD step will be executed . Please note that no matter whether a SGD step is executed or not , the server will immediately send the latest parameters back to the worker after receiving a gradient . Hence , BASGD introduces no barrier , and is an asynchronous algorithm . For each buffer b , more than one gradient may have been received at iteration t. We will store the average of these gradients ( denoted by hb ) in buffer b . Assume that there are already ( N − 1 ) gradients g1 , g2 , . . . , gN−1 which should be stored in buffer b , and hb ( old ) = 1N−1 ∑N−1 i=1 gi . When the N -th gradient gN is received , the new average value in buffer b should be : hb ( new ) = 1 N ∑N i=1 gi = N−1 N · hb ( old ) + 1 N · gN . This is the updating rule for each buffer b when a gradient is received . We use N tb to denote the total number of gradients stored in buffer b at the t-th iteration . After the parameter w is updated , all buffers will be zeroed out at once . With the benefit of buffers , server has access to B candidate gradients when updating parameter . Thus , a more reliable ( robust ) gradient can be aggregated from the B gradients of buffers , if a proper aggregation function Aggr ( · ) is chosen .
Review: This paper proposes BASGD which uses buffers to perform asynchronous Byzantine learning. In each SGD step, all workers compute gradients and send them to the server where their ad buffer is updated. When all of the buffers are updated, the server performs an model update. When a worker send a gradient to the server, it also pulls the latest model and compute the gradient on it no matter the server update the model or not. The main contribution in this paper is to introduce a new approach to do asynchronous Byzantine learning without storing training samples on the server like zeno++.
SP:28b164b471496b8f4c07128fa107df88a9dac3e9
What Preserves the Emergence of Language?
1 INTRODUCTION . Unveiling the principles behind the emergence and evolution of language is attractive and appealing to all . It is believed that this research field is of great significance for promoting the development of enabling agents to evolve an efficient communication protocol ( Nowak & Krakauer , 1999 ; Kottur et al. , 2017 ; Chaabouni et al. , 2019 ) or acquire existing one ( Li & Bowling , 2019 ) , especially when interacting with humans . Previously , many studies have investigated some intriguing properties of language and their effects on the emergence of language ( Andreas & Klein , 2017 ; Lazaridou et al. , 2018 ; Mordatch & Abbeel , 2018 ) . The motivation behind these is that human language is considered as a remarkable degree of structure and complexity ( Givon , 2013 ) and each character is the result of evolution , thus they believe that understanding the language itself is an indispensable step to take . Unlike existing work , we , from a different perspective , focus on a fundamental question that what made the emergence of language possible during evolution . One of the dominant theories in the community of emergent communication is : cooperation boosts language to emerge ( Nowak & Krakauer , 1999 ; Cao et al. , 2018 ) . Hence , there has been a surge of work investigating this field in cooperative multi-agent ( mostly two agents ) referential games ( Lazaridou & Peysakhovich , 2017 ; Kottur et al. , 2017 ; Das et al. , 2017 ; Evtimova et al. , 2018 ; Lazaridou et al. , 2018 ) , a variant of the Lewis signaling game ( David , 1969 ) . However , they seem to miss some basic elements in the human language . On one hand , human language emerges from the community , not just two persons , after all , language is learnable and can spread from one place to other ( Dagan et al. , 2020 ) . Studying a language in two-player games is like looking at the world through a keyhole . On the other hand , many works make an agreement that prior to the emergence of language some pre-adaptations occurred in the hominid lineage , and one of the candidates is the ability to use symbols ( Deacon , 2003 ; Davidson , 2003 ; Christiansen & Kirby , 2003 ) . It seems understanding the emergence of symbolic signals is the key to approach the truth of the origin of language ( Deacon , 1998 ) . However , chimpanzees have demonstrated a degree of language capacity by using arbitrary symbols as well as the ability for the cross-modal association , abstract thought , and displacement of thought in time ( Meddin , 1979 ) . So why don ’ t they have a language like us ? One of the theory is selfishness has kept animal communication at a minimum ( Ulbaek , 1998 ) . In more detail , if an individual can obtain a higher benefit by deceiving the other party in the cooperation , why not deceive ? Once deception emerges , mistrust among individuals will haunt . For those who are cheated , once bitten and twice shy , cooperation will no longer be a good option . As a result , motivation for communication , as well as demands of the emergence of language will perish . But human beings are so special since we have overcome this kind of obstacle and evolved language . Then , what preserves the emergence of language ? We aim to answer this question in a brand new framework of agent community , reinforcement learning ( RL ) , and natural selection . We believe this process should occur in the pre-language period since lying is possible as long as agents can communicate . Therefore , our investigating communication protocol uses symbols to transmit meaning based on a social convention or implicit agreement . In this paper , we introduce several agents to form one community and allow natural evolution and elimination among them . Both liars ( agents tell lies ) and truth tellers ( agents always tell truth ) exist in the community . Each tournament , every agent is supposed to play a non-cooperative game ( Nash Jr , 1950 ; Nash , 1951 ; Schelling , 1958 ; Binmore et al. , 1986 ; Von Neumann & Morgenstern , 2007 ) with others . In our multi-round bargaining game , agents are required to reach an agreement about how many items to give out so that the total quantity can satisfy the market ’ s demand and they can keep their loss to the minimum in the meantime . We believe this is a perfect fit for the nature of human beings and more common in the hominid lineage compared with the cooperation game . Importantly , during the process of natural selection , the fraction of liars and truth tellers may change from time to time and this allows us to observe what factor imposes influence on the motivation of communication , which is the prerequisite of the emergence of language . It is worthy of note that pre-language communication was subject to the constraints of Darwinian evolution . While linguistic change , which began in the post-language communicative era of hominid evolution , is by and large tied to society and culture ( Givón & Malle , 2002 ; Li & Hombert , 2002 ) . Thus , we disregard the factors related to linguistic change since we are investigating motivation for communication from which language evolved . Moreover , apart from the normal setting mentioned above , we add up two more rules to further dig out . Firstly , we introduce a credit mechanism for truth tellers . In other words , we make sure truth tellers know the existence of liars which is one step in the evolution process . Specifically , every liar has credit in the mind of truth teller , and the credit varies with the profit of truth teller . Cooperation would be impossible between two agents as soon as the credit drops to negative . Secondly , an additional penalty will be brought in as a price of lying , and we consider it as social pressure for resisting lying behaviors . All in all , we want to make a thorough investigation about how the individual or social resistance to lying affects communication . Empirically , we show that in normal settings , two truth tellers can make a fair agreement , and liars can achieve a huge advantage over truth teller by telling lies . As for two liars , there is always a better liar that gains relative more than the other . In the credit setting , liars can learn a sophisticated lying strategy that deceives the credit mechanism and makes more profits meanwhile . In both settings , as time goes on , truth tellers seem not to show enough competition against liars and thus die out . In the society setting , we find out liars are afraid of lying if punishment is sufficiently large . This again proves the theory ( Ulbaek , 1998 ) : in the human lineage , social cooperation based on obligatory reciprocal altruism ( Trivers , 1971 ) as well as a system which punishes people morally and physically for cheating has evolved . In such an environment language is finally possible . 2 EXPERIMENTAL FRAMEWORK . 2.1 GAME SETTINGS . We explore emergent language in the context of multi-round non-cooperative bargaining game ( Nash Jr , 1950 ; Nash , 1951 ) as illustrated in Figure 1 . The core is binding cooperative strategy with the highest profit is impossible whereas selfish strategy sometimes can . In this case , the behavior of telling lies can be meaningful since it undermines cooperation and grabs more benefits from others . In the game , two agents i , j bargain over how to satisfy the demand of market . Agents are presented with N different items . They possess a fixed number of quantity for each item ( { qin } Nn=1 , { qjn } Nn=1 ) , and have their own hidden utilities for N items ( { uin } Nn=1 , { ujn } Nn=1 ) . Agents move sequentially . Suppose at bargaining round t , it is turn for agent i to be proposer and it makes proposal { pit , n } Nn=1 about how many to give out to the market , which means the other agent j should contribute the rest { dn − pit , n } Nn=1 to the market , where dn is the market demand for item n. Then agent j would choose to accept the proposal or not . The game will be terminated when they make an agreement about the proposal or the number of bargaining rounds reaches the upper limit Tmax , and agents i and j will receive rewards ∑N n=1 ( q i n − pit , n ) × uin and ∑N n=1 ( q j n − dn + pit , n ) × ujn respectively or get zero when no agreement has been made in the end . In order to make the reward comparable , it will be further normalized by the maximum reward achievable for each agent . Both agents want to keep as more items as possible rather than giving out . Therefore , agents are supposed to seek a tradeoff between keeping more items and satisfying the market demand . In this part , we illustrate how lying mechanism works , where lying means the proposal will not be followed by actions . Suppose agents i , j satisfy the market demand at round t , and agent j chooses to tell lies about the proposal and then gives nothing to the market . This leads to that the market will have demand gap which is { pjt , n } Nn=1 , and the market would force each agent to hand over half of the gap for remedy . It is noted that liars are allowed to tell lies about any items . In our settings , we conform to the principle of high risk and high return . To illustrate , when d1 = 10 agent j tells lies and keeps offering pjt,1 = 9 , agent i is definitely delightful and more likely to take d1 − p j t,1 = 1 . Although agent j can easily put others on the hook , it can not gain a large advantage since the final result is not much better than evenly contributing . On the contrary , if agent j takes pjt,1 = 1 , it allows agent j keeping more items and obtaining more profits . However , this proposal is less appealing to agent i . The key point is we want to link attractive lies to relatively lower profits . As agents take turns to play , first-mover has absolute advantages since the other one is compelled to accept unfair proposal or get nothing . We once tried to convert our bargaining game from moving alternately to moving simultaneously to solve this problem . In detail , two agents make proposals at the same time and their total quantity should surpass the demand . However , it turns out that agents only learn to evenly divide the market demand . In this setting , no agent can guarantee an agreement , therefore the proposal made by an agent could be more conservative , meaning it is hard for the agent to infer others ’ utilities during bargaining . Ultimately , we adopt the strategy ( Cao et al. , 2018 ) by randomly sampling Tmax between 4 and 10 to mitigate the first-mover effect .
This paper investigates conditions under which communities of cooperative agents are stable. Communities in multi-round bargaining games with evolutionary dynamics are evaluated in three main setups. The first imposes no restrictions on the agents' behavior and is shown to be easily invaded by deceitful agents. The second enables agents to refuse to bargain with deceitful agents. Nevertheless, such communities are shown to be invadable. Finally, in the third setup, a global punishment system is shown to be able to drive out deceitful invaders. The main take-home message is that, when lying is an option, agents(' communities) need to be prepared for it.
SP:e898ffa6bfdc1597ced0f9bd66c60ff9c6b4c383
What Preserves the Emergence of Language?
1 INTRODUCTION . Unveiling the principles behind the emergence and evolution of language is attractive and appealing to all . It is believed that this research field is of great significance for promoting the development of enabling agents to evolve an efficient communication protocol ( Nowak & Krakauer , 1999 ; Kottur et al. , 2017 ; Chaabouni et al. , 2019 ) or acquire existing one ( Li & Bowling , 2019 ) , especially when interacting with humans . Previously , many studies have investigated some intriguing properties of language and their effects on the emergence of language ( Andreas & Klein , 2017 ; Lazaridou et al. , 2018 ; Mordatch & Abbeel , 2018 ) . The motivation behind these is that human language is considered as a remarkable degree of structure and complexity ( Givon , 2013 ) and each character is the result of evolution , thus they believe that understanding the language itself is an indispensable step to take . Unlike existing work , we , from a different perspective , focus on a fundamental question that what made the emergence of language possible during evolution . One of the dominant theories in the community of emergent communication is : cooperation boosts language to emerge ( Nowak & Krakauer , 1999 ; Cao et al. , 2018 ) . Hence , there has been a surge of work investigating this field in cooperative multi-agent ( mostly two agents ) referential games ( Lazaridou & Peysakhovich , 2017 ; Kottur et al. , 2017 ; Das et al. , 2017 ; Evtimova et al. , 2018 ; Lazaridou et al. , 2018 ) , a variant of the Lewis signaling game ( David , 1969 ) . However , they seem to miss some basic elements in the human language . On one hand , human language emerges from the community , not just two persons , after all , language is learnable and can spread from one place to other ( Dagan et al. , 2020 ) . Studying a language in two-player games is like looking at the world through a keyhole . On the other hand , many works make an agreement that prior to the emergence of language some pre-adaptations occurred in the hominid lineage , and one of the candidates is the ability to use symbols ( Deacon , 2003 ; Davidson , 2003 ; Christiansen & Kirby , 2003 ) . It seems understanding the emergence of symbolic signals is the key to approach the truth of the origin of language ( Deacon , 1998 ) . However , chimpanzees have demonstrated a degree of language capacity by using arbitrary symbols as well as the ability for the cross-modal association , abstract thought , and displacement of thought in time ( Meddin , 1979 ) . So why don ’ t they have a language like us ? One of the theory is selfishness has kept animal communication at a minimum ( Ulbaek , 1998 ) . In more detail , if an individual can obtain a higher benefit by deceiving the other party in the cooperation , why not deceive ? Once deception emerges , mistrust among individuals will haunt . For those who are cheated , once bitten and twice shy , cooperation will no longer be a good option . As a result , motivation for communication , as well as demands of the emergence of language will perish . But human beings are so special since we have overcome this kind of obstacle and evolved language . Then , what preserves the emergence of language ? We aim to answer this question in a brand new framework of agent community , reinforcement learning ( RL ) , and natural selection . We believe this process should occur in the pre-language period since lying is possible as long as agents can communicate . Therefore , our investigating communication protocol uses symbols to transmit meaning based on a social convention or implicit agreement . In this paper , we introduce several agents to form one community and allow natural evolution and elimination among them . Both liars ( agents tell lies ) and truth tellers ( agents always tell truth ) exist in the community . Each tournament , every agent is supposed to play a non-cooperative game ( Nash Jr , 1950 ; Nash , 1951 ; Schelling , 1958 ; Binmore et al. , 1986 ; Von Neumann & Morgenstern , 2007 ) with others . In our multi-round bargaining game , agents are required to reach an agreement about how many items to give out so that the total quantity can satisfy the market ’ s demand and they can keep their loss to the minimum in the meantime . We believe this is a perfect fit for the nature of human beings and more common in the hominid lineage compared with the cooperation game . Importantly , during the process of natural selection , the fraction of liars and truth tellers may change from time to time and this allows us to observe what factor imposes influence on the motivation of communication , which is the prerequisite of the emergence of language . It is worthy of note that pre-language communication was subject to the constraints of Darwinian evolution . While linguistic change , which began in the post-language communicative era of hominid evolution , is by and large tied to society and culture ( Givón & Malle , 2002 ; Li & Hombert , 2002 ) . Thus , we disregard the factors related to linguistic change since we are investigating motivation for communication from which language evolved . Moreover , apart from the normal setting mentioned above , we add up two more rules to further dig out . Firstly , we introduce a credit mechanism for truth tellers . In other words , we make sure truth tellers know the existence of liars which is one step in the evolution process . Specifically , every liar has credit in the mind of truth teller , and the credit varies with the profit of truth teller . Cooperation would be impossible between two agents as soon as the credit drops to negative . Secondly , an additional penalty will be brought in as a price of lying , and we consider it as social pressure for resisting lying behaviors . All in all , we want to make a thorough investigation about how the individual or social resistance to lying affects communication . Empirically , we show that in normal settings , two truth tellers can make a fair agreement , and liars can achieve a huge advantage over truth teller by telling lies . As for two liars , there is always a better liar that gains relative more than the other . In the credit setting , liars can learn a sophisticated lying strategy that deceives the credit mechanism and makes more profits meanwhile . In both settings , as time goes on , truth tellers seem not to show enough competition against liars and thus die out . In the society setting , we find out liars are afraid of lying if punishment is sufficiently large . This again proves the theory ( Ulbaek , 1998 ) : in the human lineage , social cooperation based on obligatory reciprocal altruism ( Trivers , 1971 ) as well as a system which punishes people morally and physically for cheating has evolved . In such an environment language is finally possible . 2 EXPERIMENTAL FRAMEWORK . 2.1 GAME SETTINGS . We explore emergent language in the context of multi-round non-cooperative bargaining game ( Nash Jr , 1950 ; Nash , 1951 ) as illustrated in Figure 1 . The core is binding cooperative strategy with the highest profit is impossible whereas selfish strategy sometimes can . In this case , the behavior of telling lies can be meaningful since it undermines cooperation and grabs more benefits from others . In the game , two agents i , j bargain over how to satisfy the demand of market . Agents are presented with N different items . They possess a fixed number of quantity for each item ( { qin } Nn=1 , { qjn } Nn=1 ) , and have their own hidden utilities for N items ( { uin } Nn=1 , { ujn } Nn=1 ) . Agents move sequentially . Suppose at bargaining round t , it is turn for agent i to be proposer and it makes proposal { pit , n } Nn=1 about how many to give out to the market , which means the other agent j should contribute the rest { dn − pit , n } Nn=1 to the market , where dn is the market demand for item n. Then agent j would choose to accept the proposal or not . The game will be terminated when they make an agreement about the proposal or the number of bargaining rounds reaches the upper limit Tmax , and agents i and j will receive rewards ∑N n=1 ( q i n − pit , n ) × uin and ∑N n=1 ( q j n − dn + pit , n ) × ujn respectively or get zero when no agreement has been made in the end . In order to make the reward comparable , it will be further normalized by the maximum reward achievable for each agent . Both agents want to keep as more items as possible rather than giving out . Therefore , agents are supposed to seek a tradeoff between keeping more items and satisfying the market demand . In this part , we illustrate how lying mechanism works , where lying means the proposal will not be followed by actions . Suppose agents i , j satisfy the market demand at round t , and agent j chooses to tell lies about the proposal and then gives nothing to the market . This leads to that the market will have demand gap which is { pjt , n } Nn=1 , and the market would force each agent to hand over half of the gap for remedy . It is noted that liars are allowed to tell lies about any items . In our settings , we conform to the principle of high risk and high return . To illustrate , when d1 = 10 agent j tells lies and keeps offering pjt,1 = 9 , agent i is definitely delightful and more likely to take d1 − p j t,1 = 1 . Although agent j can easily put others on the hook , it can not gain a large advantage since the final result is not much better than evenly contributing . On the contrary , if agent j takes pjt,1 = 1 , it allows agent j keeping more items and obtaining more profits . However , this proposal is less appealing to agent i . The key point is we want to link attractive lies to relatively lower profits . As agents take turns to play , first-mover has absolute advantages since the other one is compelled to accept unfair proposal or get nothing . We once tried to convert our bargaining game from moving alternately to moving simultaneously to solve this problem . In detail , two agents make proposals at the same time and their total quantity should surpass the demand . However , it turns out that agents only learn to evenly divide the market demand . In this setting , no agent can guarantee an agreement , therefore the proposal made by an agent could be more conservative , meaning it is hard for the agent to infer others ’ utilities during bargaining . Ultimately , we adopt the strategy ( Cao et al. , 2018 ) by randomly sampling Tmax between 4 and 10 to mitigate the first-mover effect .
This paper attempts to address a question in the emergent communication literature: what preserves / maintains the stability of emerged communication protocols. The authors manipulate the prevalence of lying behavior in a community of agents playing a variant of a Nash bargaining game. The main take-away is that explicit punishment, from the environment and from truth-tellers not wanting to communicate with liars, can prevent the spread of exploitative lying behavior in the community.
SP:e898ffa6bfdc1597ced0f9bd66c60ff9c6b4c383
Towards Impartial Multi-task Learning
1 INTRODUCTION . Recent deep networks in computer vision can match or even surpass human beings on some specific tasks separately . However , in reality multiple tasks ( e.g. , semantic segmentation and depth estimation ) must be solved simultaneously . Multi-task learning ( MTL ) ( Caruana , 1997 ; Evgeniou & Pontil , 2004 ; Ruder , 2017 ; Zhang & Yang , 2017 ) aims at sharing the learned representation among tasks ( Zamir et al. , 2018 ) to make them benefit from each other and achieve better results and stronger robustness ( Zamir et al. , 2020 ) . However , sharing the representation can lead to a partial learning issue : some specific tasks are learned well while others are overlooked , due to the different loss scales or gradient magnitudes of various tasks and the mutual competition among them . Several methods have been proposed to mitigate this issue either via gradient balance such as gradient magnitude normalization ( Chen et al. , 2018 ) and Pareto optimality ( Sener & Koltun , 2018 ) , or loss balance like homoscedastic uncertainty ( Kendall et al. , 2018 ) . Gradient balance can evenly learn task-shared parameters while ignoring task-specific ones . Loss balance can prevent MTL from being biased in favor of tasks with large loss scales but can not ensure the impartial learning of the shared parameters . In this work , we find that gradient balance and loss balance are complementary , and combining the two balances can further improve the results . To this end , we propose impartial MTL ( IMTL ) via simultaneously balancing gradients and losses across tasks . For gradient balance , we propose IMTL-G ( rad ) to learn the scaling factors such that the aggregated gradient of task-shared parameters has equal projections onto the raw gradients of individual tasks ∗Corresponding author ( see Fig . 1 ( d ) ) . We show that the scaling factor optimization problem is equivalent to finding the angle bisector of gradients from all tasks in geometry , and derive a closed-form solution to it . In contrast with previous gradient balance methods such as GradNorm ( Chen et al. , 2018 ) , MGDA ( Sener & Koltun , 2018 ) and PCGrad ( Yu et al. , 2020 ) , which have learning biases in favor of tasks with gradients close to the average gradient direction , those with small gradient magnitudes , and those with large gradient magnitudes , respectively ( see Fig . 1 ( a ) , ( b ) and ( c ) ) , in our IMTL-G task-shared parameters can be updated without bias to any task . For loss balance , we propose IMTL-L ( oss ) to automatically learn a loss weighting parameter for each task so that the weighted losses have comparable scales and the effect of different loss scales from various tasks can be canceled-out . Compared with uncertainty weighting ( Kendall et al. , 2018 ) , which has biases towards regression tasks rather than classification tasks , our IMTL-L treats all tasks equivalently without any bias . Besides , we model the loss balance problem from the optimization perspective without any distribution assumption that is required by ( Kendall et al. , 2018 ) . Therefore , ours is more general and can be used in any kinds of losses . Moreover , the loss weighting parameters and the network parameters can be jointly learned in an end-to-end fashion in IMTL-L. Further , we find the above two balances are complementary and can be combined to improve the performance . Specifically , we apply IMTL-G on the task-shared parameters and IMTL-L on the task-specific parameters , leading to the hybrid balance method IMTL . Our IMTL is scale-invariant : the model can converge to similar results even when the same task is designed to have different loss scales , which is common in practice . For example , the scale of the cross-entropy loss in semantic segmentation may have different scales when using “ average ” or “ sum ” reduction over locations in the loss computation . We empirically validate that our IMTL is more robust against heavy loss scale changes than its competitors . Meanwhile , our IMTL only adds negligible computational overheads . We extensively evaluate our proposed IMTL on standard benchmarks : Cityscapes , NYUv2 and CelebA , where the experimental results show that IMTL achieves superior performances under all settings . Besides , considering there lacks a fair and practical benchmark for comparing MTL methods , we unify the experimental settings such as image resolution , data augmentation , network structure , learning rate and optimizer option . We re-implement and compare with the representative MTL methods in a unified framework , which will be publicly available . Our contributions are : • We propose a novel closed-form gradient balance method , which learns task-shared parameters without any task bias ; and we develop a general learnable loss balance method , where no distribution assumption is required and the scale parameters can be jointly trained with the network parameters . • We unveil that gradient balance and loss balance are complementary and accordingly propose a hybrid balance method to simultaneously balance gradients and losses . • We validate that our proposed IMTL is loss scale-invariant and is more robust against loss scale changes compared with its competitors , and we give in-depth theoretical and experimental analyses on its connections and differences with previous methods . • We extensively verify the effectiveness of our IMTL . For fair comparisons , a unified codebase will also be publicly available , where more practical settings are adopted and stronger performances are achieved compared with existing code-bases . 2 RELATED WORK . Recent advances in MTL mainly come from two aspects : network structure improvements and loss weighting developments . Network-structure methods based on soft parameter-sharing usually lead to high inference cost ( review in Appendix A ) . Loss weighting methods find loss weights to be multiplied on the raw losses for model optimization . They employ a hard parameter-sharing paradigm ( Ruder , 2017 ) , where several light-weight task-specific heads are attached upon the heavy-weight task-agnostic backbone . There are also efforts that learn to group tasks and branch the network in the middle layers ( Guo et al. , 2020 ; Standley et al. , 2020 ) , which try to achieve better accuracyefficiency trade-off and can be seen as semi-hard parameter-sharing . We believe task grouping and loss weighting are orthogonal and complementary directions to facilitate multi-task learning and can benefit from each other . In this work we focus on loss weighting methods which are the most economic as almost all of the computations are shared across tasks , leading to high inference speed . Task Prioritization ( Guo et al. , 2018 ) weights task losses by their difficulties to focus on the harder tasks during training . Uncertainty weighting ( Kendall et al. , 2018 ) models the loss weights as dataagnostic task-dependent homoscedastic uncertainty . Then loss weighting is derived from maximum likelihood estimation . GradNorm ( Chen et al. , 2018 ) learns the loss weights to enforce the norm of the scaled gradient for each task to be close . MGDA ( Sener & Koltun , 2018 ) casts multi-task learning as multi-object optimization and finds the minimum-norm point in the convex hull composed by the gradients of multiple tasks . Pareto optimality is supposed to be achieved under mild conditions . GLS ( Chennupati et al. , 2019 ) instead uses the geometric mean of task-specific losses as the target loss , we will show it actually weights the loss by its reciprocal value . PCGrad ( Yu et al. , 2020 ) avoids interferences between tasks by projecting the gradient of one task onto the normal plane of the other . DSG ( Lu et al. , 2020 ) dynamically makes a task “ stop or go ” by its converging state , where a task is updated only once for a while if it is stopped . Although many loss weighting methods have been proposed , they are seldom open-sourced and rarely compared thoroughly under practical settings where strong performances are achieved , which motivates us to give an in-depth analysis and a fair comparison about them . 3 IMPARTIAL MULTI-TASK LEARNING . In MTL , we map a sample x ∈ X to its labels { yt ∈ Yt } t∈ [ 1 , T ] of all T tasks through multiple taskspecific mappings { ft : X→ Yt } . In most loss weighting methods , the hard parameter-sharing paradigm is employed , such that ft is parameterized by heavy-weight task-shared parameters θ and light-weight task-specific parameters θt . All tasks take the same shared intermediate feature z = f ( x ; θ ) as input , and the t-th task head outputs the prediction as ft ( x ) = ft ( z ; θt ) . We aim to find the scaling factors { αt } for all T task losses { Lt ( ft ( x ) , yt ) } , so that the weighted sum loss L = ∑ t αtLt can be optimized to make all tasks perform well . This poses great challenges because : 1 ) losses may have distinguished forms such as cross-entropy loss and cosine similarity ; 2 ) the dynamic ranges of losses may differ by orders of magnitude . In this work , we propose a hybrid solution for both the task-shared parameters θ and the task-specific parameters { θt } , as Fig . 2 . 3.1 GRADIENT BALANCE : IMTL-G For task-shared parameters θ , we can receive T gradients { gt = ∇θLt } via back-propagation from all of the T raw losses { Lt } , and these gradients represent optimal update directions for individual tasks . As the parameters θ can only be updated with a single gradient , we should compute an aggregated gradient g by the linear combination of { gt } . It also implies to find the scaling factors { αt } of raw losses { Lt } , since g = ∑ t αtgt = ∇θL = ∇θ ( ∑ t αtLt ) . Motivated by the principle of balance among tasks , we propose to make the projections of g onto { gt } to be equal , as Fig . 1 ( d ) . In this way , Algorithm 1 Training by Impartial Multi-task Learning Input : input sample x , task-specific labels { yt } and learning rate η Output : task-shared/-specific parameters θ/ { θt } , scale parameters { st } 1 : compute task-shared feature z = f ( x ; θ ) 2 : for t = 1 to T do 3 : compute task prediction by head network ft ( x ) = fnett ( z ; θt ) 4 : compute raw loss by loss function Lrawt = Lfunct ( ft ( x ) , yt ) 5 : compute scaled loss Lt = bastLrawt − st ( default a = e , b = 1 ) . loss balance 6 : compute gradient of shared feature z : gt = ∇zLt 7 : compute unit-norm gradient ut = gt‖gt‖ 8 : end for 9 : compute gradient differencesD > = [ g > 1 − g > 2 , · · · , g > 1 − g > T ] 10 : compute unit-norm gradient differences U > = [ u > 1 − u > 2 , · · · , u > 1 − u > T ] 11 : compute scaling factors for tasks 2 to T : α2 : T = g1U > ( DU > ) −1 . gradient balance 12 : compute scaling factors for all tasks : α = [ 1− 1α > 2 : T , α2 : T ] 13 : update task-shared parameters θ = θ − η∇θ ( ∑ t αtLt ) 14 : for t = 1 to T do 15 : update task-specific parameters θt = θt − η∇θtLt 16 : update loss scale parameter st = st − η ∂Lt∂st 17 : end for we treat all tasks equally so that they progress in the same speed and none is left behind . Formally , let { ut = gt/ ‖gt‖ } denote the unit-norm vector of { gt } which are row vectors , then we have : gu > 1 = gu > t ⇔ g ( u1 − ut ) > = 0 , ∀ 2 6 t 6 T. ( 1 ) The above problem is under-determined , but we can obtain the closed-form results of { αt } by constraining ∑ t αt = 1 . Assume α = [ α2 , · · · , αT ] , U > = [ u > 1 − u > 2 , · · · , u > 1 − u > T ] , D > = [ g > 1 − g > 2 , · · · , g > 1 − g > T ] and 1 = [ 1 , · · · , 1 ] , from Eq . ( 1 ) we can obtain : α = g1U > ( DU > ) −1 . ( IMTL-G ) ( 2 ) The detailed derivation is in Appendix B.1 . After obtaining α , the scaling factor of the first task can be computed by α1 = 1 − 1α > since ∑ t αt = 1 . The optimized { αt } are used to compute L =∑ t αtLt , which is ultimately minimized by SGD to update the model . By now , back-propagation needs to be executed T times to obtain the gradient of each task loss with respect to the heavy-weight task-shared parameters θ , which is time-consuming and non-scalable . We replace the parameterlevel gradients { gt = ∇θLt } with feature-level gradients { ∇zLt } to compute { αt } . This implies to achieve gradient balance with respect to the last shared feature z as a surrogate of task-shared parameters θ , since it is possible for the network to back-propagate this balance all the way through the task-shared backbone starting from z . This relaxation allows us to do back propagation through the backbone only once after obtaining { αt } , and thus the training time can be dramatically reduced .
This paper presents a satisfying solution to the open problem of how to train all tasks at approximately the same rate in multi-task learning. There has been a bunch of work on this problem in the last few years. This paper characterizes existing work w.r.t. the fairness of training across tasks in order to motivate two new methods, one applied to shared parameters and the other to task-specific parameters, which overcome the shortcomings of previous methods. The two new methods can be naturally combined to yield a complete method for fair training. Experiments on common MTL benchmarks show the new method compares quite favorably to previous approaches.
SP:c3bdf7ffa026668d98d241b72ee14e2a3510a7d9
Towards Impartial Multi-task Learning
1 INTRODUCTION . Recent deep networks in computer vision can match or even surpass human beings on some specific tasks separately . However , in reality multiple tasks ( e.g. , semantic segmentation and depth estimation ) must be solved simultaneously . Multi-task learning ( MTL ) ( Caruana , 1997 ; Evgeniou & Pontil , 2004 ; Ruder , 2017 ; Zhang & Yang , 2017 ) aims at sharing the learned representation among tasks ( Zamir et al. , 2018 ) to make them benefit from each other and achieve better results and stronger robustness ( Zamir et al. , 2020 ) . However , sharing the representation can lead to a partial learning issue : some specific tasks are learned well while others are overlooked , due to the different loss scales or gradient magnitudes of various tasks and the mutual competition among them . Several methods have been proposed to mitigate this issue either via gradient balance such as gradient magnitude normalization ( Chen et al. , 2018 ) and Pareto optimality ( Sener & Koltun , 2018 ) , or loss balance like homoscedastic uncertainty ( Kendall et al. , 2018 ) . Gradient balance can evenly learn task-shared parameters while ignoring task-specific ones . Loss balance can prevent MTL from being biased in favor of tasks with large loss scales but can not ensure the impartial learning of the shared parameters . In this work , we find that gradient balance and loss balance are complementary , and combining the two balances can further improve the results . To this end , we propose impartial MTL ( IMTL ) via simultaneously balancing gradients and losses across tasks . For gradient balance , we propose IMTL-G ( rad ) to learn the scaling factors such that the aggregated gradient of task-shared parameters has equal projections onto the raw gradients of individual tasks ∗Corresponding author ( see Fig . 1 ( d ) ) . We show that the scaling factor optimization problem is equivalent to finding the angle bisector of gradients from all tasks in geometry , and derive a closed-form solution to it . In contrast with previous gradient balance methods such as GradNorm ( Chen et al. , 2018 ) , MGDA ( Sener & Koltun , 2018 ) and PCGrad ( Yu et al. , 2020 ) , which have learning biases in favor of tasks with gradients close to the average gradient direction , those with small gradient magnitudes , and those with large gradient magnitudes , respectively ( see Fig . 1 ( a ) , ( b ) and ( c ) ) , in our IMTL-G task-shared parameters can be updated without bias to any task . For loss balance , we propose IMTL-L ( oss ) to automatically learn a loss weighting parameter for each task so that the weighted losses have comparable scales and the effect of different loss scales from various tasks can be canceled-out . Compared with uncertainty weighting ( Kendall et al. , 2018 ) , which has biases towards regression tasks rather than classification tasks , our IMTL-L treats all tasks equivalently without any bias . Besides , we model the loss balance problem from the optimization perspective without any distribution assumption that is required by ( Kendall et al. , 2018 ) . Therefore , ours is more general and can be used in any kinds of losses . Moreover , the loss weighting parameters and the network parameters can be jointly learned in an end-to-end fashion in IMTL-L. Further , we find the above two balances are complementary and can be combined to improve the performance . Specifically , we apply IMTL-G on the task-shared parameters and IMTL-L on the task-specific parameters , leading to the hybrid balance method IMTL . Our IMTL is scale-invariant : the model can converge to similar results even when the same task is designed to have different loss scales , which is common in practice . For example , the scale of the cross-entropy loss in semantic segmentation may have different scales when using “ average ” or “ sum ” reduction over locations in the loss computation . We empirically validate that our IMTL is more robust against heavy loss scale changes than its competitors . Meanwhile , our IMTL only adds negligible computational overheads . We extensively evaluate our proposed IMTL on standard benchmarks : Cityscapes , NYUv2 and CelebA , where the experimental results show that IMTL achieves superior performances under all settings . Besides , considering there lacks a fair and practical benchmark for comparing MTL methods , we unify the experimental settings such as image resolution , data augmentation , network structure , learning rate and optimizer option . We re-implement and compare with the representative MTL methods in a unified framework , which will be publicly available . Our contributions are : • We propose a novel closed-form gradient balance method , which learns task-shared parameters without any task bias ; and we develop a general learnable loss balance method , where no distribution assumption is required and the scale parameters can be jointly trained with the network parameters . • We unveil that gradient balance and loss balance are complementary and accordingly propose a hybrid balance method to simultaneously balance gradients and losses . • We validate that our proposed IMTL is loss scale-invariant and is more robust against loss scale changes compared with its competitors , and we give in-depth theoretical and experimental analyses on its connections and differences with previous methods . • We extensively verify the effectiveness of our IMTL . For fair comparisons , a unified codebase will also be publicly available , where more practical settings are adopted and stronger performances are achieved compared with existing code-bases . 2 RELATED WORK . Recent advances in MTL mainly come from two aspects : network structure improvements and loss weighting developments . Network-structure methods based on soft parameter-sharing usually lead to high inference cost ( review in Appendix A ) . Loss weighting methods find loss weights to be multiplied on the raw losses for model optimization . They employ a hard parameter-sharing paradigm ( Ruder , 2017 ) , where several light-weight task-specific heads are attached upon the heavy-weight task-agnostic backbone . There are also efforts that learn to group tasks and branch the network in the middle layers ( Guo et al. , 2020 ; Standley et al. , 2020 ) , which try to achieve better accuracyefficiency trade-off and can be seen as semi-hard parameter-sharing . We believe task grouping and loss weighting are orthogonal and complementary directions to facilitate multi-task learning and can benefit from each other . In this work we focus on loss weighting methods which are the most economic as almost all of the computations are shared across tasks , leading to high inference speed . Task Prioritization ( Guo et al. , 2018 ) weights task losses by their difficulties to focus on the harder tasks during training . Uncertainty weighting ( Kendall et al. , 2018 ) models the loss weights as dataagnostic task-dependent homoscedastic uncertainty . Then loss weighting is derived from maximum likelihood estimation . GradNorm ( Chen et al. , 2018 ) learns the loss weights to enforce the norm of the scaled gradient for each task to be close . MGDA ( Sener & Koltun , 2018 ) casts multi-task learning as multi-object optimization and finds the minimum-norm point in the convex hull composed by the gradients of multiple tasks . Pareto optimality is supposed to be achieved under mild conditions . GLS ( Chennupati et al. , 2019 ) instead uses the geometric mean of task-specific losses as the target loss , we will show it actually weights the loss by its reciprocal value . PCGrad ( Yu et al. , 2020 ) avoids interferences between tasks by projecting the gradient of one task onto the normal plane of the other . DSG ( Lu et al. , 2020 ) dynamically makes a task “ stop or go ” by its converging state , where a task is updated only once for a while if it is stopped . Although many loss weighting methods have been proposed , they are seldom open-sourced and rarely compared thoroughly under practical settings where strong performances are achieved , which motivates us to give an in-depth analysis and a fair comparison about them . 3 IMPARTIAL MULTI-TASK LEARNING . In MTL , we map a sample x ∈ X to its labels { yt ∈ Yt } t∈ [ 1 , T ] of all T tasks through multiple taskspecific mappings { ft : X→ Yt } . In most loss weighting methods , the hard parameter-sharing paradigm is employed , such that ft is parameterized by heavy-weight task-shared parameters θ and light-weight task-specific parameters θt . All tasks take the same shared intermediate feature z = f ( x ; θ ) as input , and the t-th task head outputs the prediction as ft ( x ) = ft ( z ; θt ) . We aim to find the scaling factors { αt } for all T task losses { Lt ( ft ( x ) , yt ) } , so that the weighted sum loss L = ∑ t αtLt can be optimized to make all tasks perform well . This poses great challenges because : 1 ) losses may have distinguished forms such as cross-entropy loss and cosine similarity ; 2 ) the dynamic ranges of losses may differ by orders of magnitude . In this work , we propose a hybrid solution for both the task-shared parameters θ and the task-specific parameters { θt } , as Fig . 2 . 3.1 GRADIENT BALANCE : IMTL-G For task-shared parameters θ , we can receive T gradients { gt = ∇θLt } via back-propagation from all of the T raw losses { Lt } , and these gradients represent optimal update directions for individual tasks . As the parameters θ can only be updated with a single gradient , we should compute an aggregated gradient g by the linear combination of { gt } . It also implies to find the scaling factors { αt } of raw losses { Lt } , since g = ∑ t αtgt = ∇θL = ∇θ ( ∑ t αtLt ) . Motivated by the principle of balance among tasks , we propose to make the projections of g onto { gt } to be equal , as Fig . 1 ( d ) . In this way , Algorithm 1 Training by Impartial Multi-task Learning Input : input sample x , task-specific labels { yt } and learning rate η Output : task-shared/-specific parameters θ/ { θt } , scale parameters { st } 1 : compute task-shared feature z = f ( x ; θ ) 2 : for t = 1 to T do 3 : compute task prediction by head network ft ( x ) = fnett ( z ; θt ) 4 : compute raw loss by loss function Lrawt = Lfunct ( ft ( x ) , yt ) 5 : compute scaled loss Lt = bastLrawt − st ( default a = e , b = 1 ) . loss balance 6 : compute gradient of shared feature z : gt = ∇zLt 7 : compute unit-norm gradient ut = gt‖gt‖ 8 : end for 9 : compute gradient differencesD > = [ g > 1 − g > 2 , · · · , g > 1 − g > T ] 10 : compute unit-norm gradient differences U > = [ u > 1 − u > 2 , · · · , u > 1 − u > T ] 11 : compute scaling factors for tasks 2 to T : α2 : T = g1U > ( DU > ) −1 . gradient balance 12 : compute scaling factors for all tasks : α = [ 1− 1α > 2 : T , α2 : T ] 13 : update task-shared parameters θ = θ − η∇θ ( ∑ t αtLt ) 14 : for t = 1 to T do 15 : update task-specific parameters θt = θt − η∇θtLt 16 : update loss scale parameter st = st − η ∂Lt∂st 17 : end for we treat all tasks equally so that they progress in the same speed and none is left behind . Formally , let { ut = gt/ ‖gt‖ } denote the unit-norm vector of { gt } which are row vectors , then we have : gu > 1 = gu > t ⇔ g ( u1 − ut ) > = 0 , ∀ 2 6 t 6 T. ( 1 ) The above problem is under-determined , but we can obtain the closed-form results of { αt } by constraining ∑ t αt = 1 . Assume α = [ α2 , · · · , αT ] , U > = [ u > 1 − u > 2 , · · · , u > 1 − u > T ] , D > = [ g > 1 − g > 2 , · · · , g > 1 − g > T ] and 1 = [ 1 , · · · , 1 ] , from Eq . ( 1 ) we can obtain : α = g1U > ( DU > ) −1 . ( IMTL-G ) ( 2 ) The detailed derivation is in Appendix B.1 . After obtaining α , the scaling factor of the first task can be computed by α1 = 1 − 1α > since ∑ t αt = 1 . The optimized { αt } are used to compute L =∑ t αtLt , which is ultimately minimized by SGD to update the model . By now , back-propagation needs to be executed T times to obtain the gradient of each task loss with respect to the heavy-weight task-shared parameters θ , which is time-consuming and non-scalable . We replace the parameterlevel gradients { gt = ∇θLt } with feature-level gradients { ∇zLt } to compute { αt } . This implies to achieve gradient balance with respect to the last shared feature z as a surrogate of task-shared parameters θ , since it is possible for the network to back-propagate this balance all the way through the task-shared backbone starting from z . This relaxation allows us to do back propagation through the backbone only once after obtaining { αt } , and thus the training time can be dramatically reduced .
The authors propose to balance multi-task training using IMTL-G on the shared backbone and IMTL-L on the task-specific branches. IMTL-G enforces equal gradient projections between tasks with a close-form formulation to calculate the desired gradient weightings $\alpha$. IMTL-L learns the loss weightings $e^s$ with a regularization term $-s$. Additional constraint by making all loss weightings sum to one is used. The paper compares the effectiveness of the proposed IMTLs with their counterparts on Cityscapes, NYUv2, and CelebA and claims state-of-the-art performance.
SP:c3bdf7ffa026668d98d241b72ee14e2a3510a7d9
Uncertainty-aware Active Learning for Optimal Bayesian Classifier
For pool-based active learning , in each iteration a candidate training sample is chosen for labeling by optimizing an acquisition function . In Bayesian classification , expected Loss Reduction ( ELR ) methods maximize the expected reduction in the classification error given a new labeled candidate based on a one-step-lookahead strategy . ELR is the optimal strategy with a single query ; however , since such myopic strategies can not identify the long-term effect of a query on the classification error , ELR may get stuck before reaching the optimal classifier . In this paper , inspired by the mean objective cost of uncertainty ( MOCU ) , a metric quantifying the uncertainty directly affecting the classification error , we propose an acquisition function based on a weighted form of MOCU . Similar to ELR , the proposed method focuses on the reduction of the uncertainty that pertains to the classification error . But unlike any other existing scheme , it provides the critical advantage that the resulting Bayesian active learning algorithm guarantees convergence to the optimal classifier of the true model . We demonstrate its performance with both synthetic and real-world datasets . 1 INTRODUCTION . In supervised learning , labeling data is often expensive and highly time consuming . Active learning is one field of research that aims to address this problem and has been demonstrated for sampleefficient learning with less required labeled data ( Gal et al. , 2017 ; Tran et al. , 2019 ; Sinha et al. , 2019 ) . In this paper , we focus on pool-based Bayesian active learning for classification with 0- 1 loss function . Bayesian active learning starts from the prior knowledge of uncertain models . By optimizing an acquisition function , it chooses the next candidate training sample to query for labeling , and then based on the acquired data , updates the belief of uncertain models through Bayes ’ rule to approach the optimal classifier of the true model , which minimizes the classification error . In active learning , maximizing the performance of the model trained on queried candidates is the ultimate objective . However , most of the existing methods do not directly target the learning objective . For example , Maximum Entropy Sampling ( MES ) or Uncertainty Sampling , simply queries the candidate with the maximum predictive entropy ( Lewis & Gale , 1994 ; Sebastiani & Wynn , 2000 ; Mussmann & Liang , 2018 ) ; but the method fails to differentiate between the model uncertainty and the observation uncertainty . Bayesian Active Learning by Disagreement ( BALD ) seeks the data point that maximizes the mutual information between the observation and the model parameters ( Houlsby et al. , 2011 ; Kirsch et al. , 2019 ) . Besides BALD , there are also other methods reducing the model uncertainty in different forms ( Golovin et al. , 2010 ; Cuong et al. , 2013 ) . However , not all the model uncertainty will affect the performance of the learning task of interest . Without identifying whether the uncertainty is related to the classification error or not , these methods can be inefficient in the sense that it may query candidates that do not directly help improve prediction performance . In this paper we focus on the active learning methods directly maximizing the learning model performance . There exist such active learning methods by Expected Loss Reduction ( ELR ) that aim to maximize the expected reduction in loss based on a one-step-look-ahead manner ( Roy & McCallum , 2001 ; Zhu et al. , 2003 ; Kapoor et al. , 2007 ) . The ELR methods can focus on only the uncertainty related to the loss function to achieve sample-efficient learning . In fact , ELR is the optimal strategy for active learning with a single query ( Roy & McCallum , 2001 ) . However , a critical shortcoming of previous ELR schemes is that none of them provide any theoretical guarantee regarding their longterm performance . In fact , since these methods are myopic and can not identify the long-term effect of a query on the loss functions , without special design on the loss function , they may get stuck before reaching the optimal classifier . To the best of our knowledge , there is currently no method that directly maximizes the model performance while simultaneously guaranteeing the convergence to the optimal classifier . Fig . 1a provides an example of binary classification with one feature where both BALD and ELR methods fail . In the figure , the red lines indicate the upper and lower bounds of the prediction probability of class 1 , illustrating the model with higher probability uncertainty on the sides ( x → ±4 ) than that in the middle ( x = 0 ) . Querying candidates on the sides will provide more information of the model parameters , and therefore is preferred in BALD . However , since the possible probabilities on the sides are always larger than or less than 0.5 , querying candidates on the sides will not help reduce the classification error . On the other hand , ELR queries candidates that help reduce the classification error the most , so it prefers data in the middle whose optimal labels are uncertain given the prior knowledge . The performance shown in Fig . 1b agrees with our analysis . Fig . 1b shows the performance averaged over 1000 runs , with more details and discussions of the example included in Appendix C. BALD performs inefficiently at the beginning by querying points on both sides . On the other hand , the ELR method performs the best at the beginning , but becomes inefficient after some iterations ( ∼100 ) , indicating some of its runs get stuck before reaching the optimal classifier . In this paper , we consider the algorithm to “ get stuck ” when the acquisition function value is 0 for all the candidates in the pool and the algorithm degenerates to uniform random sampling . In this paper , we analyze the reason why ELR methods may get stuck before reaching the optimal classifier , and propose a new strategy to solve this problem . Our contributions are in four parts : 1 . We show that ELR methods may get stuck , preventing active learning from reaching the optimal classifier efficiently . 2 . We propose a novel weighted-MOCU active learning method that can focus only on the uncertainty related to the loss for efficient active learning and is guaranteed to converge to the optimal classifier of the true model . 3 . We provide the convergence proof of the weightedMOCU method . 4 . We demonstrate the sample-efficiency of our weighted-MOCU method with both synthetic and real-world datasets . 2 BACKGROUND . Optimal Bayesian classifier . Consider a classification problem with candidates x ∈ X and class labels y ∈ Y = { 0 , 1 , . . . , M − 1 } . The predictive probability p ( y|x , θ ) is modeled with parameters θ . Assume θ is uncertain with a distribution π ( θ ) within the uncertainty class Θ . The classification problem is to find a classifier ψ : X → Y , which assigns a predicted class label to a given candidate . The expected 0-1 loss of the classifier ψ for a candidate x , dependent on θ , is defined as Cθ ( ψ , x ) , which can be derived to be the classification error : Cθ ( ψ , x ) = 1 − p ( y = ψ ( x ) |x , θ ) . The optimal classifier with θ , ψθ is defined as the classifier minimizing the classification error : ψθ ( x ) = arg maxy p ( y|x , θ ) . So we have : Cθ ( ψθ , x ) = minψ Cθ ( ψ , x ) = miny { 1− p ( y|x , θ ) } . When there is model uncertainty with π ( θ ) , an Optimal Bayesian Classifier ( OBC ) ψπ ( θ ) is the classifier that has the minimum expected loss over π ( θ ) ( Dalton & Dougherty , 2013 ) : Eπ ( θ ) [ Cθ ( ψπ ( θ ) , x ) ] = min ψ Eπ ( θ ) [ Cθ ( ψ , x ) ] = min y { 1− p ( y|x ) } ( 1 ) where p ( y|x ) = Eπ ( θ ) [ p ( y|x , θ ) ] is the predictive distribution . It ’ s easily to see ψπ ( θ ) ( x ) = arg maxy p ( y|x ) . Active learning . Active learning collects the training dataset D in a sequential way . For poolbased active learning , in each iteration , we choose a candidate x from the set of potential training samples X to query for the class label by optimizing an acquisition function U ( x ) . Then , in the Bayesian setting , by including the observed data pair ( x , y ) to D , we update the posterior distribution based on Bayes ’ rule . In each iteration , the acquisition function depends on the posterior distribution of model parameters π ( θ|D ) . In the following discussion , to simplify notations , we omit D from the notations and use π ( θ ) and p ( y|x ) to respectively denote the posterior and predictive distributions conditioned on D. When a new observed data point is included , the distributions are updated by Bayes ’ rule and the total probability rule as : π ( θ|x , y ) = π ( θ ) p ( y|x , θ ) p ( y|x ) and p ( y′|x′ , x , y ) = Eπ ( θ|x , y ) [ p ( y′|x′ , θ ) ] . The acquisition function of ELR methods in the Bayesian setting can be defined by the expected OBC prediction error reduction after observing the new pair ( x , y ) ( Roy & McCallum , 2001 ) : UELR ( x ) = Ep ( x′ ) { Eπ ( θ ) [ Cθ ( ψπ ( θ ) , x′ ) ] − Ep ( y|x ) [ Eπ ( θ|x , y ) [ Cθ ( ψπ ( θ|x , y ) , x′ ) ] ] } , ( 2 ) where p ( x′ ) is the distribution over X , independent of θ and D. ELR methods assume that we use OBC as the classifier , and in each iteration we should choose the query that maximize the decrease in OBC prediction error . The first term in ( 2 ) is the OBC prediction error of ψπ ( θ ) , and the second term is the expected prediction error of ψπ ( θ|x , y ) , the one-step-look-ahead OBC , with respect to p ( y|x ) . In the following section , we analyze why this acquisition function is sample-efficient as it directly targets at classification error reduction while ignoring irrelevant uncertainty with respect to the learning task ; but it may get stuck before converging to the true optimal classifier ( optimal classifier of the true model ) . 3 MOCU-BASED ACTIVE LEARNING . 3.1 MEAN OBJECTIVE COST OF UNCERTAINTY . To analyze ELR methods , we borrow the idea of the Mean Objective Cost of Uncertainty ( MOCU ) for active learning with respect to the corresponding posterior π ( θ ) . MOCU is a general objectiveoriented uncertainty quantification framework ( Yoon et al. , 2013 ) . For active learning , MOCU can be defined as the expected loss difference between the OBC and the optimal classifier : M ( π ( θ ) ) = Ep ( x′ ) [ Eπ ( θ ) [ Cθ ( ψπ ( θ ) , x′ ) − Cθ ( ψθ , x′ ) ] ] ( 3 ) = Ep ( x′ ) [ min y′ { 1− p ( y′|x′ ) } − Eπ ( θ ) [ min y′ { 1− p ( y′|x′ , θ ) } ] ] . ( 4 ) The second line is derived by the definition of ψθ and ( 1 ) . The first term in ( 3 ) is the OBC error as the loss . In the second term , ψθ is the optimal classifier with a specific θ . For the terms inside the expectation operator , we have Cθ ( ψπ ( θ ) , x′ ) − Cθ ( ψθ , x′ ) ≥ 0 . Therefore , the second term in ( 3 ) is a lower bound of the OBC prediction error . MOCU captures the difference between the OBC error and its lower bound . When MOCU is 0 , the OBC converges to the true optimal classifier and we can not reduce the OBC prediction error further . In that case , we say that OBC has reached the true optimal classifier . As in ELR methods , we can define an acquisition function by the reduction of MOCU in a one-steplook-ahead manner : UMOCU ( x ; π ( θ ) ) =M ( π ( θ ) ) − Ep ( y|x ) [ M ( π ( θ|x , y ) ) ] . ( 5 ) We can show that the second term in ( 3 ) , the lower bound of the OBC error , is cancelled in ( 5 ) . The acquisition function ( 5 ) hence captures the expected reduction of the OBC error given new data and is equivalent to the ELR acquisition function ( 2 ) . Expanding the second term in ( 5 ) , we have : Ep ( y|x ) [ M ( π ( θ|x , y ) ) ] = Ep ( x′ ) { Ep ( y|x ) [ Eπ ( θ|x , y ) [ Cθ ( ψπ ( θ|x , y ) , x′ ) − Cθ ( ψθ , x′ ) ] ] } . ( 6 ) Since ∑ y p ( y|x ) π ( θ|x , y ) = π ( θ ) , as x is assumed to be independent of θ so that we have π ( θ|x ) = π ( θ ) , we can rewrite the first term in ( 5 ) as : M ( π ( θ ) ) = Ep ( x′ ) { Ep ( y|x ) [ Eπ ( θ|x , y ) [ Cθ ( ψπ ( θ ) , x′ ) − Cθ ( ψθ , x′ ) ] ] } . ( 7 ) Combining ( 6 ) and ( 7 ) and canceling the Cθ ( ψθ , x′ ) terms ( the lower bound of the OBC error ) , ( 6 ) can be derived as : UMOCU ( x ; π ( θ ) ) = Ep ( x′ ) { Ep ( y|x ) [ Eπ ( θ|x , y ) [ Cθ ( ψπ ( θ ) , x′ ) − Cθ ( ψπ ( θ|x , y ) , x′ ) ] ] } , ( 8 ) which is just the ELR acquisition function in ( 2 ) . Therefore , we can conclude that MOCU-based methods are equivalent to ELR methods . Another property we can observe from ( 8 ) is that UMOCU ( x ; π ( θ ) ) ≥ 0 . By definition , ψπ ( θ|x , y ) is the OBC with the minimum expected classification error over π ( θ|x , y ) . Therefore , Eπ ( θ|x , y ) [ Cθ ( ψπ ( θ|x , y ) , x′ ) ] ≤ Eπ ( θ|x , y ) [ Cθ ( ψπ ( θ ) , x′ ) ] and we have UMOCU ( x ; π ( θ ) ) ≥ 0 , indicating collecting new data will reduce MOCU .
This paper studies the label solicitation strategy in active learning. In particular, it focuses on the expected loss reduction (ELR) strategy, analyzes its problem, and modifies the original ELR method to make sure the active learner converges to the optimal classifier along learning iterations. The paper provides theoretical guarantees on the new method’s convergence. In the experiment, the proposed method is evaluated on synthetic data and UCI data. The improvement margin over the existing method is very limited.
SP:839f449191ae3ff1016d4321d9e1926c5f883a78
Uncertainty-aware Active Learning for Optimal Bayesian Classifier
For pool-based active learning , in each iteration a candidate training sample is chosen for labeling by optimizing an acquisition function . In Bayesian classification , expected Loss Reduction ( ELR ) methods maximize the expected reduction in the classification error given a new labeled candidate based on a one-step-lookahead strategy . ELR is the optimal strategy with a single query ; however , since such myopic strategies can not identify the long-term effect of a query on the classification error , ELR may get stuck before reaching the optimal classifier . In this paper , inspired by the mean objective cost of uncertainty ( MOCU ) , a metric quantifying the uncertainty directly affecting the classification error , we propose an acquisition function based on a weighted form of MOCU . Similar to ELR , the proposed method focuses on the reduction of the uncertainty that pertains to the classification error . But unlike any other existing scheme , it provides the critical advantage that the resulting Bayesian active learning algorithm guarantees convergence to the optimal classifier of the true model . We demonstrate its performance with both synthetic and real-world datasets . 1 INTRODUCTION . In supervised learning , labeling data is often expensive and highly time consuming . Active learning is one field of research that aims to address this problem and has been demonstrated for sampleefficient learning with less required labeled data ( Gal et al. , 2017 ; Tran et al. , 2019 ; Sinha et al. , 2019 ) . In this paper , we focus on pool-based Bayesian active learning for classification with 0- 1 loss function . Bayesian active learning starts from the prior knowledge of uncertain models . By optimizing an acquisition function , it chooses the next candidate training sample to query for labeling , and then based on the acquired data , updates the belief of uncertain models through Bayes ’ rule to approach the optimal classifier of the true model , which minimizes the classification error . In active learning , maximizing the performance of the model trained on queried candidates is the ultimate objective . However , most of the existing methods do not directly target the learning objective . For example , Maximum Entropy Sampling ( MES ) or Uncertainty Sampling , simply queries the candidate with the maximum predictive entropy ( Lewis & Gale , 1994 ; Sebastiani & Wynn , 2000 ; Mussmann & Liang , 2018 ) ; but the method fails to differentiate between the model uncertainty and the observation uncertainty . Bayesian Active Learning by Disagreement ( BALD ) seeks the data point that maximizes the mutual information between the observation and the model parameters ( Houlsby et al. , 2011 ; Kirsch et al. , 2019 ) . Besides BALD , there are also other methods reducing the model uncertainty in different forms ( Golovin et al. , 2010 ; Cuong et al. , 2013 ) . However , not all the model uncertainty will affect the performance of the learning task of interest . Without identifying whether the uncertainty is related to the classification error or not , these methods can be inefficient in the sense that it may query candidates that do not directly help improve prediction performance . In this paper we focus on the active learning methods directly maximizing the learning model performance . There exist such active learning methods by Expected Loss Reduction ( ELR ) that aim to maximize the expected reduction in loss based on a one-step-look-ahead manner ( Roy & McCallum , 2001 ; Zhu et al. , 2003 ; Kapoor et al. , 2007 ) . The ELR methods can focus on only the uncertainty related to the loss function to achieve sample-efficient learning . In fact , ELR is the optimal strategy for active learning with a single query ( Roy & McCallum , 2001 ) . However , a critical shortcoming of previous ELR schemes is that none of them provide any theoretical guarantee regarding their longterm performance . In fact , since these methods are myopic and can not identify the long-term effect of a query on the loss functions , without special design on the loss function , they may get stuck before reaching the optimal classifier . To the best of our knowledge , there is currently no method that directly maximizes the model performance while simultaneously guaranteeing the convergence to the optimal classifier . Fig . 1a provides an example of binary classification with one feature where both BALD and ELR methods fail . In the figure , the red lines indicate the upper and lower bounds of the prediction probability of class 1 , illustrating the model with higher probability uncertainty on the sides ( x → ±4 ) than that in the middle ( x = 0 ) . Querying candidates on the sides will provide more information of the model parameters , and therefore is preferred in BALD . However , since the possible probabilities on the sides are always larger than or less than 0.5 , querying candidates on the sides will not help reduce the classification error . On the other hand , ELR queries candidates that help reduce the classification error the most , so it prefers data in the middle whose optimal labels are uncertain given the prior knowledge . The performance shown in Fig . 1b agrees with our analysis . Fig . 1b shows the performance averaged over 1000 runs , with more details and discussions of the example included in Appendix C. BALD performs inefficiently at the beginning by querying points on both sides . On the other hand , the ELR method performs the best at the beginning , but becomes inefficient after some iterations ( ∼100 ) , indicating some of its runs get stuck before reaching the optimal classifier . In this paper , we consider the algorithm to “ get stuck ” when the acquisition function value is 0 for all the candidates in the pool and the algorithm degenerates to uniform random sampling . In this paper , we analyze the reason why ELR methods may get stuck before reaching the optimal classifier , and propose a new strategy to solve this problem . Our contributions are in four parts : 1 . We show that ELR methods may get stuck , preventing active learning from reaching the optimal classifier efficiently . 2 . We propose a novel weighted-MOCU active learning method that can focus only on the uncertainty related to the loss for efficient active learning and is guaranteed to converge to the optimal classifier of the true model . 3 . We provide the convergence proof of the weightedMOCU method . 4 . We demonstrate the sample-efficiency of our weighted-MOCU method with both synthetic and real-world datasets . 2 BACKGROUND . Optimal Bayesian classifier . Consider a classification problem with candidates x ∈ X and class labels y ∈ Y = { 0 , 1 , . . . , M − 1 } . The predictive probability p ( y|x , θ ) is modeled with parameters θ . Assume θ is uncertain with a distribution π ( θ ) within the uncertainty class Θ . The classification problem is to find a classifier ψ : X → Y , which assigns a predicted class label to a given candidate . The expected 0-1 loss of the classifier ψ for a candidate x , dependent on θ , is defined as Cθ ( ψ , x ) , which can be derived to be the classification error : Cθ ( ψ , x ) = 1 − p ( y = ψ ( x ) |x , θ ) . The optimal classifier with θ , ψθ is defined as the classifier minimizing the classification error : ψθ ( x ) = arg maxy p ( y|x , θ ) . So we have : Cθ ( ψθ , x ) = minψ Cθ ( ψ , x ) = miny { 1− p ( y|x , θ ) } . When there is model uncertainty with π ( θ ) , an Optimal Bayesian Classifier ( OBC ) ψπ ( θ ) is the classifier that has the minimum expected loss over π ( θ ) ( Dalton & Dougherty , 2013 ) : Eπ ( θ ) [ Cθ ( ψπ ( θ ) , x ) ] = min ψ Eπ ( θ ) [ Cθ ( ψ , x ) ] = min y { 1− p ( y|x ) } ( 1 ) where p ( y|x ) = Eπ ( θ ) [ p ( y|x , θ ) ] is the predictive distribution . It ’ s easily to see ψπ ( θ ) ( x ) = arg maxy p ( y|x ) . Active learning . Active learning collects the training dataset D in a sequential way . For poolbased active learning , in each iteration , we choose a candidate x from the set of potential training samples X to query for the class label by optimizing an acquisition function U ( x ) . Then , in the Bayesian setting , by including the observed data pair ( x , y ) to D , we update the posterior distribution based on Bayes ’ rule . In each iteration , the acquisition function depends on the posterior distribution of model parameters π ( θ|D ) . In the following discussion , to simplify notations , we omit D from the notations and use π ( θ ) and p ( y|x ) to respectively denote the posterior and predictive distributions conditioned on D. When a new observed data point is included , the distributions are updated by Bayes ’ rule and the total probability rule as : π ( θ|x , y ) = π ( θ ) p ( y|x , θ ) p ( y|x ) and p ( y′|x′ , x , y ) = Eπ ( θ|x , y ) [ p ( y′|x′ , θ ) ] . The acquisition function of ELR methods in the Bayesian setting can be defined by the expected OBC prediction error reduction after observing the new pair ( x , y ) ( Roy & McCallum , 2001 ) : UELR ( x ) = Ep ( x′ ) { Eπ ( θ ) [ Cθ ( ψπ ( θ ) , x′ ) ] − Ep ( y|x ) [ Eπ ( θ|x , y ) [ Cθ ( ψπ ( θ|x , y ) , x′ ) ] ] } , ( 2 ) where p ( x′ ) is the distribution over X , independent of θ and D. ELR methods assume that we use OBC as the classifier , and in each iteration we should choose the query that maximize the decrease in OBC prediction error . The first term in ( 2 ) is the OBC prediction error of ψπ ( θ ) , and the second term is the expected prediction error of ψπ ( θ|x , y ) , the one-step-look-ahead OBC , with respect to p ( y|x ) . In the following section , we analyze why this acquisition function is sample-efficient as it directly targets at classification error reduction while ignoring irrelevant uncertainty with respect to the learning task ; but it may get stuck before converging to the true optimal classifier ( optimal classifier of the true model ) . 3 MOCU-BASED ACTIVE LEARNING . 3.1 MEAN OBJECTIVE COST OF UNCERTAINTY . To analyze ELR methods , we borrow the idea of the Mean Objective Cost of Uncertainty ( MOCU ) for active learning with respect to the corresponding posterior π ( θ ) . MOCU is a general objectiveoriented uncertainty quantification framework ( Yoon et al. , 2013 ) . For active learning , MOCU can be defined as the expected loss difference between the OBC and the optimal classifier : M ( π ( θ ) ) = Ep ( x′ ) [ Eπ ( θ ) [ Cθ ( ψπ ( θ ) , x′ ) − Cθ ( ψθ , x′ ) ] ] ( 3 ) = Ep ( x′ ) [ min y′ { 1− p ( y′|x′ ) } − Eπ ( θ ) [ min y′ { 1− p ( y′|x′ , θ ) } ] ] . ( 4 ) The second line is derived by the definition of ψθ and ( 1 ) . The first term in ( 3 ) is the OBC error as the loss . In the second term , ψθ is the optimal classifier with a specific θ . For the terms inside the expectation operator , we have Cθ ( ψπ ( θ ) , x′ ) − Cθ ( ψθ , x′ ) ≥ 0 . Therefore , the second term in ( 3 ) is a lower bound of the OBC prediction error . MOCU captures the difference between the OBC error and its lower bound . When MOCU is 0 , the OBC converges to the true optimal classifier and we can not reduce the OBC prediction error further . In that case , we say that OBC has reached the true optimal classifier . As in ELR methods , we can define an acquisition function by the reduction of MOCU in a one-steplook-ahead manner : UMOCU ( x ; π ( θ ) ) =M ( π ( θ ) ) − Ep ( y|x ) [ M ( π ( θ|x , y ) ) ] . ( 5 ) We can show that the second term in ( 3 ) , the lower bound of the OBC error , is cancelled in ( 5 ) . The acquisition function ( 5 ) hence captures the expected reduction of the OBC error given new data and is equivalent to the ELR acquisition function ( 2 ) . Expanding the second term in ( 5 ) , we have : Ep ( y|x ) [ M ( π ( θ|x , y ) ) ] = Ep ( x′ ) { Ep ( y|x ) [ Eπ ( θ|x , y ) [ Cθ ( ψπ ( θ|x , y ) , x′ ) − Cθ ( ψθ , x′ ) ] ] } . ( 6 ) Since ∑ y p ( y|x ) π ( θ|x , y ) = π ( θ ) , as x is assumed to be independent of θ so that we have π ( θ|x ) = π ( θ ) , we can rewrite the first term in ( 5 ) as : M ( π ( θ ) ) = Ep ( x′ ) { Ep ( y|x ) [ Eπ ( θ|x , y ) [ Cθ ( ψπ ( θ ) , x′ ) − Cθ ( ψθ , x′ ) ] ] } . ( 7 ) Combining ( 6 ) and ( 7 ) and canceling the Cθ ( ψθ , x′ ) terms ( the lower bound of the OBC error ) , ( 6 ) can be derived as : UMOCU ( x ; π ( θ ) ) = Ep ( x′ ) { Ep ( y|x ) [ Eπ ( θ|x , y ) [ Cθ ( ψπ ( θ ) , x′ ) − Cθ ( ψπ ( θ|x , y ) , x′ ) ] ] } , ( 8 ) which is just the ELR acquisition function in ( 2 ) . Therefore , we can conclude that MOCU-based methods are equivalent to ELR methods . Another property we can observe from ( 8 ) is that UMOCU ( x ; π ( θ ) ) ≥ 0 . By definition , ψπ ( θ|x , y ) is the OBC with the minimum expected classification error over π ( θ|x , y ) . Therefore , Eπ ( θ|x , y ) [ Cθ ( ψπ ( θ|x , y ) , x′ ) ] ≤ Eπ ( θ|x , y ) [ Cθ ( ψπ ( θ ) , x′ ) ] and we have UMOCU ( x ; π ( θ ) ) ≥ 0 , indicating collecting new data will reduce MOCU .
This paper provides an interesting algorithm to address the previous Bayesian active learning query strategy in (binary) classification. By the simple modification, the algorithm can overcome the drawbacks of ELR in the convergence to the optimal classifier parameterized by $\theta_r$. In experiments, the proposed algorithm can achieve the advantages of ELR and BALD simultaneously.
SP:839f449191ae3ff1016d4321d9e1926c5f883a78
Exploring Balanced Feature Spaces for Representation Learning
Existing self-supervised learning ( SSL ) methods are mostly applied for training representation models from artificially balanced datasets ( e.g . ImageNet ) . It is unclear how well they will perform in the practical scenarios where datasets are often imbalanced w.r.t . the classes . Motivated by this question , we conduct a series of studies on the performance of self-supervised contrastive learning and supervised learning methods over multiple datasets where training instance distributions vary from a balanced one to a long-tailed one . Our findings are quite intriguing . Different from supervised methods with large performance drop , the self-supervised contrastive learning methods perform stably well even when the datasets are heavily imbalanced . This motivates us to explore the balanced feature spaces learned by contrastive learning , where the feature representations present similar linear separability w.r.t . all the classes . Our further experiments reveal that a representation model generating a balanced feature space can generalize better than that yielding an imbalanced one across multiple settings . Inspired by these insights , we develop a novel representation learning method , called k-positive contrastive learning . It effectively combines strengths of the supervised method and the contrastive learning method to learn representations that are both discriminative and balanced . Extensive experiments demonstrate its superiority on multiple recognition tasks , including both long-tailed ones and normal balanced ones . Code is available at https : //github.com/bingykang/BalFeat . 1 INTRODUCTION . Self-supervised learning ( SSL ) has been popularly explored as it can learn data representations without requiring manual annotations and offer attractive potential of leveraging the vast amount of unlabeled data in the wild to obtain strong representation models ( Gidaris et al. , 2018 ; Noroozi & Favaro , 2016 ; He et al. , 2020 ; Chen et al. , 2020a ; Wu et al. , 2018 ) . For instance , some recent SSL methods ( Hénaff et al. , 2019 ; Oord et al. , 2018 ; Hjelm et al. , 2018 ; He et al. , 2020 ) use the unsupervised contrastive loss ( Hadsell et al. , 2006 ) to train the representation models by maximizing the instance discriminativeness , which are shown to generalize well across various downstream tasks , and even surpass the supervised learning counterparts in some cases ( He et al. , 2020 ; Chen et al. , 2020a ) . Despite the great success , existing SSL methods focus on learning data representations from the artificially balanced datasets ( e.g . ImageNet ( Deng et al. , 2009 ) ) where all the classes have similar numbers of training instances . However in reality , since the classes in natural images follow the Zipfian distribution , the datasets are usually imbalanced and show a long-tailed distribution ( Zipf , 1999 ; Spain & Perona , 2007 ) , i.e. , some classes involving significantly fewer training instances than others . Such imbalanced datasets are very challenging for supervised learning methods to model , leading to noticeable performance drop ( Wang et al. , 2017 ; Mahajan et al. , 2018 ; Zhong et al. , 2019 ) . Thus several interesting questions arise : How well will SSL methods perform on imbalanced datasets ? Will the quality of their learned representations deteriorate as the supervised learning methods ? Or can they perform stably well ? Answering these questions is important for understanding the behavior of SSL in practice . But these questions remain open as no research investigations have been conducted along this direction so far . discriminative feature space . The shadow area ( ) indicates the decision boundary of each class . Our work is motivated by the above questions to study the properties of data representations learned with supervised/self-supervised methods in a practical scenario . We start with two representative losses used by these methods , i.e. , the supervised cross-entropy and the unsupervised contrastive losses ( Hadsell et al. , 2006 ; Oord et al. , 2018 ) , and investigate the classification performance of their trained representation models from multiple training datasets where the instance distribution gradually varies from a balanced one to a long-tailed one . We surprisingly observe that , different from the ones learned from supervised cross-entropy loss where performance drops quickly , the representation models learned from the unsupervised contrastive loss perform stably well , no matter how much the training instance distribution is skewed to be imbalanced . Such a stark difference between the two representation learning methods drives us to explore why SSL performs so stably . We find that using the contrastive loss can obtain representation models generating a balanced feature space that has similar separability ( and classification performance ) for all the classes , as illustrated in Figure 1 . Such a balanced property of the feature spaces from SSL is intriguing and provides a new perspective to understand the behavior of SSL methods . We dig deeper into its benefits via a systematic study . In particular , since a pre-trained representation model is often used as initialization for downstream tasks ( He et al. , 2020 ; Newell & Deng , 2020 ; Hénaff et al. , 2019 ) , we evaluate and compare the generalization ability of the models that produce feature spaces of different balanced levels ( or ‘ balancedness ’ ) . We find that a more balanced model tends to generalize better across a variety of settings , including the out-of-distribution recognition as well as the cross-domain and cross-task applications . These studies imply that feature space balancedness is an important but often neglected factor for learning high-quality representations . Inspired by the above insights , we propose a new representation learning method , the k-positive constrastive learning , which inherits the strength of constrastive learning in learning balanced feature spaces and meanwhile improves the feature spaces ’ discriminative capability . Specifically , different from the contrastive learning methods lacking semantic discriminativeness , the proposed k-positive constrastive method leverages the available instance semantic labels by taking k instances of the same label with the anchor instance to embed semantics into the contrastive loss . As such , it can learn representations with desirable balancedness and discriminativeness ( Figure 1 ) . Extensive experiments and analyses clearly demonstrate its superiority over the supervised learning and latest contrastive learning methods ( He et al. , 2020 ) for various recognition tasks , including visual recognition in both long-tailed setting ( e.g. , ImageNet-LT , iNaturalist ) and balanced setting . This work makes the following important observations and contributions . ( 1 ) We present the first systematic studies on the performance of self-supervised contrastive learning on imbalanced datasets which are helpful to understanding the merits and limitations of SSL in practice . ( 2 ) Our studies reveal an intriguing property of the model trained by contrastive learning—the model can robustly learn balanced feature spaces—that has never been discussed before . ( 3 ) Our empirical analysis demonstrates that learning balanced feature spaces benefits the generalization of representation models and offer a new perspective for understanding deep model generalizability . ( 4 ) We develop a new method to explicitly pursue balanced feature spaces for representation learning and it outperforms the popular cross-entropy and contrastive losses based methods . We believe our findings and the novel k-positive contrastive method are inspiring for future research on representation learning . 2 RELATED WORKS . Self-supervised learning is a form of unsupervised learning . Recently there has been a surge of self-supervised data representation learning methods developed to alleviate the demand for manual annotations by mining free supervision information through specifically designed loss functions and pretext tasks . The contrastive loss measures the similarities of sample pairs in a feature space and is at the core of several recent SSL methods ( Chen et al. , 2020a ; b ; He et al. , 2020 ; Chen et al. , 2020c ) . Adversarial losses that measure the distribution difference are also exploited for self-supervised representation learning ( Donahue et al. , 2016 ; Doersch & Zisserman , 2017 ) . A wide range of pretext tasks have been developed including image inpainting ( Jenni & Favaro , 2018 ; Pathak et al. , 2016 ) , image colorization ( Larsson et al. , 2016 ; 2017 ) , context prediction ( Doersch et al. , 2015 ) , jigsaw puzzles ( Carlucci et al. , 2019 ; Noroozi & Favaro , 2016 ; Wei et al. , 2019 ) , rotation prediction ( Gidaris et al. , 2018 ) . Though very successful , the behavior of SSL largely remains a mystery . Recently Wang & Isola ( 2020 ) analyze contrastive learning from the perspective of uniformity and alignment of learned representations . However investigations on the behavior of contrastive learning on imbalanced datasets are still absent . We present the first study on this problem and our investigation methodology is also applicable to other SSL methods . In practice , the visual data usually follow a long-tailed distribution ( Zipf , 1999 ; Spain & Perona , 2007 ) , challenging supervised learning methods . Due to the imbalance in the number of training instances for different classes , conventional methods tend to perform much more poorly on instancerare classes than on instance-rich ones . To alleviate this performance bias , existing approaches either re-balance the data distribution through sampling ( Chawla et al. , 2002 ; Han et al. , 2005 ; Shen et al. , 2016 ; Mahajan et al. , 2018 ) or the loss for each class ( Cui et al. , 2019 ; Khan et al. , 2017 ; Cao et al. , 2019 ; Khan et al. , 2019 ) by reweighting . Kang et al . ( 2020 ) first propose to decouple representation learning from classifier learning to boost performance , and demonstrate that learning good feature spaces is crucial for long-tailed recognition . Along this direction , SSP ( Yang & Xu , 2020 ) is among the first methods that introduce SSL pretraining into learning the long-tailed recognition models . More specifically , instead of directly training a randomly initialized model from scratch as conventional supervised learning methods , SSP uses a model pretrained with SSL on the same dataset for initialization , which is observed to be able to to alleviate the label bias issue in imbalanced datasets and boost long-tailed recognition performance . In contrast , we conduct a series of systematic studies to directly compare SSL with supervised learning on representation learning . We show that SSL can learn stably well feature spaces robust to the underlying distribution of a dataset . Moreover , inspired by our findings on the benefits of a balanced feature space for generalization , we introduce the k-positive contrastive learning method to explicitly pursue balancedness and discriminativeness for representation learning , which has been shown through experiments to benefit not only long-tailed recognition but also normal recognition tasks . 3 BALANCED FEATURE SPACES FROM CONTRASTIVE LEARNING . In this section , we systematically study the performance of representation models trained by SSL from a collection of training datasets with varying instance number distributions , in contrast with the models learned by supervised learning methods , to explore how SSL performs when the training datasets are not artificially balanced . Furthermore , we investigate the generalization performance of these learned representation models under multiple settings , in order to explore the relationship between the representation model ’ s generalizability and the property of its learned feature space . Notations We define the notations used in this paper . Representation learning aims to obtain a representation model fθ that maps a sample xi into a feature space V such that its corresponding representation vi ∈ V encapsulates desired features for target applications . Let Drep-train = { xi , yi } , i = 1 , . . . , N be the dataset for training the representation model , where yi is the class label for sample xi . Let C denote the number of total classes and nj denote the number of instances within class j . We use { q1 , . . . , qC } with qj = nj/N to denote the discrete instance distribution over the C classes . An imbalanced dataset has significant difference in the class instance numbers , e.g. , q1 qC . We use a multi-layer convolutional neural network fθ ( · ) : xi 7→ vi to implement the representation model . The final classification prediction ŷ is given by a linear classifier ŷ = argmax [ W > v + b ] , where W denotes the classifier weight matrix and b denotes the bias term .
**Overview:** The paper presents experiments showing that the contrastive learning losses produce better embeddings or feature spaces than those produced by using binary cross-entropy losses. The experiments show that embeddings learned using contrastive learning losses seem to favor long-tailed learning tasks, out-of-distribution tasks, and object detection. The paper also presents an extension of the contrastive loss to improve the embeddings. The experiments in the paper use common and recent long-tail datasets as well as datasets for object detection and out-of-distribution tasks.
SP:6c897187759edf48c1bd4f3536c098ac0d5f1179
Exploring Balanced Feature Spaces for Representation Learning
Existing self-supervised learning ( SSL ) methods are mostly applied for training representation models from artificially balanced datasets ( e.g . ImageNet ) . It is unclear how well they will perform in the practical scenarios where datasets are often imbalanced w.r.t . the classes . Motivated by this question , we conduct a series of studies on the performance of self-supervised contrastive learning and supervised learning methods over multiple datasets where training instance distributions vary from a balanced one to a long-tailed one . Our findings are quite intriguing . Different from supervised methods with large performance drop , the self-supervised contrastive learning methods perform stably well even when the datasets are heavily imbalanced . This motivates us to explore the balanced feature spaces learned by contrastive learning , where the feature representations present similar linear separability w.r.t . all the classes . Our further experiments reveal that a representation model generating a balanced feature space can generalize better than that yielding an imbalanced one across multiple settings . Inspired by these insights , we develop a novel representation learning method , called k-positive contrastive learning . It effectively combines strengths of the supervised method and the contrastive learning method to learn representations that are both discriminative and balanced . Extensive experiments demonstrate its superiority on multiple recognition tasks , including both long-tailed ones and normal balanced ones . Code is available at https : //github.com/bingykang/BalFeat . 1 INTRODUCTION . Self-supervised learning ( SSL ) has been popularly explored as it can learn data representations without requiring manual annotations and offer attractive potential of leveraging the vast amount of unlabeled data in the wild to obtain strong representation models ( Gidaris et al. , 2018 ; Noroozi & Favaro , 2016 ; He et al. , 2020 ; Chen et al. , 2020a ; Wu et al. , 2018 ) . For instance , some recent SSL methods ( Hénaff et al. , 2019 ; Oord et al. , 2018 ; Hjelm et al. , 2018 ; He et al. , 2020 ) use the unsupervised contrastive loss ( Hadsell et al. , 2006 ) to train the representation models by maximizing the instance discriminativeness , which are shown to generalize well across various downstream tasks , and even surpass the supervised learning counterparts in some cases ( He et al. , 2020 ; Chen et al. , 2020a ) . Despite the great success , existing SSL methods focus on learning data representations from the artificially balanced datasets ( e.g . ImageNet ( Deng et al. , 2009 ) ) where all the classes have similar numbers of training instances . However in reality , since the classes in natural images follow the Zipfian distribution , the datasets are usually imbalanced and show a long-tailed distribution ( Zipf , 1999 ; Spain & Perona , 2007 ) , i.e. , some classes involving significantly fewer training instances than others . Such imbalanced datasets are very challenging for supervised learning methods to model , leading to noticeable performance drop ( Wang et al. , 2017 ; Mahajan et al. , 2018 ; Zhong et al. , 2019 ) . Thus several interesting questions arise : How well will SSL methods perform on imbalanced datasets ? Will the quality of their learned representations deteriorate as the supervised learning methods ? Or can they perform stably well ? Answering these questions is important for understanding the behavior of SSL in practice . But these questions remain open as no research investigations have been conducted along this direction so far . discriminative feature space . The shadow area ( ) indicates the decision boundary of each class . Our work is motivated by the above questions to study the properties of data representations learned with supervised/self-supervised methods in a practical scenario . We start with two representative losses used by these methods , i.e. , the supervised cross-entropy and the unsupervised contrastive losses ( Hadsell et al. , 2006 ; Oord et al. , 2018 ) , and investigate the classification performance of their trained representation models from multiple training datasets where the instance distribution gradually varies from a balanced one to a long-tailed one . We surprisingly observe that , different from the ones learned from supervised cross-entropy loss where performance drops quickly , the representation models learned from the unsupervised contrastive loss perform stably well , no matter how much the training instance distribution is skewed to be imbalanced . Such a stark difference between the two representation learning methods drives us to explore why SSL performs so stably . We find that using the contrastive loss can obtain representation models generating a balanced feature space that has similar separability ( and classification performance ) for all the classes , as illustrated in Figure 1 . Such a balanced property of the feature spaces from SSL is intriguing and provides a new perspective to understand the behavior of SSL methods . We dig deeper into its benefits via a systematic study . In particular , since a pre-trained representation model is often used as initialization for downstream tasks ( He et al. , 2020 ; Newell & Deng , 2020 ; Hénaff et al. , 2019 ) , we evaluate and compare the generalization ability of the models that produce feature spaces of different balanced levels ( or ‘ balancedness ’ ) . We find that a more balanced model tends to generalize better across a variety of settings , including the out-of-distribution recognition as well as the cross-domain and cross-task applications . These studies imply that feature space balancedness is an important but often neglected factor for learning high-quality representations . Inspired by the above insights , we propose a new representation learning method , the k-positive constrastive learning , which inherits the strength of constrastive learning in learning balanced feature spaces and meanwhile improves the feature spaces ’ discriminative capability . Specifically , different from the contrastive learning methods lacking semantic discriminativeness , the proposed k-positive constrastive method leverages the available instance semantic labels by taking k instances of the same label with the anchor instance to embed semantics into the contrastive loss . As such , it can learn representations with desirable balancedness and discriminativeness ( Figure 1 ) . Extensive experiments and analyses clearly demonstrate its superiority over the supervised learning and latest contrastive learning methods ( He et al. , 2020 ) for various recognition tasks , including visual recognition in both long-tailed setting ( e.g. , ImageNet-LT , iNaturalist ) and balanced setting . This work makes the following important observations and contributions . ( 1 ) We present the first systematic studies on the performance of self-supervised contrastive learning on imbalanced datasets which are helpful to understanding the merits and limitations of SSL in practice . ( 2 ) Our studies reveal an intriguing property of the model trained by contrastive learning—the model can robustly learn balanced feature spaces—that has never been discussed before . ( 3 ) Our empirical analysis demonstrates that learning balanced feature spaces benefits the generalization of representation models and offer a new perspective for understanding deep model generalizability . ( 4 ) We develop a new method to explicitly pursue balanced feature spaces for representation learning and it outperforms the popular cross-entropy and contrastive losses based methods . We believe our findings and the novel k-positive contrastive method are inspiring for future research on representation learning . 2 RELATED WORKS . Self-supervised learning is a form of unsupervised learning . Recently there has been a surge of self-supervised data representation learning methods developed to alleviate the demand for manual annotations by mining free supervision information through specifically designed loss functions and pretext tasks . The contrastive loss measures the similarities of sample pairs in a feature space and is at the core of several recent SSL methods ( Chen et al. , 2020a ; b ; He et al. , 2020 ; Chen et al. , 2020c ) . Adversarial losses that measure the distribution difference are also exploited for self-supervised representation learning ( Donahue et al. , 2016 ; Doersch & Zisserman , 2017 ) . A wide range of pretext tasks have been developed including image inpainting ( Jenni & Favaro , 2018 ; Pathak et al. , 2016 ) , image colorization ( Larsson et al. , 2016 ; 2017 ) , context prediction ( Doersch et al. , 2015 ) , jigsaw puzzles ( Carlucci et al. , 2019 ; Noroozi & Favaro , 2016 ; Wei et al. , 2019 ) , rotation prediction ( Gidaris et al. , 2018 ) . Though very successful , the behavior of SSL largely remains a mystery . Recently Wang & Isola ( 2020 ) analyze contrastive learning from the perspective of uniformity and alignment of learned representations . However investigations on the behavior of contrastive learning on imbalanced datasets are still absent . We present the first study on this problem and our investigation methodology is also applicable to other SSL methods . In practice , the visual data usually follow a long-tailed distribution ( Zipf , 1999 ; Spain & Perona , 2007 ) , challenging supervised learning methods . Due to the imbalance in the number of training instances for different classes , conventional methods tend to perform much more poorly on instancerare classes than on instance-rich ones . To alleviate this performance bias , existing approaches either re-balance the data distribution through sampling ( Chawla et al. , 2002 ; Han et al. , 2005 ; Shen et al. , 2016 ; Mahajan et al. , 2018 ) or the loss for each class ( Cui et al. , 2019 ; Khan et al. , 2017 ; Cao et al. , 2019 ; Khan et al. , 2019 ) by reweighting . Kang et al . ( 2020 ) first propose to decouple representation learning from classifier learning to boost performance , and demonstrate that learning good feature spaces is crucial for long-tailed recognition . Along this direction , SSP ( Yang & Xu , 2020 ) is among the first methods that introduce SSL pretraining into learning the long-tailed recognition models . More specifically , instead of directly training a randomly initialized model from scratch as conventional supervised learning methods , SSP uses a model pretrained with SSL on the same dataset for initialization , which is observed to be able to to alleviate the label bias issue in imbalanced datasets and boost long-tailed recognition performance . In contrast , we conduct a series of systematic studies to directly compare SSL with supervised learning on representation learning . We show that SSL can learn stably well feature spaces robust to the underlying distribution of a dataset . Moreover , inspired by our findings on the benefits of a balanced feature space for generalization , we introduce the k-positive contrastive learning method to explicitly pursue balancedness and discriminativeness for representation learning , which has been shown through experiments to benefit not only long-tailed recognition but also normal recognition tasks . 3 BALANCED FEATURE SPACES FROM CONTRASTIVE LEARNING . In this section , we systematically study the performance of representation models trained by SSL from a collection of training datasets with varying instance number distributions , in contrast with the models learned by supervised learning methods , to explore how SSL performs when the training datasets are not artificially balanced . Furthermore , we investigate the generalization performance of these learned representation models under multiple settings , in order to explore the relationship between the representation model ’ s generalizability and the property of its learned feature space . Notations We define the notations used in this paper . Representation learning aims to obtain a representation model fθ that maps a sample xi into a feature space V such that its corresponding representation vi ∈ V encapsulates desired features for target applications . Let Drep-train = { xi , yi } , i = 1 , . . . , N be the dataset for training the representation model , where yi is the class label for sample xi . Let C denote the number of total classes and nj denote the number of instances within class j . We use { q1 , . . . , qC } with qj = nj/N to denote the discrete instance distribution over the C classes . An imbalanced dataset has significant difference in the class instance numbers , e.g. , q1 qC . We use a multi-layer convolutional neural network fθ ( · ) : xi 7→ vi to implement the representation model . The final classification prediction ŷ is given by a linear classifier ŷ = argmax [ W > v + b ] , where W denotes the classifier weight matrix and b denotes the bias term .
In this paper, the authors propose a new loss function to learn feature representations for image datasets that are class-imbalanced. The loss function is a simple yet effective tweak on an existing supervised contrastive loss work. A number of empirical tests are performed on long-tailed datasets showing the benefits of the proposed loss in beating state of the art methods. Some specific questions are listed below:
SP:6c897187759edf48c1bd4f3536c098ac0d5f1179
Contrastive Learning with Adversarial Perturbations for Conditional Text Generation
1 INTRODUCTION . The sequence-to-sequence ( seq2seq ) models ( Sutskever et al. , 2014 ) , which learn to map an arbitrary-length input sequence to another arbitrary-length output sequence , have successfully tackled a wide range of language generation tasks . Early seq2seq models have used recurrent neural networks to encode and decode sequences , leveraging attention mechanism ( Bahdanau et al. , 2015 ) that allows the decoder to attend to a specific token in the input sequence to capture long-term dependencies between the source and target sequences . Recently , the Transformer ( Vaswani et al. , 2017 ) , which is an all-attention model that effectively captures long-term relationships between tokens in the input sequence as well as across input and output sequences , has become the de facto standard for most of the text generation tasks due to its impressive performance . Moreover , Transformerbased language models trained on large text corpora ( Dong et al. , 2019 ; Raffel et al. , 2020 ; Lewis et al. , 2020 ) have shown to significantly improve the model performance on text generation tasks . However , a crucial limitation of seq2seq models is that they are mostly trained only with teacher forcing , where ground truth is provided at each time step and thus never exposed to incorrectly generated tokens during training ( Fig . 1- ( a ) ) , which hurts its generalization . This problem is known as the “ exposure bias ” problem ( Ranzato et al. , 2016 ) and often results in the generation of lowquality texts on unseen inputs . Several prior works tackle the problem , such as using reinforcement learning ( RL ) to maximize non-differentiable reward ( Bahdanau et al. , 2017 ; Paulus et al. , 2018 ) . ∗Equal contribution Another approach is to use RL or gumbel softmax ( Jang et al. , 2017 ) to match the distribution of generated sentences to that of the ground truth , in which case the reward is the discriminator output from a Generative Adversarial Network ( GAN ) ( Zhang et al. , 2018 ; 2017 ; Yu et al. , 2017 ) . Although the aforementioned approaches improve the performance of the seq2seq models on text generation tasks , they either require a vast amount of effort in tuning hyperparameters or stabilize training . In this work , we propose to mitigate the exposure bias problem with a simple yet effective approach , in which we contrast a positive pair of input and output sequence to negative pairs , to expose the model to various valid or incorrect sentences . Naı̈vely , we can construct negative pairs by simply using random nontarget sequences from the batch ( Chen et al. , 2020 ) . However , such a naı̈ve construction yields meaningless negative examples that are already well-discriminated in the embedding space ( Fig . 1- ( b ) ) , which we highlight as the reason why existing methods ( Chen et al. , 2020 ) require large batch size . This is clearly shown in Fig . 2 , where a large portion of positive-negative pairs can be easily discriminated without any training , which gets worse as the batch size decreases as it will reduce the chance to have meaningfully difficult examples in the batch . Moreover , discriminating positive and naı̈ve negative pairs becomes even more easier for models pretrained on large text corpora . To resolve this issue , we propose principled approaches to automatically generate negative and positive pairs for constrastive learning , which we refer to as Contrastive Learning with Adversarial Perturbation for Seq2seq learning ( CLAPS ) . Specifically , we generate a negative example by adding a small perturbation to the hidden representation of the target sequence , such that its conditional likelihood is minimized ( Denoted as the red circle in Fig . 1- ( c ) ) . Conversely , we construct an additional positive example ( Denoted as green circle in Fig . 1- ( c ) ) by adding a large amount of perturbation to the hidden representation of target sequence such that the perturbed sample is far away from the source sequence in the embedding space , while enforcing it to have high conditional likelihood by minimizing Kullback-Leibler ( KL ) divergence between the original conditional distribution and perturbed conditional distribution . This will yield a negative example that is very close to the original representation of target sequence in the embedding space but is largely dissimilar in the semantics , while the generated positive example is far away from the original input sequence but has the same semantic as the target sequence . This will generate difficult examples that the model fails to correctly discriminate ( Fig . 1- ( c ) , Fig.2 ) , helping it learn with more meaningful pairs . To verify the efficacy of our method , we empirically show that it significantly improves the performance of seq2seq model on three conditional text generation tasks , namely machine translation , text summarization and question generation . Our contribution in this work is threefold : • To mitigate the exposure bias problem , we propose a contrastive learning framework for conditional sequence generation , which contrasts a positive pair of source and target sentence to negative pairs in the latent embedding space , to expose the model to various valid or incorrect outputs . • To tackle the ineffectiveness of conventional approach for constructing negative and positive examples for contrastive learning , we propose a principled method to automatically generate negative and positive pairs , that are more difficult and allows to learn more meaningful representations . • We show that our proposed method , CLAPS , significantly improves the performance of seq2seq model on three different tasks : machine translation , text summarization , and question generation . 2 RELATED WORK . Exposure Bias There are several prior works to tackle the exposure bias ( Ranzato et al. , 2016 ) . Bengio et al . ( 2015 ) introduce scheduled sampling where the model is initially guided with the true previous tokens but uses the tokens generated by the seq2seq model as the conditional input for the next token , as training goes on . Paulus et al . ( 2018 ) ; Bahdanau et al . ( 2017 ) leverage RL to maximize non-differentiable rewards , so it enables to penalize the model for incorrectly generated sentences . Another works ( Zhang et al. , 2017 ; 2018 ; Yu et al. , 2017 ) train GANs to match the distribution of generated sequences to that of ground truth . Since sampling tokens from the generator is not differentiable , they resort RL or gumbel-softmax to train the networks in end-to-end fashion . However , they require either a large amount of effort to tune hyperparameters or stabilize training . However , Choshen et al . ( 2020 ) show that RL for machine translation does not optimize the expected reward and the performance gain is attributed to the unrelated effects such as increasing the peakiness of the output distribution . Moreover , ( Caccia et al. , 2019 ) show that by tuning the temperature parameter , the language models trained with MLE can be tuned to outperform GAN-based text generation models . Adversarial Perturbation Many existing works , such as ( Madry et al. , 2018 ) , address the robustness of neural networks to adversarial examples , which are generated by applying a small perturbations to the input samples . While adversarial robustness has been mostly explored in image domains , Miyato et al . ( 2017 ) adopted adversarial training to text domains . However instead of targeting robustness to perturbed samples , they utilize the adversarial examples as augmented data , and enforce consistency across the predictions across original unlabeled example and its perturbation , for semisupervised learning . Recently Zhu et al . ( 2019 ) and Jiang et al . ( 2020 ) leverage adversarial training to induce the smoothness of text classifiers , to prevent overfitting to training samples . While they are relevant to ours , these methods do not have the notion of positive and negative examples as they do not consider contrastive learning , and only target text classification . Moreover , they are computationally prohibitive since they use PGD for adversarial training , which requires iterative optimization for each individual sample . Recently , Aghajanyan et al . ( 2020 ) propose a simpler yet effective method based on Gaussian noise perturbation to regularize neural networks without expensive PGD steps , which is shown to outperform methods from Zhu et al . ( 2019 ) and Jiang et al . ( 2020 ) . Although our work is similar to these prior works in that we add perturbations to the text embeddings , note that we used the adversarially-generated samples as negative examples of our contrastive learning framework rather than trying to learn the model to be robust to them . Contrastive Learning Contrastive learning has been widely used . It is to learn a representation by contrasting positive pairs and negative pairs . Chopra et al . ( 2005 ) ; Weinberger & Saul ( 2009 ) ; Schroff et al . ( 2015 ) leverage a triplet loss to separate positive examples from negative examples in metric learning . Chen et al . ( 2020 ) show that contrastive learning can boost the performance of selfsupervised and semi-supervised learning in computer vison tasks . In natural language processing ( NLP ) , contrastive learning has been widely used . In Word2Vec ( Mikolov et al. , 2013 ) , neighbouring words are predicted from context with noise-contrastive estimation ( Gutmann & Hyvärinen , 2012 ) . Beyond word representation , Logeswaran & Lee ( 2018 ) sample two contiguous sentences for positive pairs and the sentences from other document as negative pairs . They constrast positive and negative pairs to learn sentence representation . Moreover , contrastive learning has been investigated in various NLP tasks — language modeling ( Huang et al. , 2018 ) , unsupervised word alignment ( Liu & Sun , 2015 ) , caption generation ( Mao et al. , 2016 ; Vedantam et al. , 2017 ) , and machine translation ( Yang et al. , 2019 ) . 3 METHOD . 3.1 BACKGROUND : CONDITIONAL TEXT GENERATION . The goal of conditional text generation with a seq2seq model is to generate an output text sequence y ( i ) = ( y ( i ) 1 , . . . , y ( i ) T ) with length T conditioned on the input text sequence x ( i ) = ( x ( i ) 1 , . . . , x ( i ) L ) with length L. A typical approach to the conditional text generation is to leverage the encoderdecoder architecture to parameterize the conditional distribution . We maximize the conditional log likelihood log pθ ( y|x ) for a given N observations { ( x ( i ) , y ( i ) ) } Ni=1 as follows : LMLE ( θ ) = N∑ i=1 log pθ ( y ( i ) |x ( i ) ) pθ ( y ( i ) 1 , . . . , y ( i ) T |x ( i ) ) = T∏ t=1 pθ ( y ( i ) t |y ( i ) < t , x ( i ) ) pθ ( y ( i ) t |y ( i ) < t , x ( i ) ) = softmax ( Wh ( i ) t + b ) h ( i ) t = g ( y ( i ) t−1 , M ( i ) ; θ ) , M ( i ) = f ( x ( i ) ; θ ) ( 1 ) where f , g denote the encoder and the decoder respectively and M ( i ) = [ m ( i ) 1 · · ·m ( i ) L ] ∈ Rd×L is the concatenation of the hidden representations of the source tokens x ( i ) .
Proposes contrastive learning method for conditional text-generation. Here we maximize similarity (of representations) between source and target sequences (positive) while minimizing similarity with false targets (negative). Additional positives and negatives are created in the sequence representation space by adding perturbations to decoder (output) hidden states to minimize/maximize conditional likelihood p(y|x). It is shown this works a lot better than the naive contrastive approach of sampling random non-target sequences.
SP:978b2e085614592b4d8503ea2cc17ff5f0510539
Contrastive Learning with Adversarial Perturbations for Conditional Text Generation
1 INTRODUCTION . The sequence-to-sequence ( seq2seq ) models ( Sutskever et al. , 2014 ) , which learn to map an arbitrary-length input sequence to another arbitrary-length output sequence , have successfully tackled a wide range of language generation tasks . Early seq2seq models have used recurrent neural networks to encode and decode sequences , leveraging attention mechanism ( Bahdanau et al. , 2015 ) that allows the decoder to attend to a specific token in the input sequence to capture long-term dependencies between the source and target sequences . Recently , the Transformer ( Vaswani et al. , 2017 ) , which is an all-attention model that effectively captures long-term relationships between tokens in the input sequence as well as across input and output sequences , has become the de facto standard for most of the text generation tasks due to its impressive performance . Moreover , Transformerbased language models trained on large text corpora ( Dong et al. , 2019 ; Raffel et al. , 2020 ; Lewis et al. , 2020 ) have shown to significantly improve the model performance on text generation tasks . However , a crucial limitation of seq2seq models is that they are mostly trained only with teacher forcing , where ground truth is provided at each time step and thus never exposed to incorrectly generated tokens during training ( Fig . 1- ( a ) ) , which hurts its generalization . This problem is known as the “ exposure bias ” problem ( Ranzato et al. , 2016 ) and often results in the generation of lowquality texts on unseen inputs . Several prior works tackle the problem , such as using reinforcement learning ( RL ) to maximize non-differentiable reward ( Bahdanau et al. , 2017 ; Paulus et al. , 2018 ) . ∗Equal contribution Another approach is to use RL or gumbel softmax ( Jang et al. , 2017 ) to match the distribution of generated sentences to that of the ground truth , in which case the reward is the discriminator output from a Generative Adversarial Network ( GAN ) ( Zhang et al. , 2018 ; 2017 ; Yu et al. , 2017 ) . Although the aforementioned approaches improve the performance of the seq2seq models on text generation tasks , they either require a vast amount of effort in tuning hyperparameters or stabilize training . In this work , we propose to mitigate the exposure bias problem with a simple yet effective approach , in which we contrast a positive pair of input and output sequence to negative pairs , to expose the model to various valid or incorrect sentences . Naı̈vely , we can construct negative pairs by simply using random nontarget sequences from the batch ( Chen et al. , 2020 ) . However , such a naı̈ve construction yields meaningless negative examples that are already well-discriminated in the embedding space ( Fig . 1- ( b ) ) , which we highlight as the reason why existing methods ( Chen et al. , 2020 ) require large batch size . This is clearly shown in Fig . 2 , where a large portion of positive-negative pairs can be easily discriminated without any training , which gets worse as the batch size decreases as it will reduce the chance to have meaningfully difficult examples in the batch . Moreover , discriminating positive and naı̈ve negative pairs becomes even more easier for models pretrained on large text corpora . To resolve this issue , we propose principled approaches to automatically generate negative and positive pairs for constrastive learning , which we refer to as Contrastive Learning with Adversarial Perturbation for Seq2seq learning ( CLAPS ) . Specifically , we generate a negative example by adding a small perturbation to the hidden representation of the target sequence , such that its conditional likelihood is minimized ( Denoted as the red circle in Fig . 1- ( c ) ) . Conversely , we construct an additional positive example ( Denoted as green circle in Fig . 1- ( c ) ) by adding a large amount of perturbation to the hidden representation of target sequence such that the perturbed sample is far away from the source sequence in the embedding space , while enforcing it to have high conditional likelihood by minimizing Kullback-Leibler ( KL ) divergence between the original conditional distribution and perturbed conditional distribution . This will yield a negative example that is very close to the original representation of target sequence in the embedding space but is largely dissimilar in the semantics , while the generated positive example is far away from the original input sequence but has the same semantic as the target sequence . This will generate difficult examples that the model fails to correctly discriminate ( Fig . 1- ( c ) , Fig.2 ) , helping it learn with more meaningful pairs . To verify the efficacy of our method , we empirically show that it significantly improves the performance of seq2seq model on three conditional text generation tasks , namely machine translation , text summarization and question generation . Our contribution in this work is threefold : • To mitigate the exposure bias problem , we propose a contrastive learning framework for conditional sequence generation , which contrasts a positive pair of source and target sentence to negative pairs in the latent embedding space , to expose the model to various valid or incorrect outputs . • To tackle the ineffectiveness of conventional approach for constructing negative and positive examples for contrastive learning , we propose a principled method to automatically generate negative and positive pairs , that are more difficult and allows to learn more meaningful representations . • We show that our proposed method , CLAPS , significantly improves the performance of seq2seq model on three different tasks : machine translation , text summarization , and question generation . 2 RELATED WORK . Exposure Bias There are several prior works to tackle the exposure bias ( Ranzato et al. , 2016 ) . Bengio et al . ( 2015 ) introduce scheduled sampling where the model is initially guided with the true previous tokens but uses the tokens generated by the seq2seq model as the conditional input for the next token , as training goes on . Paulus et al . ( 2018 ) ; Bahdanau et al . ( 2017 ) leverage RL to maximize non-differentiable rewards , so it enables to penalize the model for incorrectly generated sentences . Another works ( Zhang et al. , 2017 ; 2018 ; Yu et al. , 2017 ) train GANs to match the distribution of generated sequences to that of ground truth . Since sampling tokens from the generator is not differentiable , they resort RL or gumbel-softmax to train the networks in end-to-end fashion . However , they require either a large amount of effort to tune hyperparameters or stabilize training . However , Choshen et al . ( 2020 ) show that RL for machine translation does not optimize the expected reward and the performance gain is attributed to the unrelated effects such as increasing the peakiness of the output distribution . Moreover , ( Caccia et al. , 2019 ) show that by tuning the temperature parameter , the language models trained with MLE can be tuned to outperform GAN-based text generation models . Adversarial Perturbation Many existing works , such as ( Madry et al. , 2018 ) , address the robustness of neural networks to adversarial examples , which are generated by applying a small perturbations to the input samples . While adversarial robustness has been mostly explored in image domains , Miyato et al . ( 2017 ) adopted adversarial training to text domains . However instead of targeting robustness to perturbed samples , they utilize the adversarial examples as augmented data , and enforce consistency across the predictions across original unlabeled example and its perturbation , for semisupervised learning . Recently Zhu et al . ( 2019 ) and Jiang et al . ( 2020 ) leverage adversarial training to induce the smoothness of text classifiers , to prevent overfitting to training samples . While they are relevant to ours , these methods do not have the notion of positive and negative examples as they do not consider contrastive learning , and only target text classification . Moreover , they are computationally prohibitive since they use PGD for adversarial training , which requires iterative optimization for each individual sample . Recently , Aghajanyan et al . ( 2020 ) propose a simpler yet effective method based on Gaussian noise perturbation to regularize neural networks without expensive PGD steps , which is shown to outperform methods from Zhu et al . ( 2019 ) and Jiang et al . ( 2020 ) . Although our work is similar to these prior works in that we add perturbations to the text embeddings , note that we used the adversarially-generated samples as negative examples of our contrastive learning framework rather than trying to learn the model to be robust to them . Contrastive Learning Contrastive learning has been widely used . It is to learn a representation by contrasting positive pairs and negative pairs . Chopra et al . ( 2005 ) ; Weinberger & Saul ( 2009 ) ; Schroff et al . ( 2015 ) leverage a triplet loss to separate positive examples from negative examples in metric learning . Chen et al . ( 2020 ) show that contrastive learning can boost the performance of selfsupervised and semi-supervised learning in computer vison tasks . In natural language processing ( NLP ) , contrastive learning has been widely used . In Word2Vec ( Mikolov et al. , 2013 ) , neighbouring words are predicted from context with noise-contrastive estimation ( Gutmann & Hyvärinen , 2012 ) . Beyond word representation , Logeswaran & Lee ( 2018 ) sample two contiguous sentences for positive pairs and the sentences from other document as negative pairs . They constrast positive and negative pairs to learn sentence representation . Moreover , contrastive learning has been investigated in various NLP tasks — language modeling ( Huang et al. , 2018 ) , unsupervised word alignment ( Liu & Sun , 2015 ) , caption generation ( Mao et al. , 2016 ; Vedantam et al. , 2017 ) , and machine translation ( Yang et al. , 2019 ) . 3 METHOD . 3.1 BACKGROUND : CONDITIONAL TEXT GENERATION . The goal of conditional text generation with a seq2seq model is to generate an output text sequence y ( i ) = ( y ( i ) 1 , . . . , y ( i ) T ) with length T conditioned on the input text sequence x ( i ) = ( x ( i ) 1 , . . . , x ( i ) L ) with length L. A typical approach to the conditional text generation is to leverage the encoderdecoder architecture to parameterize the conditional distribution . We maximize the conditional log likelihood log pθ ( y|x ) for a given N observations { ( x ( i ) , y ( i ) ) } Ni=1 as follows : LMLE ( θ ) = N∑ i=1 log pθ ( y ( i ) |x ( i ) ) pθ ( y ( i ) 1 , . . . , y ( i ) T |x ( i ) ) = T∏ t=1 pθ ( y ( i ) t |y ( i ) < t , x ( i ) ) pθ ( y ( i ) t |y ( i ) < t , x ( i ) ) = softmax ( Wh ( i ) t + b ) h ( i ) t = g ( y ( i ) t−1 , M ( i ) ; θ ) , M ( i ) = f ( x ( i ) ; θ ) ( 1 ) where f , g denote the encoder and the decoder respectively and M ( i ) = [ m ( i ) 1 · · ·m ( i ) L ] ∈ Rd×L is the concatenation of the hidden representations of the source tokens x ( i ) .
This paper proposes to add contrastive learning to the sequence-to-sequence generation problem. More specifically, the authors apply a contrastive loss on the globally pooled hidden representation of the generated hidden states. The key novelty is to apply adversarial gradients to obtain both hard negative and hard positive examples. The proposed method can improve a state-of-art pretrained transformer model (T5) on 3 tasks: machine translation (WMT16 En-Ro), abstractive summarization (XSum), and question generation (SQuAD).
SP:978b2e085614592b4d8503ea2cc17ff5f0510539
Adversarially Robust Federated Learning for Neural Networks
In federated learning , data is distributed among local clients which collaboratively train a prediction model using secure aggregation . To preserve the privacy of the clients , the federated learning paradigm requires each client to maintain a private local training data set , and only uploads its summarized model updates to the server . In this work , we show that this paradigm could lead to a vulnerable model , which collapses in performance when the corrupted data samples ( under adversarial manipulations ) are used for prediction after model deployment . To improve model robustness , we first decompose the aggregation error of the central server into bias and variance , and then , propose a robust federated learning framework , named Fed BVA , that performs on-device adversarial training using the bias-variance oriented adversarial examples supplied by the server via asymmetrical communications . The experiments are conducted on multiple benchmark data sets using several prevalent neural network models , and the empirical results show that our framework is robust against white-box and black-box adversarial corruptions under both IID and non-IID settings . 1 INTRODUCTION . The explosive amount of decentralized user data collected from the ever-growing usage of smart devices , e.g. , smartphones , wearable devices , home sensors , etc. , has led to a surge of interest in the field of decentralized learning . To protect the privacy-sensitive data of the clients , federated learning ( McMahan et al. , 2017 ; Yang et al. , 2019 ) has been proposed . Federated learning only allows a group of clients to train local models using their own data , and then collectively merges the model updates on a central server using secure aggregation ( Acar et al. , 2018 ) . Due to its high privacy-preserving property , federated learning has attracted much attention in recent years along with the prevalence of efficient light-weight deep models ( Howard et al. , 2017 ) and low-cost network communications ( Wen et al. , 2017 ; Konečnỳ et al. , 2016 ) . In federated learning , the central server only inspects the secure aggregation of the local models as a whole . Consequently , it is susceptible to clients ’ corrupted updates ( e.g. , system failures , etc ) . Recently , multiple robust federated learning models ( Fang et al. , 2019 ; Pillutla et al. , 2019 ; Portnoy & Hendler , 2020 ; Mostafa , 2019 ) have been proposed . These works only focus on performing clientlevel robust training or designing server-level aggregation variants with hyper-parameter tuning for Byzantine failures . However , none of them have the ability to mitigate the federated learning ’ s vulnerability when the adversarial manipulations are present during testing , which as we shown in Section 4.1 that is mainly due to the generalization error in the model aggregation . Our work bridges this gap by investigating the error incurred during the aggregation of federated learning from the perspective of bias-variance decomposition ( Domingos , 2000 ; Valentini & Dietterich , 2004 ) . Specifically , we show that the generalization error of the aggregated model on the central server can be decomposed as the combination of bias ( triggered by the main prediction of these clients ) and variance ( triggered by the variations among clients ’ predictions ) . Next , we propose to perform the local robust training on clients by supplying them with a tiny amount of the bias-variance perturbed examples generated from the central server via asymmetrical communications . The experiments are conducted on neural networks with cross-entropy loss , however , other loss functions are also applicable as long as their gradients w.r.t . bias and variance are tractable to estimate . In this way , any gradient-based adversarial training strategies ( Goodfellow et al. , 2015 ; Madry et al. , 2018 ) could be used . Compared with previous work , our major contributions include : • We provide the exact solution of bias-variance analysis w.r.t . the generalization error which is perfectly suitable for neural network based federated learning . As a comparison , performing adversarial attacks or training with conventional federated learning methods will only focus on the bias of the central model but ignore the variance . • We demonstrate that the conventional federated learning framework is vulnerable to the strong attacking methods with increasing communication rounds even if the adversarial training using the locally generated adversarial examples is performed on each client . • Without violating the clients ’ privacy , we show that providing a tiny amount of bias-variance perturbed data from the central server to the clients through asymmetrical communication could dramatically improve the robustness of the training model under various settings . 2 PRELIMINARIES . 2.1 SETTINGS . In federated learning , there is a central server and K different clients , each with access to a private training set Dk = { ( xki , tki ) } nk i=1 , where x k i , tki , and nk are the features , label , and number of training examples in the kth client ( k = 1 , · · · , K ) . Each data Dk is exclusively owned by client k and will not be shared with the central server or other clients . In addition , there is a small public training set Ds = { ( xsj , tsj ) } ns j=1 with ns training examples from the server that is shared with clients , where ns ⌧ PK k=1 nk . Note that this will not break the privacy constraints , for example , hospitals ( local devices ) that contribute to a federated learned medical image diagnosis system could take a few publicly accessible images as additional inputs . The goal of federated learning is to train a global classifier f ( · ) using knowledge from all the clients such that it generalizes well over test data Dtest . The notation used in this paper is summarized in the Appendix ( see Table 4 ) . 2.2 PROBLEM DEFINITION . In this paper , we study the adversarial robustness of neural networks1 in federated learning setting , and we define robust decentralized learning as follows . Definition 2.1 . ( Adversarially Robust Federated Learning ) Input : ( 1 ) A set of private training data { Dk } Kk=1 on K different clients ; ( 2 ) Tiny amount of training data Ds on the central server ; ( 3 ) Learning algorithm f ( · ) and loss function L ( · , · ) . Output : A trained model on the central server that is robust against adversarial perturbation . We would like to point out that our problem definition has the following properties : Asymmetrical communication : The asymmetrical communication between each client and server cloud is allowed : the server provides both global model parameters and limited shared data to the clients ; while each client only uploads its local model parameters back to the server . Data distribution : All training examples on the clients and the server are assumed to follow the same data distribution . However , the experiments show that our proposed algorithm also achieves outstanding performance under the non-IID setting , which could be common among personalized clients in real scenarios . Shared learning algorithm : All the clients are assumed to use the identical model f ( · ) , including architectures as well as hyper-parameters ( e.g. , learning rate , local epochs , local batch size ) . Remark . The basic assumption of this problem setting is that the learning process is clean ( no malicious behaviors are observed during training ) , however , the intentionally generated adversarial poisoning data will be mixed with clean data during training . The eventual trained model being deployed on the devices will be robust against potential future adversarial attacks . 2.3 BIAS-VARIANCE TRADE-OFF . Following ( Domingos , 2000 ; Valentini & Dietterich , 2004 ) , we define the optimal prediction , main prediction as well as the bias , variance , and noise for any real-valued loss function L ( · , · ) as follows : Definition 2.2 . ( Optimal Prediction and Main Prediction ) Given loss function L ( · , · ) and learning algorithm f ( · ) , optimal prediction y⇤ and main prediction ym for an example are defined as : y⇤ ( x ) = argmin y Et [ L ( y , t ) ] and ym ( x ) = argmin y0 ED [ L ( fD ( x ) , y0 ) ] ( 1 ) where t and D are viewed as the random variables to denote the class label and training set , and fD denotes the model trained on D. In short , the main prediction is the prediction whose average loss relative to all the predictions over data distributions is minimum , e.g. , the main prediction for zeroone loss is the mode of predictions . In this work , we show that the main prediction is the average prediction of client models for mean squared ( MSE ) loss and cross-entropy ( CE ) loss in Section 4.1 . 1Our theoretical contribution mainly focuses on classification using neural networks with cross-entropy loss and mean squared loss . However , the proposed framework is generic to allow the use of other classification loss functions as well . Definition 2.3 . ( Bias , Variance and Noise ) Given a loss function L ( · , · ) and a learning algorithm f ( · ) , the expected loss ED , t [ L ( fD ( x ) , t ) ] for an example x can be decomposed2 into bias , variance and noise as follows : B ( x ) = L ( ym , y⇤ ) and V ( x ) = ED [ L ( fD ( x ) , ym ) ] and N ( x ) = Et [ L ( y⇤ , t ) ] ( 2 ) In short , bias is the loss incurred by the main prediction w.r.t . the optimal prediction , and variance is the average loss incurred by predictions w.r.t . the main prediction . Noise is conventionally assumed to be irreducible and independent to f ( · ) . Remark . Our definitions on optimal prediction , main prediction , bias , variance and noise slightly differ from previous ones ( Domingos , 2000 ; Valentini & Dietterich , 2004 ) . For example , conventional optimal prediction was defined as y⇤ ( x ) = argminy Et [ L ( t , y ) ] , and it is equivalent to our definition when loss function is symmetric over its arguments , i.e. , L ( y1 , y2 ) = L ( y2 , y1 ) . Note that this decomposition holds for any real-valued loss function in the binary setting ( Domingos , 2000 ) with a bias & variance trade-off coefficient that has a closed-form expression . For multi-class set- ting , we inherit their definition of bias & variance directly , and treat the trade-off coefficient as a hyper-parameter to tune because no closed-form expression of is available . 3 THE PROPOSED FRAMEWORK . A typical framework ( Kairouz et al. , 2019 ) of privacy-preserving federated learning can be summarized as follows : ( 1 ) Client Update : Each client updates local model parameters wk by minimizing the empirical loss over its own training set ; ( 2 ) Forward Communication : Each client uploads its model parameter update to the central server ; ( 3 ) Server Update : It synchronously aggregates the received parameters ; ( 4 ) Backward Communication : The global parameters are sent back to the clients . Our framework follows the same paradigm but with substantial modifications as below . Server Update . The server has two components : The first one uses FedAvg ( McMahan et al. , 2017 ) algorithm to aggregate the local models ’ parameters , i.e. , wG = Aggregate ( w1 , · · · , wK ) =PK k=1 nk n wk where n = PK k=1 nk and wk is the model parameters in the k th client . Meanwhile , another component is designed to produce adversarially perturbed examples which could be induced by a poisoning attack algorithm for the usage of robust adversarial training . It has been well studied ( Belkin et al. , 2019 ; Domingos , 2000 ; Valentini & Dietterich , 2004 ) that in the classification setting , the generalization error of a learning algorithm on an example is determined by the bias , variance , and irreducible noise as defined in Eq . ( 2 ) . Similar to the previous work , we also assume a noise-free learning scenario where the class label t is a deterministic function of x ( i.e. , if x is sampled repeatedly , the same values of its class t will be observed ) . This motivates us to generate the adversarial examples by attacking the bias and variance induced by clients ’ models as : max x̂2⌦ ( x ) B ( x̂ ; w1 , · · · , wK ) + V ( x̂ ; w1 , · · · , wK ) 8 ( x , t ) 2 Ds ( 3 ) where B ( x̂ ; w1 , · · · , wK ) and V ( x̂ ; w1 , · · · , wK ) could be empirically estimated from a finite number of clients ’ parameters trained on local training sets { D1 , D2 , · · · , DK } . Here is a hyperparameter to measure the trade-off of bias and variance , and ⌦ ( x ) is the perturbation constraint . Note that Ds ( on the server ) is the candidate subset of all available training examples that would lead to their perturbed counterparts . This is a more feasible setting as compared to generating adversarial examples on clients ’ devices because the server usually has much powerful computational capacity in real scenarios that allows the usage of flexible poisoning attack algorithms . In this case , both poisoned examples and server model parameters would be sent back to each client ( Backward Communication ) , while only clients ’ local parameters would be uploaded to the server ( Forward Communication ) , i.e. , the asymmetrical communication as discussed in Section 2.2 . Client Update . The robust training of one client ’ s prediction model ( i.e. , wk ) can be formulated as the following minimization problem . min wk 0 @ nkX i=1 L ( fDk ( x k i ; wk ) , t k i ) + nsX j=1 L ( fDk ( x̂ s j ; wk ) , t s j ) 1 A ( 4 ) where x̂sj 2 ⌦ ( xsj ) is the perturbed examples that is asymmetrically transmitted from the server . 2This decomposition is based on the weighted sum of bias , variance , and noise . In general , t is a non-deterministic function ( Domingos , 2000 ) of x when the irreducible noise is considered . Namely , if x is sampled repeatedly , different values of t will be observed . Remark . Intuitively , the bias measures the systematic loss of a learning algorithm , and the vari- ance measures the prediction consistency of the learner over different training sets . Therefore , our robust federated learning framework has the following advantages : ( i ) it encourages the clients to consistently produce the optimal prediction for perturbed examples , thereby leading to a better generalization performance ; ( ii ) local adversarial training on perturbed examples allows to learn a robust local model , and thus a robust global model could be aggregated from clients . Theoretically , we could still have another alternative robust federated training strategy : min wk nkX i=1 max x̂ki 2⌦ ( xki ) L ( f ( x̂ki ; wk ) , t k i ) 8k 2 { 1 , 2 , · · · , K } ( 5 ) where the perturbed training examples of each client k is generated on local devices from Dk instead of transmitted from the server . This min-max formula is similar to ( Madry et al. , 2018 ; Tramèr et al. , 2018 ) where the inner maximization problem synthesizes the adversarial counterparts of clean examples , while the outer minimization problem finds the optimal model parameters over perturbed training examples . Thus , each local robust model is trained individually , nevertheless , poisoning attacks on device will largely increase the computational cost and memory usage . Meanwhile , it only considers the client-specific loss and is still vulnerable against adversarial examples with increasing communication rounds . Both phenomena are observed in our experiments ( see Fig . 4 and Fig . 5 ) .
The paper studies adversarial robustness in the context of federated learning. The authors provide an algorithm for adversarial training that generates adversarial examples on a trusted public dataset and iteratively sends them to the clients, so that they can perform learning on the adversarial examples as well. Notably, the adversarial examples are created by inspecting both the bias and the variance of the current set of models. The method is tested empirically on a wide range of datasets and compared to adversarial training using the local clients' data.
SP:385bf55e0a9bdb8a3f3db800f63acffcb4207927
Adversarially Robust Federated Learning for Neural Networks
In federated learning , data is distributed among local clients which collaboratively train a prediction model using secure aggregation . To preserve the privacy of the clients , the federated learning paradigm requires each client to maintain a private local training data set , and only uploads its summarized model updates to the server . In this work , we show that this paradigm could lead to a vulnerable model , which collapses in performance when the corrupted data samples ( under adversarial manipulations ) are used for prediction after model deployment . To improve model robustness , we first decompose the aggregation error of the central server into bias and variance , and then , propose a robust federated learning framework , named Fed BVA , that performs on-device adversarial training using the bias-variance oriented adversarial examples supplied by the server via asymmetrical communications . The experiments are conducted on multiple benchmark data sets using several prevalent neural network models , and the empirical results show that our framework is robust against white-box and black-box adversarial corruptions under both IID and non-IID settings . 1 INTRODUCTION . The explosive amount of decentralized user data collected from the ever-growing usage of smart devices , e.g. , smartphones , wearable devices , home sensors , etc. , has led to a surge of interest in the field of decentralized learning . To protect the privacy-sensitive data of the clients , federated learning ( McMahan et al. , 2017 ; Yang et al. , 2019 ) has been proposed . Federated learning only allows a group of clients to train local models using their own data , and then collectively merges the model updates on a central server using secure aggregation ( Acar et al. , 2018 ) . Due to its high privacy-preserving property , federated learning has attracted much attention in recent years along with the prevalence of efficient light-weight deep models ( Howard et al. , 2017 ) and low-cost network communications ( Wen et al. , 2017 ; Konečnỳ et al. , 2016 ) . In federated learning , the central server only inspects the secure aggregation of the local models as a whole . Consequently , it is susceptible to clients ’ corrupted updates ( e.g. , system failures , etc ) . Recently , multiple robust federated learning models ( Fang et al. , 2019 ; Pillutla et al. , 2019 ; Portnoy & Hendler , 2020 ; Mostafa , 2019 ) have been proposed . These works only focus on performing clientlevel robust training or designing server-level aggregation variants with hyper-parameter tuning for Byzantine failures . However , none of them have the ability to mitigate the federated learning ’ s vulnerability when the adversarial manipulations are present during testing , which as we shown in Section 4.1 that is mainly due to the generalization error in the model aggregation . Our work bridges this gap by investigating the error incurred during the aggregation of federated learning from the perspective of bias-variance decomposition ( Domingos , 2000 ; Valentini & Dietterich , 2004 ) . Specifically , we show that the generalization error of the aggregated model on the central server can be decomposed as the combination of bias ( triggered by the main prediction of these clients ) and variance ( triggered by the variations among clients ’ predictions ) . Next , we propose to perform the local robust training on clients by supplying them with a tiny amount of the bias-variance perturbed examples generated from the central server via asymmetrical communications . The experiments are conducted on neural networks with cross-entropy loss , however , other loss functions are also applicable as long as their gradients w.r.t . bias and variance are tractable to estimate . In this way , any gradient-based adversarial training strategies ( Goodfellow et al. , 2015 ; Madry et al. , 2018 ) could be used . Compared with previous work , our major contributions include : • We provide the exact solution of bias-variance analysis w.r.t . the generalization error which is perfectly suitable for neural network based federated learning . As a comparison , performing adversarial attacks or training with conventional federated learning methods will only focus on the bias of the central model but ignore the variance . • We demonstrate that the conventional federated learning framework is vulnerable to the strong attacking methods with increasing communication rounds even if the adversarial training using the locally generated adversarial examples is performed on each client . • Without violating the clients ’ privacy , we show that providing a tiny amount of bias-variance perturbed data from the central server to the clients through asymmetrical communication could dramatically improve the robustness of the training model under various settings . 2 PRELIMINARIES . 2.1 SETTINGS . In federated learning , there is a central server and K different clients , each with access to a private training set Dk = { ( xki , tki ) } nk i=1 , where x k i , tki , and nk are the features , label , and number of training examples in the kth client ( k = 1 , · · · , K ) . Each data Dk is exclusively owned by client k and will not be shared with the central server or other clients . In addition , there is a small public training set Ds = { ( xsj , tsj ) } ns j=1 with ns training examples from the server that is shared with clients , where ns ⌧ PK k=1 nk . Note that this will not break the privacy constraints , for example , hospitals ( local devices ) that contribute to a federated learned medical image diagnosis system could take a few publicly accessible images as additional inputs . The goal of federated learning is to train a global classifier f ( · ) using knowledge from all the clients such that it generalizes well over test data Dtest . The notation used in this paper is summarized in the Appendix ( see Table 4 ) . 2.2 PROBLEM DEFINITION . In this paper , we study the adversarial robustness of neural networks1 in federated learning setting , and we define robust decentralized learning as follows . Definition 2.1 . ( Adversarially Robust Federated Learning ) Input : ( 1 ) A set of private training data { Dk } Kk=1 on K different clients ; ( 2 ) Tiny amount of training data Ds on the central server ; ( 3 ) Learning algorithm f ( · ) and loss function L ( · , · ) . Output : A trained model on the central server that is robust against adversarial perturbation . We would like to point out that our problem definition has the following properties : Asymmetrical communication : The asymmetrical communication between each client and server cloud is allowed : the server provides both global model parameters and limited shared data to the clients ; while each client only uploads its local model parameters back to the server . Data distribution : All training examples on the clients and the server are assumed to follow the same data distribution . However , the experiments show that our proposed algorithm also achieves outstanding performance under the non-IID setting , which could be common among personalized clients in real scenarios . Shared learning algorithm : All the clients are assumed to use the identical model f ( · ) , including architectures as well as hyper-parameters ( e.g. , learning rate , local epochs , local batch size ) . Remark . The basic assumption of this problem setting is that the learning process is clean ( no malicious behaviors are observed during training ) , however , the intentionally generated adversarial poisoning data will be mixed with clean data during training . The eventual trained model being deployed on the devices will be robust against potential future adversarial attacks . 2.3 BIAS-VARIANCE TRADE-OFF . Following ( Domingos , 2000 ; Valentini & Dietterich , 2004 ) , we define the optimal prediction , main prediction as well as the bias , variance , and noise for any real-valued loss function L ( · , · ) as follows : Definition 2.2 . ( Optimal Prediction and Main Prediction ) Given loss function L ( · , · ) and learning algorithm f ( · ) , optimal prediction y⇤ and main prediction ym for an example are defined as : y⇤ ( x ) = argmin y Et [ L ( y , t ) ] and ym ( x ) = argmin y0 ED [ L ( fD ( x ) , y0 ) ] ( 1 ) where t and D are viewed as the random variables to denote the class label and training set , and fD denotes the model trained on D. In short , the main prediction is the prediction whose average loss relative to all the predictions over data distributions is minimum , e.g. , the main prediction for zeroone loss is the mode of predictions . In this work , we show that the main prediction is the average prediction of client models for mean squared ( MSE ) loss and cross-entropy ( CE ) loss in Section 4.1 . 1Our theoretical contribution mainly focuses on classification using neural networks with cross-entropy loss and mean squared loss . However , the proposed framework is generic to allow the use of other classification loss functions as well . Definition 2.3 . ( Bias , Variance and Noise ) Given a loss function L ( · , · ) and a learning algorithm f ( · ) , the expected loss ED , t [ L ( fD ( x ) , t ) ] for an example x can be decomposed2 into bias , variance and noise as follows : B ( x ) = L ( ym , y⇤ ) and V ( x ) = ED [ L ( fD ( x ) , ym ) ] and N ( x ) = Et [ L ( y⇤ , t ) ] ( 2 ) In short , bias is the loss incurred by the main prediction w.r.t . the optimal prediction , and variance is the average loss incurred by predictions w.r.t . the main prediction . Noise is conventionally assumed to be irreducible and independent to f ( · ) . Remark . Our definitions on optimal prediction , main prediction , bias , variance and noise slightly differ from previous ones ( Domingos , 2000 ; Valentini & Dietterich , 2004 ) . For example , conventional optimal prediction was defined as y⇤ ( x ) = argminy Et [ L ( t , y ) ] , and it is equivalent to our definition when loss function is symmetric over its arguments , i.e. , L ( y1 , y2 ) = L ( y2 , y1 ) . Note that this decomposition holds for any real-valued loss function in the binary setting ( Domingos , 2000 ) with a bias & variance trade-off coefficient that has a closed-form expression . For multi-class set- ting , we inherit their definition of bias & variance directly , and treat the trade-off coefficient as a hyper-parameter to tune because no closed-form expression of is available . 3 THE PROPOSED FRAMEWORK . A typical framework ( Kairouz et al. , 2019 ) of privacy-preserving federated learning can be summarized as follows : ( 1 ) Client Update : Each client updates local model parameters wk by minimizing the empirical loss over its own training set ; ( 2 ) Forward Communication : Each client uploads its model parameter update to the central server ; ( 3 ) Server Update : It synchronously aggregates the received parameters ; ( 4 ) Backward Communication : The global parameters are sent back to the clients . Our framework follows the same paradigm but with substantial modifications as below . Server Update . The server has two components : The first one uses FedAvg ( McMahan et al. , 2017 ) algorithm to aggregate the local models ’ parameters , i.e. , wG = Aggregate ( w1 , · · · , wK ) =PK k=1 nk n wk where n = PK k=1 nk and wk is the model parameters in the k th client . Meanwhile , another component is designed to produce adversarially perturbed examples which could be induced by a poisoning attack algorithm for the usage of robust adversarial training . It has been well studied ( Belkin et al. , 2019 ; Domingos , 2000 ; Valentini & Dietterich , 2004 ) that in the classification setting , the generalization error of a learning algorithm on an example is determined by the bias , variance , and irreducible noise as defined in Eq . ( 2 ) . Similar to the previous work , we also assume a noise-free learning scenario where the class label t is a deterministic function of x ( i.e. , if x is sampled repeatedly , the same values of its class t will be observed ) . This motivates us to generate the adversarial examples by attacking the bias and variance induced by clients ’ models as : max x̂2⌦ ( x ) B ( x̂ ; w1 , · · · , wK ) + V ( x̂ ; w1 , · · · , wK ) 8 ( x , t ) 2 Ds ( 3 ) where B ( x̂ ; w1 , · · · , wK ) and V ( x̂ ; w1 , · · · , wK ) could be empirically estimated from a finite number of clients ’ parameters trained on local training sets { D1 , D2 , · · · , DK } . Here is a hyperparameter to measure the trade-off of bias and variance , and ⌦ ( x ) is the perturbation constraint . Note that Ds ( on the server ) is the candidate subset of all available training examples that would lead to their perturbed counterparts . This is a more feasible setting as compared to generating adversarial examples on clients ’ devices because the server usually has much powerful computational capacity in real scenarios that allows the usage of flexible poisoning attack algorithms . In this case , both poisoned examples and server model parameters would be sent back to each client ( Backward Communication ) , while only clients ’ local parameters would be uploaded to the server ( Forward Communication ) , i.e. , the asymmetrical communication as discussed in Section 2.2 . Client Update . The robust training of one client ’ s prediction model ( i.e. , wk ) can be formulated as the following minimization problem . min wk 0 @ nkX i=1 L ( fDk ( x k i ; wk ) , t k i ) + nsX j=1 L ( fDk ( x̂ s j ; wk ) , t s j ) 1 A ( 4 ) where x̂sj 2 ⌦ ( xsj ) is the perturbed examples that is asymmetrically transmitted from the server . 2This decomposition is based on the weighted sum of bias , variance , and noise . In general , t is a non-deterministic function ( Domingos , 2000 ) of x when the irreducible noise is considered . Namely , if x is sampled repeatedly , different values of t will be observed . Remark . Intuitively , the bias measures the systematic loss of a learning algorithm , and the vari- ance measures the prediction consistency of the learner over different training sets . Therefore , our robust federated learning framework has the following advantages : ( i ) it encourages the clients to consistently produce the optimal prediction for perturbed examples , thereby leading to a better generalization performance ; ( ii ) local adversarial training on perturbed examples allows to learn a robust local model , and thus a robust global model could be aggregated from clients . Theoretically , we could still have another alternative robust federated training strategy : min wk nkX i=1 max x̂ki 2⌦ ( xki ) L ( f ( x̂ki ; wk ) , t k i ) 8k 2 { 1 , 2 , · · · , K } ( 5 ) where the perturbed training examples of each client k is generated on local devices from Dk instead of transmitted from the server . This min-max formula is similar to ( Madry et al. , 2018 ; Tramèr et al. , 2018 ) where the inner maximization problem synthesizes the adversarial counterparts of clean examples , while the outer minimization problem finds the optimal model parameters over perturbed training examples . Thus , each local robust model is trained individually , nevertheless , poisoning attacks on device will largely increase the computational cost and memory usage . Meanwhile , it only considers the client-specific loss and is still vulnerable against adversarial examples with increasing communication rounds . Both phenomena are observed in our experiments ( see Fig . 4 and Fig . 5 ) .
The authors propose a robust federated learning algorithm, where they assume that all samples are iid, and $n_s$ clean samples are available at the server side. The authors then go on to optimize a loss function that optimizes the aggregate loss and propose some new algorithms with experimental results. While overall the paper is interesting, there are several shortcomings in the execution as discussed below that the authors can address to improve the paper.
SP:385bf55e0a9bdb8a3f3db800f63acffcb4207927
Towards Data Distillation for End-to-end Spoken Conversational Question Answering
1 INTRODUCTION . Conversational Machine Reading Comprehension ( CMRC ) has been studied extensively over the past few years within the natural language processing ( NLP ) communities ( Zhu et al. , 2018 ; Liu et al. , 2019 ; Yang et al. , 2019 ) . Different from traditional MRC tasks , CMRC aims to enable models to learn the representation of the context paragraph and multi-turn dialogues . Existing methods to the conversational question answering ( QA ) tasks ( Huang et al. , 2018a ; Devlin et al. , 2018 ; Xu et al. , 2019 ; Gong et al. , 2020 ) have achieved superior performances on several benchmark datasets , such as QuAC ( Choi et al. , 2018 ) and CoQA ( Elgohary et al. , 2018 ) . However , few studies have investigated CMRC in both spoken content and text documents . To incorporate spoken content into machine comprehension , there are few public datasets that evaluate the effectiveness of the model in spoken question answering ( SQA ) scenarios . TOEFL listening comprehension ( Tseng et al. , 2016 ) is one of the related corpus for this task , an English test designed to evaluate the English language proficiency of non-native speakers . But the multi-choice question answering setting and its scale is limited to train for robust SCQA models . The rest two spoken question answering datasets are Spoken-SQuAD ( Li et al. , 2018 ) and ODSQA ( Lee et al. , 2018 ) , respectively . However , there is usually no connection between a series of questions and answers within the same spoken passage among these datasets . More importantly , the most common way people seek or test their knowledge is via human conversations , which capture and maintain the common ground in spoken and text context from the dialogue flow . There are many real-world applications related to SCQA tasks , such as voice assistant and chat robot . In recent years , neural network based methods have achieved promising progress in speech processing domain . Most existing works first select a feature extractor ( Gao et al. , 2019 ) , and then enroll the feature embedding into the state-of-the-art learning framework , as used in single-turn spoken language processing tasks such as speech retrieval ( Lee et al. , 2015 ; Fan-Jiang et al. , 2020 ; Karakos et al. , 2020 ) , translation ( Bérard et al. , 2016 ; Serdyuk et al. , 2018 ; Di Gangi et al. , 2020 ; Tu et al. , 2020 ) and recognition ( Zhang et al. , 2017 ; Zhou et al. , 2018 ; Bruguier et al. , 2019 ; Siriwardhana et al. , 2020 ) . However , simply adopting existing methods to the SCQA tasks will cause several challenges . First , transforming speech signals into ASR transcriptions is inevitably associated with ASR errors ( See Table 2 ) . Previous work ( Lee et al. , 2019 ) shows that directly feed the ASR output as the input for the following down-stream modules usually cause significant performance loss , especially in SQA tasks . Second , speech corresponds to a multi-turn conversation ( e.g . lectures , interview , meetings ) , thus the discourse structure will have more complex correlations between questions and answers than that of a monologue . Third , additional information , such as audio recordings , contains potentially valuable information in spoken form . Many QA systems may leverage kind of orality to generate better representations . Fourth , existing QA models are tailored for a specific ( text ) domain . For our SCQA tasks , it is crucial to guide the system to learn kind of orality in documents . In this work , we propose a new spoken conversational question answering task - SCQA , and introduce Spoken-CoQA , a spoken conversational question answering dataset to evaluate a QA system whether necessary to tackle the task of question answering on noisy speech transcripts and text document . We compare Spoken-CoQA with existing SQA datasets ( See Table 1 ) . Unlike existing SQA datasets , Spoken-CoQA is a multi-turn conversational SQA dataset , which is more challenging than single-turn benchmarks . First , every question is dependent on the conversation history in the Spoken-CoQA dataset . It is thus difficult for the machine to parse . Second , errors in ASR modules also degrade the performance of machines in tackling contextual understanding with context paragraph . To mitigate the effects of speech recognition errors , we then present a novel knowledge distillation ( KD ) method for spoken conversational question answering tasks . Our first intuition is speech utterances and text contents share the dual nature property , and we can take advantage of this property to learn these two forms of the correspondences . We enroll this knowledge into the student model , and then guide the student to unveil the bottleneck in noisy ASR outputs to boost performance . Empirical results show that our proposed DDNet achieves remarkable performance gains in SCQA tasks . To the best of our knowledge , we are the first work in spoken conversational machine reading comprehension tasks . In summary , the main contributions of this work are as follows : • We propose a new task for machine comprehension of spoken question-answering style conversation to improve the network performance . To the best of our knowledge , our Spoken-CoQA is the first spoken conversational machine reading comprehension dataset . • We develop a novel end-to-end method based on data distillation to learn both from speech and text domain . Specifically , we use the model trained on clear syntax and close-distance recording to guide the model trained on noisy ASR transcriptions to achieve substantial performance gains in prediction accuracy . • We demonstrate the robustness of our DDNet on Spoken-CoQA , and demonstrates that the model can effectively alleviate ASR errors in noisy conditions . 2 RELATED WORK . Conversational Machine Reading Comprehension In recent years , the natural language processing research community has devoted substantial efforts to conversational machine reading comprehension tasks ( Huang et al. , 2018a ; Zhu et al. , 2018 ; Xu et al. , 2019 ; Zhang et al. , 2020 ; Gong et al. , 2020 ) . Within the growing body of work on conversational machine reading comprehension , two signature attributes have emerged : the availability of large benchmark datasets ( Choi et al. , 2018 ; Elgohary et al. , 2018 ; Reddy et al. , 2019 ) and pre-trained language models ( Devlin et al. , 2018 ; Liu et al. , 2019 ; Lan et al. , 2020 ) . However , these existing works typically focus on modeling the complicated context dependency in text form . In contrast , we focus on enabling the machine to build the capability of language recognition and dialogue modeling in both speech and text domains . Spoken Question Answering In parallel to the recent works in natural language processing , these trends have also been pronounced in the speech processing ( SP ) field , where spoken question answering , an extended form of Question Answering , have explored the prospect of machine comprehension in spoken form . Previous work on SQA typically includes two separate modules : automatic speech recognition and text question answering . It entails transferring spoken content to ASR transcriptions , and then employs natural language processing techniques to handle the speech language processing tasks . Prior to this point , the existing methods ( Tseng et al. , 2016 ; Serdyuk et al. , 2018 ; Su & Fung , 2020 ) focus on optimizing each module in a two-stage manner , where errors in the ASR module would suffer from severe performance loss . Concurrent with our research , Serdyuk et al . ( 2018 ) proposes an end-to-end approach for natural language understanding ( NLU ) tasks . SpeechBERT ( Chuang et al. , 2019 ) cascades the BERT-based models as a unified model and then trains it in an audio-and-text jointly learned manner . However , the existing SQA methods aim at solving a single question given the related passage without building and maintaining the connections of different questions within the human conversations . Knowledge Distillation Hinton et al . ( 2015 ) introduces the idea of Knowledge Distillation ( KD ) in a teacher-student scenario . In other words , we can distill the knowledge from one model ( massive or teacher model ) to another ( small or student model ) . Previous work has shown that KD can significantly boost prediction accuracy in natural language processing and speech processing ( Kim & Rush , 2016 ; Hu et al. , 2018 ; Huang et al. , 2018b ; Hahn & Choi , 2019 ) , while adopting KD-based methods for SCQA tasks has been less explored . Although we share the same research topic and application , our research direction and methods differ . Previous methods design a unified model to model the single-turn speech-language task . In contrast , our model explores the prospect of handling SQA tasks . More importantly , we focus the question of nature property in speech and text : do spoken conversational dialogues can further assist the model to boost the performance . Finally , we incorporate the knowledge distillation framework to distill reliable dialogue flow from the spoken contexts , and utilize the learned predictions to guide the student model to train well on the noisy input data . 3 TASK DEFINITION . 3.1 DATA FORMAT . We introduce Spoken-CoQA , a new spoken conversational machine reading comprehension dataset where the documents are in the spoken and text form . Given the spoken multi-turn dialogues and spoken documents , the task is to answer questions in multi-party conversations . Each example in this dataset is defined as follows : { Di , Qi , Ai } N1 , where Qi= { qi1 , qi2 , ... , qiL } and Ai= { ai1 , ai2 , ... , aiL } represent a passage with L-turn queries and corresponding answers , respectively . Given a passage Di , multi-turn history questions { qi1 , qi2 , ... , qiL−1 } and the reference answers { ai1 , ai2 , ... , aiL−1 } , our goal is to generate aiL for the given current question qiL . In this study , we use the spoken form of questions and documents as the network input for training . Note that questions and documents ( passages ) in Spoken-CoQA are in both text and spoken forms , and answers are in the text form . 3.2 DATA COLLECTION . We detail the procedures to build Spoken-CoQA as follows . First , we select the conversational question-answering dataset CoQA ( Reddy et al. , 2019 ) since it is one of the largest public CMRC datasets . CoQA contains around 8k stories ( documents ) and over 120k questions with answers . The average dialogue length of CoQA is about 15 turns , and the answer is in free-form text . In CoQA , the training set and the development set contain 7,199 and 500 conversations over the given stories , respectively . Therefore , we use the CoQA training set as our reference text of the training set and the CoQA development set as the test set in Spoken-CoQA . Then we employ the Google text-to-speech system to transform questions and documents in CoQA into the spoken form . Next , we adopt CMU Sphinx to transcribe the processed spoken content into ASR transcriptions . As such , we collect more than 40G audio data , and the data duration is around 300 hours . It is worth to note that since the constructed dataset does not update the answer spans based on the noisy ASR text and continues to assume answer-spans as per the actual text , we perform data filtering in our investigation by eliminating question-answer pairs from the corpus if answer spans to questions do not exist in the referenced ASR transcriptions . For clarity , we provide an example of our Spoken-CoQA dataset in Table 2 . Figure 4 compares spectrograms of samples from ASR modules . In this example , we observe that given the text document ( ASR-document ) , the conversation starts with the question Q1 ( ASR-Q1 ) , and then the system requires to answer Q1 ( ASR-Q1 ) with A1 based on a contiguous text span R1 . Compared to the existing benchmark datasets , ASR transcripts ( both the document and questions ) are much more difficult for the machine to comprehend questions , reason among the passage , and even predict the correct answer .
This paper proposes a new task: spoken conversational question answering, which combines conversational question answering (e.g. CoQA) with spoken question answering (e.g. Spoken-SQuAD). The task is to answer a question (in written text) given a question that is given in both audio form and text form. They create a dataset for this task by combining CoQA with some off-the-shelf text-to-speech and speech-to-text models. They then propose a new model, DDNet, which obtains improved performance on their dataset.
SP:06c25da862ae69fa7cd0f87ea0b125243ea86f5f
Towards Data Distillation for End-to-end Spoken Conversational Question Answering
1 INTRODUCTION . Conversational Machine Reading Comprehension ( CMRC ) has been studied extensively over the past few years within the natural language processing ( NLP ) communities ( Zhu et al. , 2018 ; Liu et al. , 2019 ; Yang et al. , 2019 ) . Different from traditional MRC tasks , CMRC aims to enable models to learn the representation of the context paragraph and multi-turn dialogues . Existing methods to the conversational question answering ( QA ) tasks ( Huang et al. , 2018a ; Devlin et al. , 2018 ; Xu et al. , 2019 ; Gong et al. , 2020 ) have achieved superior performances on several benchmark datasets , such as QuAC ( Choi et al. , 2018 ) and CoQA ( Elgohary et al. , 2018 ) . However , few studies have investigated CMRC in both spoken content and text documents . To incorporate spoken content into machine comprehension , there are few public datasets that evaluate the effectiveness of the model in spoken question answering ( SQA ) scenarios . TOEFL listening comprehension ( Tseng et al. , 2016 ) is one of the related corpus for this task , an English test designed to evaluate the English language proficiency of non-native speakers . But the multi-choice question answering setting and its scale is limited to train for robust SCQA models . The rest two spoken question answering datasets are Spoken-SQuAD ( Li et al. , 2018 ) and ODSQA ( Lee et al. , 2018 ) , respectively . However , there is usually no connection between a series of questions and answers within the same spoken passage among these datasets . More importantly , the most common way people seek or test their knowledge is via human conversations , which capture and maintain the common ground in spoken and text context from the dialogue flow . There are many real-world applications related to SCQA tasks , such as voice assistant and chat robot . In recent years , neural network based methods have achieved promising progress in speech processing domain . Most existing works first select a feature extractor ( Gao et al. , 2019 ) , and then enroll the feature embedding into the state-of-the-art learning framework , as used in single-turn spoken language processing tasks such as speech retrieval ( Lee et al. , 2015 ; Fan-Jiang et al. , 2020 ; Karakos et al. , 2020 ) , translation ( Bérard et al. , 2016 ; Serdyuk et al. , 2018 ; Di Gangi et al. , 2020 ; Tu et al. , 2020 ) and recognition ( Zhang et al. , 2017 ; Zhou et al. , 2018 ; Bruguier et al. , 2019 ; Siriwardhana et al. , 2020 ) . However , simply adopting existing methods to the SCQA tasks will cause several challenges . First , transforming speech signals into ASR transcriptions is inevitably associated with ASR errors ( See Table 2 ) . Previous work ( Lee et al. , 2019 ) shows that directly feed the ASR output as the input for the following down-stream modules usually cause significant performance loss , especially in SQA tasks . Second , speech corresponds to a multi-turn conversation ( e.g . lectures , interview , meetings ) , thus the discourse structure will have more complex correlations between questions and answers than that of a monologue . Third , additional information , such as audio recordings , contains potentially valuable information in spoken form . Many QA systems may leverage kind of orality to generate better representations . Fourth , existing QA models are tailored for a specific ( text ) domain . For our SCQA tasks , it is crucial to guide the system to learn kind of orality in documents . In this work , we propose a new spoken conversational question answering task - SCQA , and introduce Spoken-CoQA , a spoken conversational question answering dataset to evaluate a QA system whether necessary to tackle the task of question answering on noisy speech transcripts and text document . We compare Spoken-CoQA with existing SQA datasets ( See Table 1 ) . Unlike existing SQA datasets , Spoken-CoQA is a multi-turn conversational SQA dataset , which is more challenging than single-turn benchmarks . First , every question is dependent on the conversation history in the Spoken-CoQA dataset . It is thus difficult for the machine to parse . Second , errors in ASR modules also degrade the performance of machines in tackling contextual understanding with context paragraph . To mitigate the effects of speech recognition errors , we then present a novel knowledge distillation ( KD ) method for spoken conversational question answering tasks . Our first intuition is speech utterances and text contents share the dual nature property , and we can take advantage of this property to learn these two forms of the correspondences . We enroll this knowledge into the student model , and then guide the student to unveil the bottleneck in noisy ASR outputs to boost performance . Empirical results show that our proposed DDNet achieves remarkable performance gains in SCQA tasks . To the best of our knowledge , we are the first work in spoken conversational machine reading comprehension tasks . In summary , the main contributions of this work are as follows : • We propose a new task for machine comprehension of spoken question-answering style conversation to improve the network performance . To the best of our knowledge , our Spoken-CoQA is the first spoken conversational machine reading comprehension dataset . • We develop a novel end-to-end method based on data distillation to learn both from speech and text domain . Specifically , we use the model trained on clear syntax and close-distance recording to guide the model trained on noisy ASR transcriptions to achieve substantial performance gains in prediction accuracy . • We demonstrate the robustness of our DDNet on Spoken-CoQA , and demonstrates that the model can effectively alleviate ASR errors in noisy conditions . 2 RELATED WORK . Conversational Machine Reading Comprehension In recent years , the natural language processing research community has devoted substantial efforts to conversational machine reading comprehension tasks ( Huang et al. , 2018a ; Zhu et al. , 2018 ; Xu et al. , 2019 ; Zhang et al. , 2020 ; Gong et al. , 2020 ) . Within the growing body of work on conversational machine reading comprehension , two signature attributes have emerged : the availability of large benchmark datasets ( Choi et al. , 2018 ; Elgohary et al. , 2018 ; Reddy et al. , 2019 ) and pre-trained language models ( Devlin et al. , 2018 ; Liu et al. , 2019 ; Lan et al. , 2020 ) . However , these existing works typically focus on modeling the complicated context dependency in text form . In contrast , we focus on enabling the machine to build the capability of language recognition and dialogue modeling in both speech and text domains . Spoken Question Answering In parallel to the recent works in natural language processing , these trends have also been pronounced in the speech processing ( SP ) field , where spoken question answering , an extended form of Question Answering , have explored the prospect of machine comprehension in spoken form . Previous work on SQA typically includes two separate modules : automatic speech recognition and text question answering . It entails transferring spoken content to ASR transcriptions , and then employs natural language processing techniques to handle the speech language processing tasks . Prior to this point , the existing methods ( Tseng et al. , 2016 ; Serdyuk et al. , 2018 ; Su & Fung , 2020 ) focus on optimizing each module in a two-stage manner , where errors in the ASR module would suffer from severe performance loss . Concurrent with our research , Serdyuk et al . ( 2018 ) proposes an end-to-end approach for natural language understanding ( NLU ) tasks . SpeechBERT ( Chuang et al. , 2019 ) cascades the BERT-based models as a unified model and then trains it in an audio-and-text jointly learned manner . However , the existing SQA methods aim at solving a single question given the related passage without building and maintaining the connections of different questions within the human conversations . Knowledge Distillation Hinton et al . ( 2015 ) introduces the idea of Knowledge Distillation ( KD ) in a teacher-student scenario . In other words , we can distill the knowledge from one model ( massive or teacher model ) to another ( small or student model ) . Previous work has shown that KD can significantly boost prediction accuracy in natural language processing and speech processing ( Kim & Rush , 2016 ; Hu et al. , 2018 ; Huang et al. , 2018b ; Hahn & Choi , 2019 ) , while adopting KD-based methods for SCQA tasks has been less explored . Although we share the same research topic and application , our research direction and methods differ . Previous methods design a unified model to model the single-turn speech-language task . In contrast , our model explores the prospect of handling SQA tasks . More importantly , we focus the question of nature property in speech and text : do spoken conversational dialogues can further assist the model to boost the performance . Finally , we incorporate the knowledge distillation framework to distill reliable dialogue flow from the spoken contexts , and utilize the learned predictions to guide the student model to train well on the noisy input data . 3 TASK DEFINITION . 3.1 DATA FORMAT . We introduce Spoken-CoQA , a new spoken conversational machine reading comprehension dataset where the documents are in the spoken and text form . Given the spoken multi-turn dialogues and spoken documents , the task is to answer questions in multi-party conversations . Each example in this dataset is defined as follows : { Di , Qi , Ai } N1 , where Qi= { qi1 , qi2 , ... , qiL } and Ai= { ai1 , ai2 , ... , aiL } represent a passage with L-turn queries and corresponding answers , respectively . Given a passage Di , multi-turn history questions { qi1 , qi2 , ... , qiL−1 } and the reference answers { ai1 , ai2 , ... , aiL−1 } , our goal is to generate aiL for the given current question qiL . In this study , we use the spoken form of questions and documents as the network input for training . Note that questions and documents ( passages ) in Spoken-CoQA are in both text and spoken forms , and answers are in the text form . 3.2 DATA COLLECTION . We detail the procedures to build Spoken-CoQA as follows . First , we select the conversational question-answering dataset CoQA ( Reddy et al. , 2019 ) since it is one of the largest public CMRC datasets . CoQA contains around 8k stories ( documents ) and over 120k questions with answers . The average dialogue length of CoQA is about 15 turns , and the answer is in free-form text . In CoQA , the training set and the development set contain 7,199 and 500 conversations over the given stories , respectively . Therefore , we use the CoQA training set as our reference text of the training set and the CoQA development set as the test set in Spoken-CoQA . Then we employ the Google text-to-speech system to transform questions and documents in CoQA into the spoken form . Next , we adopt CMU Sphinx to transcribe the processed spoken content into ASR transcriptions . As such , we collect more than 40G audio data , and the data duration is around 300 hours . It is worth to note that since the constructed dataset does not update the answer spans based on the noisy ASR text and continues to assume answer-spans as per the actual text , we perform data filtering in our investigation by eliminating question-answer pairs from the corpus if answer spans to questions do not exist in the referenced ASR transcriptions . For clarity , we provide an example of our Spoken-CoQA dataset in Table 2 . Figure 4 compares spectrograms of samples from ASR modules . In this example , we observe that given the text document ( ASR-document ) , the conversation starts with the question Q1 ( ASR-Q1 ) , and then the system requires to answer Q1 ( ASR-Q1 ) with A1 based on a contiguous text span R1 . Compared to the existing benchmark datasets , ASR transcripts ( both the document and questions ) are much more difficult for the machine to comprehend questions , reason among the passage , and even predict the correct answer .
In this paper, the authors release a new dataset - Spoken-CoQA which includes an ASR based version of the popular CoQA dataset. The dataset has been created by running the Google TTS system followed by ASR using CMU Sphinx, to create a speech-transcribed versions of the dataset. The dataset includes the corresponding TTS audio recordings. Since the transcribed dataset has transcription errors, existing reading comprehension models do not work well. Thus, the paper introduces a joint audio-textual model for QA on the Spoken-CoQA dataset that uses TTS recordings its corresponding ASR output.
SP:06c25da862ae69fa7cd0f87ea0b125243ea86f5f
Personalized Federated Learning with First Order Model Optimization
1 INTRODUCTION . Federated learning ( FL ) has shown great promise in recent years for training a single global model over decentralized data . While seminally motivated by effective inference on a general test set similar in distribution to the decentralized data in aggregate ( McMahan et al. , 2016 ; Bonawitz et al. , 2019 ) , here we focus on federated learning from a client-centric or personalized perspective . We aim to enable stronger performance on personalized target distributions for each participating client . Such settings can be motivated by cross-silo FL , where clients are autonomous data vendors ( e.g . hospitals managing patient data , or corporations carrying customer information ) that wish to collaborate without sharing private data ( Kairouz et al. , 2019 ) . Instead of merely being a source of data and model training for the global server , clients can then take on a more active role : their federated participation may be contingent on satisfying client-specific target tasks and distributions . A strong FL framework in practice would then flexibly accommodate these objectives , allowing clients to optimize for arbitrary distributions simultaneously in a single federation . In this setting , FL ’ s realistic lack of an independent and identically distributed ( IID ) data assumption across clients may be both a burden and a blessing . Learning a single global model across non-IID data batches can pose challenges such as non-guaranteed convergence and model parameter divergence ( Hsieh et al. , 2019 ; Zhao et al. , 2018 ; Li et al. , 2020 ) . Furthermore , trying to fine-tune these global models may result in poor adaptation to local client test sets ( Jiang et al. , 2019 ) . However , the non-IID nature of each client ’ s local data can also provide useful signal for distinguishing their underlying local data distributions , without sharing any data . We leverage this signal to propose a new framework for personalized FL . Instead of giving all clients the same global model average weighted by local training size as in prior work ( McMahan et al. , 2016 ) , for each client we compute ∗Corresponding author ; work done while interning at NVIDIA a weighted combination of the available models to best align with that client ’ s interests , modeled by evaluation on a personalized target test distribution . Key here is that after each federating round , we maintain the client-uploaded parameters individually , allowing clients in the next round to download these copies independently of each other . Each federated update is then a two-step process : given a local objective , clients ( 1 ) evaluate how well their received models perform on their target task and ( 2 ) use these respective performances to weight each model ’ s parameters in a personalized update . We show that this intuitive process can be thought of as a particularly coarse version of popular iterative optimization algorithms such as SGD , where instead of directly accessing other clients ’ data points and iteratively training our model with the granularity of gradient decent , we limit ourselves to working with their uploaded models . We hence propose an efficient method to calculate these optimal combinations for each client , calling it FedFomo , as ( 1 ) each client ’ s federated update is calculated with a simple first-order model optimization approximating a personalized gradient step , and ( 2 ) it draws inspiration from the “ fear of missing out ” , every client no longer necessarily factoring in contributions from all active clients during each federation round . In other words , curiosity can kill the cat . Each model ’ s personalized performance can be saved however by restricting unhelpful models from each federated update . We evaluate our method on federated image classification and show that it outperforms other methods in various non-IID scenarios . Furthermore , we show that because we compute federated updates directly with respect to client-specified local objectives , our framework can also optimize for outof-distribution performance , where client ’ s target distributions are different from their local training ones . In contrast , prior work that personalized based on similarity to a client ’ s own model parameters ( Mansour et al. , 2020 ; Sattler et al. , 2020 ) restricts this optimization to the local data distribution . We thus enable new features in personalized FL , and empirically demonstrate up to 70 % improvement in some settings , with larger gains as the number of clients or level of non-IIDness increases . Our contributions . 1 . We propose a flexible federated learning framework that allows clients to personalize to specific target data distributions irrespective of their available local training data . 2 . Within this framework , we introduce a method to efficiently calculate the optimal weighted combination of uploaded models as a personalized federated update 3 . Our method strongly outperforms other methods in non-IID federated learning settings . 2 RELATED WORK . Federated Learning with Non-IID Data While fine-tuning a global model on a client ’ s local data is a natural strategy to personalize ( Mansour et al. , 2020 ; Wang et al. , 2019 ) , prior work has shown that non-IID decentralized data can introduce challenges such as parameter divergence ( Zhao et al. , 2018 ) , data distribution biases ( Hsieh et al. , 2019 ) , and unguaranteed convergence Li et al . ( 2020 ) . Several recent methods then try to improve the robustness of global models under heavily non-IID datasets . FedProx ( Li et al. , 2020 ) adds a proximal term to the local training objective to keep updated parameter close to the original downloaded model . This serves to reduce potential weight divergence defined in Zhao et al . ( 2018 ) , who instead allow clients to share small subsets of their data among each other . This effectively makes each client ’ s local training set closer in distribution to the global test set . More recently , Hsu et al . ( 2019 ) propose to add momentum to the global model update in FedAvgM to reduce the possibly harmful oscillations associated with averaging local models after several rounds of stochastic gradient descent for non-identically distributed data . While these advances may make a global model more robust across non-IID local data , they do not directly address local-level data distribution performance relevant to individual clients . Jiang et al . ( 2019 ) argue this latter task may be more important in non-IID FL settings , as local training data differences may suggest that only a subset of all potential features are relevant to each client . Their target distributions may be fairly different from the global aggregate in highly personalized scenarios , with the resulting dataset shift difficult to handle with a single model . Personalized Federated Learning Given the challenges above , other approaches train multiple models or personalizing components to tackle multiple target distributions . Smith et al . ( 2017 ) propose multi-task learning for FL with MOCHA , a distributed MTL framework that frames clients as tasks and learns one model per client . Mixture methods ( Deng et al. , 2020 ; Hanzely & Richtárik , 2020 ; Mansour et al. , 2020 ) compute personalized combinations of model parameters from training both local models and the global model , while Peterson et al . ( 2019 ) ensure that this is done with local privacy guarantees . Liang et al . ( 2020 ) apply this mixing across network layers , with lower layers acting as local encoders that map a client ’ s observed data to input for a globally shared classifier . Rather than only mix with a shared global model , our work allows for greater control and distinct mixing parameters with multiple local models . Fallah et al . ( 2020 ) instead optimize the global model for fast personalization through meta-learning , while T Dinh et al . ( 2020 ) train global and local models under regularization with Moreau envelopes . Alternatively , Clustered FL ( Sattler et al. , 2020 ; Ghosh et al. , 2020 ; Briggs et al. , 2020 ; Mansour et al. , 2020 ) assumes that inherent partitions or data distributions exist behind clients ’ local data , and aim to cluster these partitions to federate within each cluster . Our work does not restrict which models are computed together , allowing clients to download suitable models independently . We also compute client-specific weighted averages for greater personalization . Finally , unlike prior work , we allow clients to receive personalized updates for target distributions different from their local training data . 3 FEDERATED FIRST ORDER MODEL OPTIMIZATION . We now present FedFomo , a personalized FL framework to efficiently compute client-optimizing federated updates . We adopt the general structure of most FL methods , where we iteratively cycle between downloading model parameters from server to client , training the models locally on each client ’ s data , and sending back the updated models for future rounds . However , as we do not compute a single global model , each federated download introduces two new steps : ( 1 ) figuring out which models to send to which clients , and ( 2 ) computing their personalized weighted combinations . We define our problem and describe how we accomplish ( 1 ) and ( 2 ) in the following sections . Problem Definition and Notation Our work most naturally applies to heterogeneous federated settings where participating clients are critically not restricted to single local training or target test distribution , and apriori we do not know anything about these distributions . To model this , let C be a population with |C| = K total clients , where each client ci ∈ C carries local data Di sampled from some distribution D and local model parameters θ ` ( t ) i during any round t. Each ci also maintains some personalized objective or task Ti motivating their participation in the federation . We focus on supervised classification as a universal task setting . Each client and task are then associated with a test dataset Dtesti ∼ D∗ . We define each Ti : = minL ( θ ` ( t ) i ; D test i ) , where L ( θ ; D ) : Θ 7→ R is the loss function associated with dataset D , and Θ denotes the space of models possible with our presumed network architecture . We assume no knowledge regarding clients and their data distributions , nor that test and local data belong to the same distribution . We aim to obtain the optimal set of model parameters { θ∗1 , . . . , θ∗K } = arg min ∑ i∈ [ K ] LTi ( θi ) . 3.1 COMPUTING FEDERATED UPDATES WITH FOMO . Unlike previous work in federated learning , FedFomo learns optimal combinations of the available server models for each participating client . To do so , we leverage information from clients in two different ways . First , we aim to directly optimize for each client ’ s target objective . We assume that clients can distinguish between good and bad models on their target tasks , through the use of a labeled validation data split Dvali ⊂ Di in the client ’ s local data . Dvali should be similar in distribution to the target test dataset Dtesti . The client can then evaluate any arbitrary model θj on this validation set , and quantify the performance through the computed loss , denoted by Li ( θj ) . Second , we directly leverage the potential heterogeneity among client models . Zhao et al . ( 2018 ) explore this phenomenon as a failure mode for traditional single model FL , where they show that diverging model weights come directly from local data heterogeneity . However , instead of combining these parameters into a single global model , we maintain the uploaded models individually as a means to preserve a model ’ s potential contribution to another client . Critically , these two ideas together not only allow us to compute more personal model updates within non-IID local data distributions , but also enable clients to optimize for data distributions different from their own local data ’ s . Federated learning as an iterative local model update The central premise of our work stems from viewing each federated model download−and subsequent changing of local model parameters−as an optimization step towards some objective . In traditional FL , this objective involves performing well on the global population distribution , similar in representation to the union of all local datasets . Assuming N federating clients , we compute each global model θG at time t as : θG ( t ) = ∑N n=1 wn · θ ` ( t ) n , where wn = |Dtrainn |/ ∑N j=1 |Dtrainj | . If client ci downloads this model , we can view this change to their local model as an update : θ ` ( t+1 ) i ← θ ` ( t ) i + ∑N n=1 wn· ( θ ` ( t ) n −θ ` ( t ) i ) since ∑ n wn = 1 . This then updates a client ’ s current local model parameters in directions specified by the weights w and models { θn } in the federation . A natural choice to optimize for the global target distribution sets wn as above and in McMahan et al . ( 2017 ) , e.g . as an unbiased estimate of global model parameters . However , in our personalized scenario , we are more interested in computing the update uniquely with respect to each client ’ s target task . We then wish to find the optimal weights w = 〈w1 , . . . , wN 〉 that optimize for the client ’ s objective , minimizing Li ( θ ` i ) . Efficient personalization with FedFomo Intuitively , we wish to find models { θ ` ( t ) m : m ∈ [ N ] \i } such that moving towards their parameters leads to better performance on our target distribution , and accordingly weight these θ higher in a model average . If a client carries a satisfying number of local data points associated with their target objective Li , then they could obtain a reasonable model through local training alone , e.g . directly updating their model parameters through SGD : θ ` ( t+1 ) i ← θ ` ( t ) i − α∇θLi ( θ ` ( t ) i ) ( 1 ) However , without this data , clients are more motivated to federate . In doing so they obtain useful updates , albeit in the more restricted form of fixed model parameters { θn : n ∈ N } . Then for personalized or non-IID target distributions , we can iteratively solve for the optimal combination of client models w∗ = arg minLi ( θ ) by computing : θ ` ( t+1 ) i ← θ ` ( t ) i − α1 > ∇wLi ( θ ` ( t ) i ) ( 2 ) where 1 is a size-N vector of ones . Unfortunately , as the larger federated learning algorithm is already an iterative process with many rounds of communication , computing w∗ through Eq . 2 may be cumbersome . Worse , if the model averages are only computed server-side as in traditional FL , Eq . 2 becomes prohibitively expensive in communication rounds ( McMahan et al. , 2017 ) . Following this line of reasoning however , we thus derive an approximation of w∗ for any client : Given previous local model parameters θ ` ( t−1 ) i , set of fellow federating models available to download { θ ` ( t ) n } and local client objective captured by Li , we propose weights of the form : wn = Li ( θ ` ( t−1 ) i ) − Li ( θ ` ( t ) n ) ‖θ ` ( t ) n − θ ` ( t−1 ) i ‖ ( 3 ) where the resulting federated update θ ` ( t ) i ← θ ` ( t−1 ) i + ∑ n∈ [ N ] wn ( θ ` ( t ) n −θ ` ( t−1 ) i ) directly optimizes for client ci ’ s objective up to a first-order approximation of the optimal w∗ . We default to the original parameters θ ` ( t−1 ) i if wn < 0 above , i.e . wn = max ( wn , 0 ) , and among positive wn normalize to get final weights w∗n = max ( wn,0 ) ∑ n max ( wn,0 ) to maintain w∗ ∈ [ 0 , 1 ] and ∑ n=1 w ∗ n ∈ { 0 , 1 } . We derive Eq . 3 as a first-order approximation of w∗ in Appendix A.1 . Here we note that our formulation captures the intuition of federating with client models that perform better than our own model , e.g . have a smaller loss on Li . Moreso , we weigh models more heavily as this positive loss delta increases , or the distance between our current parameters and theirs decreases , in essence most heavily weighing the models that most efficiently improve our performance . We use local parameters at t-1 to directly compute how much we should factor in current parameters θ ` ( t ) i , which also helps prevent overfitting as Li ( θ ` ( t−1 ) i ) − Li ( θ ` ( t ) i ) < 0 causes “ early-stopping ” at θ ` ( t−1 ) i . Communication and bandwidth overhead Because the server can send multiple requested models in one download to any client , we still maintain one round of communication for model downloads and one round for uploads in between E local training epochs . Furthermore , because w in Eq . 3 is simple to calculate , the actual model update can also happen client-side , keeping the total number of communications with T total training epochs at b 2TE c , as in FedAvg . However FedFomo also needs to consider the additional bandwidth from downloading multiple models . While quantization and distillation ( Chen et al. , 2017 ; Hinton et al. , 2015 ; Xu et al. , 2018 ) can alleviate this , we also avoid worst case N2 overhead with respect to the number of active clients N by restricting the number of models downloaded M . Whether we can achieve good personalization here involves figuring out which models benefit which clients , and our goal is then to send as many helpful models as possible given limited bandwidth . To do so , we invoke a sampling scheme where the likelihood of sending model θj to client ci relies on how well θj performed regarding client ci ’ s target objective in previous rounds . Accordingly , we maintain an affinity matrix P composed of vectors pi = 〈pi,1 , . . . , pi , K〉 , where pi , j measures the likelihood of sending θj to client ci , and at each round send the available uploaded models corresponding to the top M values according to each participating client ’ s p. Initially we set P = diag ( 1 , . . . , 1 ) , i.e . each model has an equal chance of being downloaded . Then during each federated update , we update p← p + w from Eq . 3 , where w can now be negative . If N K , we may benefit from additional exploration , and employ an ε-greedy sampling strategy where instead of picking strictly in order of p , we have ε chance to send a random model to the client . We investigate the robustness of FedFomo to these parameters through ablations of ε and M in the next section .
**Paper Summary:** The paper addresses an important topic in federated learning which is personalization. The authors propose a two steps process to achieve the personalization: 1. Figuring out which models to send to which clients; 2. Computing their personalized weighted combinations for each client. To determine the weights, the authors use first order approximation.
SP:f55167c38de1d6b8528b2d4ef865f5e2e87a5bdc
Personalized Federated Learning with First Order Model Optimization
1 INTRODUCTION . Federated learning ( FL ) has shown great promise in recent years for training a single global model over decentralized data . While seminally motivated by effective inference on a general test set similar in distribution to the decentralized data in aggregate ( McMahan et al. , 2016 ; Bonawitz et al. , 2019 ) , here we focus on federated learning from a client-centric or personalized perspective . We aim to enable stronger performance on personalized target distributions for each participating client . Such settings can be motivated by cross-silo FL , where clients are autonomous data vendors ( e.g . hospitals managing patient data , or corporations carrying customer information ) that wish to collaborate without sharing private data ( Kairouz et al. , 2019 ) . Instead of merely being a source of data and model training for the global server , clients can then take on a more active role : their federated participation may be contingent on satisfying client-specific target tasks and distributions . A strong FL framework in practice would then flexibly accommodate these objectives , allowing clients to optimize for arbitrary distributions simultaneously in a single federation . In this setting , FL ’ s realistic lack of an independent and identically distributed ( IID ) data assumption across clients may be both a burden and a blessing . Learning a single global model across non-IID data batches can pose challenges such as non-guaranteed convergence and model parameter divergence ( Hsieh et al. , 2019 ; Zhao et al. , 2018 ; Li et al. , 2020 ) . Furthermore , trying to fine-tune these global models may result in poor adaptation to local client test sets ( Jiang et al. , 2019 ) . However , the non-IID nature of each client ’ s local data can also provide useful signal for distinguishing their underlying local data distributions , without sharing any data . We leverage this signal to propose a new framework for personalized FL . Instead of giving all clients the same global model average weighted by local training size as in prior work ( McMahan et al. , 2016 ) , for each client we compute ∗Corresponding author ; work done while interning at NVIDIA a weighted combination of the available models to best align with that client ’ s interests , modeled by evaluation on a personalized target test distribution . Key here is that after each federating round , we maintain the client-uploaded parameters individually , allowing clients in the next round to download these copies independently of each other . Each federated update is then a two-step process : given a local objective , clients ( 1 ) evaluate how well their received models perform on their target task and ( 2 ) use these respective performances to weight each model ’ s parameters in a personalized update . We show that this intuitive process can be thought of as a particularly coarse version of popular iterative optimization algorithms such as SGD , where instead of directly accessing other clients ’ data points and iteratively training our model with the granularity of gradient decent , we limit ourselves to working with their uploaded models . We hence propose an efficient method to calculate these optimal combinations for each client , calling it FedFomo , as ( 1 ) each client ’ s federated update is calculated with a simple first-order model optimization approximating a personalized gradient step , and ( 2 ) it draws inspiration from the “ fear of missing out ” , every client no longer necessarily factoring in contributions from all active clients during each federation round . In other words , curiosity can kill the cat . Each model ’ s personalized performance can be saved however by restricting unhelpful models from each federated update . We evaluate our method on federated image classification and show that it outperforms other methods in various non-IID scenarios . Furthermore , we show that because we compute federated updates directly with respect to client-specified local objectives , our framework can also optimize for outof-distribution performance , where client ’ s target distributions are different from their local training ones . In contrast , prior work that personalized based on similarity to a client ’ s own model parameters ( Mansour et al. , 2020 ; Sattler et al. , 2020 ) restricts this optimization to the local data distribution . We thus enable new features in personalized FL , and empirically demonstrate up to 70 % improvement in some settings , with larger gains as the number of clients or level of non-IIDness increases . Our contributions . 1 . We propose a flexible federated learning framework that allows clients to personalize to specific target data distributions irrespective of their available local training data . 2 . Within this framework , we introduce a method to efficiently calculate the optimal weighted combination of uploaded models as a personalized federated update 3 . Our method strongly outperforms other methods in non-IID federated learning settings . 2 RELATED WORK . Federated Learning with Non-IID Data While fine-tuning a global model on a client ’ s local data is a natural strategy to personalize ( Mansour et al. , 2020 ; Wang et al. , 2019 ) , prior work has shown that non-IID decentralized data can introduce challenges such as parameter divergence ( Zhao et al. , 2018 ) , data distribution biases ( Hsieh et al. , 2019 ) , and unguaranteed convergence Li et al . ( 2020 ) . Several recent methods then try to improve the robustness of global models under heavily non-IID datasets . FedProx ( Li et al. , 2020 ) adds a proximal term to the local training objective to keep updated parameter close to the original downloaded model . This serves to reduce potential weight divergence defined in Zhao et al . ( 2018 ) , who instead allow clients to share small subsets of their data among each other . This effectively makes each client ’ s local training set closer in distribution to the global test set . More recently , Hsu et al . ( 2019 ) propose to add momentum to the global model update in FedAvgM to reduce the possibly harmful oscillations associated with averaging local models after several rounds of stochastic gradient descent for non-identically distributed data . While these advances may make a global model more robust across non-IID local data , they do not directly address local-level data distribution performance relevant to individual clients . Jiang et al . ( 2019 ) argue this latter task may be more important in non-IID FL settings , as local training data differences may suggest that only a subset of all potential features are relevant to each client . Their target distributions may be fairly different from the global aggregate in highly personalized scenarios , with the resulting dataset shift difficult to handle with a single model . Personalized Federated Learning Given the challenges above , other approaches train multiple models or personalizing components to tackle multiple target distributions . Smith et al . ( 2017 ) propose multi-task learning for FL with MOCHA , a distributed MTL framework that frames clients as tasks and learns one model per client . Mixture methods ( Deng et al. , 2020 ; Hanzely & Richtárik , 2020 ; Mansour et al. , 2020 ) compute personalized combinations of model parameters from training both local models and the global model , while Peterson et al . ( 2019 ) ensure that this is done with local privacy guarantees . Liang et al . ( 2020 ) apply this mixing across network layers , with lower layers acting as local encoders that map a client ’ s observed data to input for a globally shared classifier . Rather than only mix with a shared global model , our work allows for greater control and distinct mixing parameters with multiple local models . Fallah et al . ( 2020 ) instead optimize the global model for fast personalization through meta-learning , while T Dinh et al . ( 2020 ) train global and local models under regularization with Moreau envelopes . Alternatively , Clustered FL ( Sattler et al. , 2020 ; Ghosh et al. , 2020 ; Briggs et al. , 2020 ; Mansour et al. , 2020 ) assumes that inherent partitions or data distributions exist behind clients ’ local data , and aim to cluster these partitions to federate within each cluster . Our work does not restrict which models are computed together , allowing clients to download suitable models independently . We also compute client-specific weighted averages for greater personalization . Finally , unlike prior work , we allow clients to receive personalized updates for target distributions different from their local training data . 3 FEDERATED FIRST ORDER MODEL OPTIMIZATION . We now present FedFomo , a personalized FL framework to efficiently compute client-optimizing federated updates . We adopt the general structure of most FL methods , where we iteratively cycle between downloading model parameters from server to client , training the models locally on each client ’ s data , and sending back the updated models for future rounds . However , as we do not compute a single global model , each federated download introduces two new steps : ( 1 ) figuring out which models to send to which clients , and ( 2 ) computing their personalized weighted combinations . We define our problem and describe how we accomplish ( 1 ) and ( 2 ) in the following sections . Problem Definition and Notation Our work most naturally applies to heterogeneous federated settings where participating clients are critically not restricted to single local training or target test distribution , and apriori we do not know anything about these distributions . To model this , let C be a population with |C| = K total clients , where each client ci ∈ C carries local data Di sampled from some distribution D and local model parameters θ ` ( t ) i during any round t. Each ci also maintains some personalized objective or task Ti motivating their participation in the federation . We focus on supervised classification as a universal task setting . Each client and task are then associated with a test dataset Dtesti ∼ D∗ . We define each Ti : = minL ( θ ` ( t ) i ; D test i ) , where L ( θ ; D ) : Θ 7→ R is the loss function associated with dataset D , and Θ denotes the space of models possible with our presumed network architecture . We assume no knowledge regarding clients and their data distributions , nor that test and local data belong to the same distribution . We aim to obtain the optimal set of model parameters { θ∗1 , . . . , θ∗K } = arg min ∑ i∈ [ K ] LTi ( θi ) . 3.1 COMPUTING FEDERATED UPDATES WITH FOMO . Unlike previous work in federated learning , FedFomo learns optimal combinations of the available server models for each participating client . To do so , we leverage information from clients in two different ways . First , we aim to directly optimize for each client ’ s target objective . We assume that clients can distinguish between good and bad models on their target tasks , through the use of a labeled validation data split Dvali ⊂ Di in the client ’ s local data . Dvali should be similar in distribution to the target test dataset Dtesti . The client can then evaluate any arbitrary model θj on this validation set , and quantify the performance through the computed loss , denoted by Li ( θj ) . Second , we directly leverage the potential heterogeneity among client models . Zhao et al . ( 2018 ) explore this phenomenon as a failure mode for traditional single model FL , where they show that diverging model weights come directly from local data heterogeneity . However , instead of combining these parameters into a single global model , we maintain the uploaded models individually as a means to preserve a model ’ s potential contribution to another client . Critically , these two ideas together not only allow us to compute more personal model updates within non-IID local data distributions , but also enable clients to optimize for data distributions different from their own local data ’ s . Federated learning as an iterative local model update The central premise of our work stems from viewing each federated model download−and subsequent changing of local model parameters−as an optimization step towards some objective . In traditional FL , this objective involves performing well on the global population distribution , similar in representation to the union of all local datasets . Assuming N federating clients , we compute each global model θG at time t as : θG ( t ) = ∑N n=1 wn · θ ` ( t ) n , where wn = |Dtrainn |/ ∑N j=1 |Dtrainj | . If client ci downloads this model , we can view this change to their local model as an update : θ ` ( t+1 ) i ← θ ` ( t ) i + ∑N n=1 wn· ( θ ` ( t ) n −θ ` ( t ) i ) since ∑ n wn = 1 . This then updates a client ’ s current local model parameters in directions specified by the weights w and models { θn } in the federation . A natural choice to optimize for the global target distribution sets wn as above and in McMahan et al . ( 2017 ) , e.g . as an unbiased estimate of global model parameters . However , in our personalized scenario , we are more interested in computing the update uniquely with respect to each client ’ s target task . We then wish to find the optimal weights w = 〈w1 , . . . , wN 〉 that optimize for the client ’ s objective , minimizing Li ( θ ` i ) . Efficient personalization with FedFomo Intuitively , we wish to find models { θ ` ( t ) m : m ∈ [ N ] \i } such that moving towards their parameters leads to better performance on our target distribution , and accordingly weight these θ higher in a model average . If a client carries a satisfying number of local data points associated with their target objective Li , then they could obtain a reasonable model through local training alone , e.g . directly updating their model parameters through SGD : θ ` ( t+1 ) i ← θ ` ( t ) i − α∇θLi ( θ ` ( t ) i ) ( 1 ) However , without this data , clients are more motivated to federate . In doing so they obtain useful updates , albeit in the more restricted form of fixed model parameters { θn : n ∈ N } . Then for personalized or non-IID target distributions , we can iteratively solve for the optimal combination of client models w∗ = arg minLi ( θ ) by computing : θ ` ( t+1 ) i ← θ ` ( t ) i − α1 > ∇wLi ( θ ` ( t ) i ) ( 2 ) where 1 is a size-N vector of ones . Unfortunately , as the larger federated learning algorithm is already an iterative process with many rounds of communication , computing w∗ through Eq . 2 may be cumbersome . Worse , if the model averages are only computed server-side as in traditional FL , Eq . 2 becomes prohibitively expensive in communication rounds ( McMahan et al. , 2017 ) . Following this line of reasoning however , we thus derive an approximation of w∗ for any client : Given previous local model parameters θ ` ( t−1 ) i , set of fellow federating models available to download { θ ` ( t ) n } and local client objective captured by Li , we propose weights of the form : wn = Li ( θ ` ( t−1 ) i ) − Li ( θ ` ( t ) n ) ‖θ ` ( t ) n − θ ` ( t−1 ) i ‖ ( 3 ) where the resulting federated update θ ` ( t ) i ← θ ` ( t−1 ) i + ∑ n∈ [ N ] wn ( θ ` ( t ) n −θ ` ( t−1 ) i ) directly optimizes for client ci ’ s objective up to a first-order approximation of the optimal w∗ . We default to the original parameters θ ` ( t−1 ) i if wn < 0 above , i.e . wn = max ( wn , 0 ) , and among positive wn normalize to get final weights w∗n = max ( wn,0 ) ∑ n max ( wn,0 ) to maintain w∗ ∈ [ 0 , 1 ] and ∑ n=1 w ∗ n ∈ { 0 , 1 } . We derive Eq . 3 as a first-order approximation of w∗ in Appendix A.1 . Here we note that our formulation captures the intuition of federating with client models that perform better than our own model , e.g . have a smaller loss on Li . Moreso , we weigh models more heavily as this positive loss delta increases , or the distance between our current parameters and theirs decreases , in essence most heavily weighing the models that most efficiently improve our performance . We use local parameters at t-1 to directly compute how much we should factor in current parameters θ ` ( t ) i , which also helps prevent overfitting as Li ( θ ` ( t−1 ) i ) − Li ( θ ` ( t ) i ) < 0 causes “ early-stopping ” at θ ` ( t−1 ) i . Communication and bandwidth overhead Because the server can send multiple requested models in one download to any client , we still maintain one round of communication for model downloads and one round for uploads in between E local training epochs . Furthermore , because w in Eq . 3 is simple to calculate , the actual model update can also happen client-side , keeping the total number of communications with T total training epochs at b 2TE c , as in FedAvg . However FedFomo also needs to consider the additional bandwidth from downloading multiple models . While quantization and distillation ( Chen et al. , 2017 ; Hinton et al. , 2015 ; Xu et al. , 2018 ) can alleviate this , we also avoid worst case N2 overhead with respect to the number of active clients N by restricting the number of models downloaded M . Whether we can achieve good personalization here involves figuring out which models benefit which clients , and our goal is then to send as many helpful models as possible given limited bandwidth . To do so , we invoke a sampling scheme where the likelihood of sending model θj to client ci relies on how well θj performed regarding client ci ’ s target objective in previous rounds . Accordingly , we maintain an affinity matrix P composed of vectors pi = 〈pi,1 , . . . , pi , K〉 , where pi , j measures the likelihood of sending θj to client ci , and at each round send the available uploaded models corresponding to the top M values according to each participating client ’ s p. Initially we set P = diag ( 1 , . . . , 1 ) , i.e . each model has an equal chance of being downloaded . Then during each federated update , we update p← p + w from Eq . 3 , where w can now be negative . If N K , we may benefit from additional exploration , and employ an ε-greedy sampling strategy where instead of picking strictly in order of p , we have ε chance to send a random model to the client . We investigate the robustness of FedFomo to these parameters through ablations of ε and M in the next section .
The paper proposes a new FL method that computes in every communication round for each client a personalized model as starting point for the next round of federation. The paper defines the client-specific objective as some loss function of the weighted combination of all (or subset) models on a client-specific validation set. This personalized weighted combination of the models especially fits situations where not all clients have congruent objectives such as in non-IID settings. The paper evaluates the proposed FL algorithm on standard datasets for image classification by comparing to alternative FL methods.
SP:f55167c38de1d6b8528b2d4ef865f5e2e87a5bdc
Tilted Empirical Risk Minimization
1 INTRODUCTION . Many statistical estimation procedures rely on the concept of empirical risk minimization ( ERM ) , in which the parameter of interest , θPΘĎRd , is estimated by minimizing an average loss over the data : Rpθq : “ 1 N ÿ iPrNs fpxi ; θq . ( 1 ) While ERM is widely used and has nice statistical properties , it can perform poorly in situations where average performance is not an appropriate surrogate for the problem of interest . Significant research has thus been devoted to developing alternatives to traditional ERM for diverse applications , such as learning in the presence of noisy/corrupted data ( Jiang et al. , 2018 ; Khetan et al. , 2018 ) , performing classification with imbalanced data ( Lin et al. , 2017 ; Malisiewicz et al. , 2011 ) , ensuring that subgroups within a population are treated fairly ( Hashimoto et al. , 2018 ; Samadi et al. , 2018 ) , or developing solutions with favorable out-of-sample performance ( Namkoong & Duchi , 2017 ) . In this paper , we suggest that deficiencies in ERM can be flexibly addressed via a unified framework , tilted empirical risk minimization ( TERM ) . TERM encompasses a family of objectives , parameterized by a real-valued hyperparameter , t. For t P Rz0 , the t-tilted loss ( TERM objective ) is given by : rRpt ; θq : “ 1 t log ˆ 1 N ÿ iPrNs etfpxi ; θq ˙ . ( 2 ) TERM generalizes ERM as the 0-tilted loss recovers the average loss , i.e. , rRp0 , θq “ Rpθq.1 It also recovers other popular alternatives such as the max-loss ( tÑ ` 8 ) and min-loss ( tÑ´8 ) ( Lemma 2 ) . For tą0 , the objective is a common form of exponential smoothing , used to approximate the max ( Kort & Bertsekas , 1972 ; Pee & Royset , 2011 ) . Variants of tilting have been studied in several contexts , ˚Equal contribution . 1 rRp0 ; θq is defined in ( 14 ) via the continuous extension of Rpt ; θq . including robust regression ( Wang et al. , 2013 ) ptă0q , importance sampling ( Wainwright et al. , 2005 ) , sequential decision making ( Howard & Matheson , 1972 ; Nass et al. , 2019 ) , and large deviations theory ( Beirami et al. , 2018 ) . However , despite the rich history of tilted objectives , they have not seen widespread use in machine learning . In this work , we aim to bridge this gap by : ( i ) rigorously studying the objective in a general form , and ( ii ) exploring its utility for a number of ML applications . Surprisingly , we find that this simple extension to ERM is competitive for a wide range of problems . To highlight how the TERM objective can help with issues such as outliers or imbalanced classes , we discuss three motivating examples below , which are illustrated in Figure 1 . ( a ) Point estimation : As a first example , consider determining a point estimate from a set of samples that contain some outliers . We plot an example 2D dataset in Figure 1a , with data centered at ( 1,1 ) . Using traditional ERM ( i.e. , TERM with t “ 0 ) recovers the sample mean , which can be biased towards outlier data . By setting t ă 0 , TERM can suppress outliers by reducing the relative impact of the largest losses ( i.e. , points that are far from the estimate ) in ( 2 ) . A specific value of t ă 0 can in fact approximately recover the geometric median , as the objective in ( 2 ) can be viewed as approximately optimizing specific loss quantiles ( a connection which we make explicit in Section 2 ) . In contrast , if these ‘ outlier ’ points are important to estimate , setting t ą 0 will push the solution towards a point that aims to minimize variance , as we prove more rigorously in Section 2 , Theorem 4 . ( b ) Linear regression : A similar interpretation holds for the case of linear regression ( Figure 2b ) . As tÑ ´8 , TERM finds a line of best while ignoring outliers . However , this solution may not be preferred if we have reason to believe that these ‘ outliers ’ should not be ignored . As tÑ ` 8 , TERM recovers the min-max solution , which aims to minimize the worst loss , thus ensuring the model is a reasonable fit for all samples ( at the expense of possibly being a worse fit for many ) . Similar criteria have been used , e.g. , in defining notions of fairness ( Hashimoto et al. , 2018 ; Samadi et al. , 2018 ) . We explore several use-cases involving robust regression and fairness in more detail in Section 5 . ( c ) Logistic regression : Finally , we consider a binary classification problem using logistic regression ( Figure 2c ) . For t P R , the TERM solution varies from the nearest cluster center ( tÑ´8 ) , to the logistic regression classifier ( t “ 0 ) , towards a classifier that magnifies the misclassified data ( tÑ ` 8 ) . We note that it is common to modify logistic regression classifiers by adjusting the decision threshold from 0.5 , which is equivalent to moving the intercept of the decision boundary . This is fundamentally different than what is offered by TERM ( where the slope is changing ) . As we show in Section 5 , this added flexibility affords TERM with competitive performance on a number of classification problems , such as those involving noisy data , class imbalance , or a combination of the two . Contributions . In this work , we explore TERM as a simple , unified framework to flexibly address various challenges with empirical risk minimization . We first analyze the objective and its solutions , showcasing the behavior of TERM with varying t ( Section 2 ) . Our analysis provides novel connections between tilted objectives and superquantile methods . We develop efficient methods for solving TERM ( Section 4 ) , and show via numerous case studies that TERM is competitive with existing , problemspecific state-of-the-art solutions ( Section 5 ) . We also extend TERM to handle compound issues , such as the simultaneous existence of noisy samples and imbalanced classes ( Section 3 ) . Our results demonstrate the effectiveness and versatility of tilted objectives in machine learning . 2 TERM : PROPERTIES & INTERPRETATIONS . To better understand the performance of the t-tilted losses in ( 2 ) , we provide several interpretations of the TERM solutions , leaving the full statements of theorems and proofs to the appendix . We make no distributional assumptions on the data , and study properties of TERM under the assumption that the loss function forms a generalized linear model , e.g. , L2 loss and logistic loss ( Appendix D ) . However , we also obtain favorable empirical results using TERM with other objectives such as deep neural networks and PCA in Section 5 , motivating the extension of our theory beyond GLMs in future work . General properties . We begin by noting several general properties of the TERM objective ( 2 ) . Given a smooth fpx ; θq , the t-tilted loss is smooth for all finite t ( Lemma 4 ) . If fpx ; θq is strongly convex , the t-tilted loss is strongly convex for t ą 0 ( Lemma 5 ) . We visualize the solutions to TERM for a toy problem in Figure 2 , which allows us to illustrate several special cases of the general framework . As discussed in Section 1 , TERM can recover traditional ERM ( t “ 0 ) , the max-loss ( tÑ ` 8 ) , and the min-loss ( tÑ´8 ) . As we demonstrate in Section 5 , providing a smooth tradeoff between these specific losses can be beneficial for a number of practical use-cases— both in terms of the resulting solution and the difficulty of solving the problem itself . Interestingly , we additionally show that the TERM solution can be viewed as a smooth approximation to a superquantile method , which aims to minimize quantiles of losses such as the median loss . In Figure 2 , it is clear to see why this may be beneficial , as the median loss ( orange ) can be highly non-smooth in practice . We make these rough connections more explicit via the interpretations below . ( Interpretation 1 ) Re-weighting samples to magnify/suppress outliers . As discussed via the toy examples in Section 1 , the TERM objective can be tuned ( using t ) to magnify or suppress the influence of outliers . We make this notion rigorous by exploring the gradient of the t-tilted loss in order to reason about the solutions to the objective defined in ( 2 ) . Lemma 1 ( Tilted gradient , proof in Appendix B ) . For a smooth loss function fpx ; θq , ∇θ rRpt ; θq “ ÿ iPrNs wipt ; θq∇θfpxi ; θq , where wipt ; θq : “ etfpxi ; θq ř jPrNse tfpxj ; θq “ 1 N etpfpxi ; θq´ rRpt ; θqq . ( 3 ) From this , we can observe that the tilted gradient is a weighted average of the gradients of the original individual losses , where each data point is weighted exponentially proportional to the value of its loss . Note that t “ 0 recovers the uniform weighting associated with ERM , i.e. , wipt ; θq “ 1 { N . For positive t , it magnifies the outliers—samples with large losses—by assigning more weight to them , and for negative t , it suppresses the outliers by assigning less weight to them . ( Interpretation 2 ) Tradeoff between average-loss and min/max-loss . To put Interpretation 1 in context and understand the limits of TERM , a benefit of the framework is that it offers a continuum of solutions between the min and max losses . Indeed , for positive values of t , TERM enables a smooth tradeoff between the average-loss and max-loss ( as we demonstrate in Figure 10 , Appendix I ) . Hence , TERM can selectively improve the worst-performing losses by paying a penalty on average performance , thus promoting a notion of uniformity or fairness ( Hashimoto et al. , 2018 ) . On the other hand , for negative t , the solutions achieve a smooth tradeoff between average-loss and min-loss , which can have the benefit of focusing on the ‘ best ’ losses , or ignoring outliers ( Theorem 3 , Appendix D ) . Theorem ( Formal statement and proof in Appendix D , Theorem 3 ) . Let θ̆ptq be the minimizer of rRpt ; θq , referred to as t-tilted solution . Then , for t ą 0 , max-loss , pRpθ̆ptqq , is non-increasing with t while the average loss , Rpθ̆ptqq , is non-decreasing with t. ( Interpretation 3 ) Empirical bias/variance tradeoff . Another key property of the TERM solutions is that the empirical variance of the loss across all samples decreases as t increases ( Theorem 4 ) . Hence , by increasing t , it is possible to trade off between optimizing the average loss vs. reducing variance , allowing the solutions to potentially achieve a better bias-variance tradeoff for generalization ( Bennett , 1962 ; Hoeffding , 1994 ; Maurer & Pontil , 2009 ) ( Figure 10 , Appendix I ) . We use this property to achieve better generalization in classification in Section 5 . We also prove that the cosine similarity between the loss vector and the all-ones vector monotonically increases with t ( Theorem 5 ) , which shows that larger t promotes a more uniform performance across all losses and can have implications for fairness defined as representation disparity ( Hashimoto et al. , 2018 ) ( Section 5.2 ) . Theorem ( Formal statement and proof in Appendix D , Theorem 4 ) . Let fpθq : “ pfpx1 ; θqq , . . . , fpxN ; θqq be the loss vector for parameter θ . Then , the variance of the vector fpθ̆ptqq is non-increasing with t while its average , i.e. , Rpθ̆ptqq , is non-decreasing with t. ( Interpretation 4 ) Approximate superquantile method . Finally , we show that TERM is related to superquantile-based objectives , which aim to minimize specific quantiles of the individual losses that exceed a certain value ( Rockafellar et al. , 2000 ) . For example , optimizing for 90 % of the individual losses ( ignoring the worst-performing 10 % ) could be a more reasonable practical objective than the pessimistic min-max objective . Another common application of this is to use the median in contrast to the mean in the presence of noisy outliers . As we discuss in Appendix G , superquantile methods can be reinterpreted as minimizing the k-loss , defined as the k-th smallest loss of N ( i.e. , 1-loss is the min-loss , N -loss is the max-loss , pN´1q { 2-loss is the median-loss ) . While minimizing the k-loss is more desirable than ERM in many applications , the k-loss is non-smooth ( and generally non-convex ) , and is challenging to solve for large-scale problems ( Jin et al. , 2020 ; Nouiehed et al. , 2019b ) . Theorem ( Formal statement and proof in Appendix G , Theorem 10 ) . The quantile of the losses that exceed a given value is upper bounded by a smooth function of the TERM objective . Further , the t-tilted solutions are good approximate solutions of the superquantile ( k-loss ) optimization .
This work analyzes the LogSumExp aggregated loss (named tiled empirical risk minimization, or TERM, in the paper). It provides several general properties of the loss, such as its relation to min/avg/max-loss, and interpretations of different trade-offs. Empirically, it is shown that TERM can be applied to a diverse set of problems, including robust optimization, fairness and generalization.
SP:478a18897696ba946947faeee860203186d7e756
Tilted Empirical Risk Minimization
1 INTRODUCTION . Many statistical estimation procedures rely on the concept of empirical risk minimization ( ERM ) , in which the parameter of interest , θPΘĎRd , is estimated by minimizing an average loss over the data : Rpθq : “ 1 N ÿ iPrNs fpxi ; θq . ( 1 ) While ERM is widely used and has nice statistical properties , it can perform poorly in situations where average performance is not an appropriate surrogate for the problem of interest . Significant research has thus been devoted to developing alternatives to traditional ERM for diverse applications , such as learning in the presence of noisy/corrupted data ( Jiang et al. , 2018 ; Khetan et al. , 2018 ) , performing classification with imbalanced data ( Lin et al. , 2017 ; Malisiewicz et al. , 2011 ) , ensuring that subgroups within a population are treated fairly ( Hashimoto et al. , 2018 ; Samadi et al. , 2018 ) , or developing solutions with favorable out-of-sample performance ( Namkoong & Duchi , 2017 ) . In this paper , we suggest that deficiencies in ERM can be flexibly addressed via a unified framework , tilted empirical risk minimization ( TERM ) . TERM encompasses a family of objectives , parameterized by a real-valued hyperparameter , t. For t P Rz0 , the t-tilted loss ( TERM objective ) is given by : rRpt ; θq : “ 1 t log ˆ 1 N ÿ iPrNs etfpxi ; θq ˙ . ( 2 ) TERM generalizes ERM as the 0-tilted loss recovers the average loss , i.e. , rRp0 , θq “ Rpθq.1 It also recovers other popular alternatives such as the max-loss ( tÑ ` 8 ) and min-loss ( tÑ´8 ) ( Lemma 2 ) . For tą0 , the objective is a common form of exponential smoothing , used to approximate the max ( Kort & Bertsekas , 1972 ; Pee & Royset , 2011 ) . Variants of tilting have been studied in several contexts , ˚Equal contribution . 1 rRp0 ; θq is defined in ( 14 ) via the continuous extension of Rpt ; θq . including robust regression ( Wang et al. , 2013 ) ptă0q , importance sampling ( Wainwright et al. , 2005 ) , sequential decision making ( Howard & Matheson , 1972 ; Nass et al. , 2019 ) , and large deviations theory ( Beirami et al. , 2018 ) . However , despite the rich history of tilted objectives , they have not seen widespread use in machine learning . In this work , we aim to bridge this gap by : ( i ) rigorously studying the objective in a general form , and ( ii ) exploring its utility for a number of ML applications . Surprisingly , we find that this simple extension to ERM is competitive for a wide range of problems . To highlight how the TERM objective can help with issues such as outliers or imbalanced classes , we discuss three motivating examples below , which are illustrated in Figure 1 . ( a ) Point estimation : As a first example , consider determining a point estimate from a set of samples that contain some outliers . We plot an example 2D dataset in Figure 1a , with data centered at ( 1,1 ) . Using traditional ERM ( i.e. , TERM with t “ 0 ) recovers the sample mean , which can be biased towards outlier data . By setting t ă 0 , TERM can suppress outliers by reducing the relative impact of the largest losses ( i.e. , points that are far from the estimate ) in ( 2 ) . A specific value of t ă 0 can in fact approximately recover the geometric median , as the objective in ( 2 ) can be viewed as approximately optimizing specific loss quantiles ( a connection which we make explicit in Section 2 ) . In contrast , if these ‘ outlier ’ points are important to estimate , setting t ą 0 will push the solution towards a point that aims to minimize variance , as we prove more rigorously in Section 2 , Theorem 4 . ( b ) Linear regression : A similar interpretation holds for the case of linear regression ( Figure 2b ) . As tÑ ´8 , TERM finds a line of best while ignoring outliers . However , this solution may not be preferred if we have reason to believe that these ‘ outliers ’ should not be ignored . As tÑ ` 8 , TERM recovers the min-max solution , which aims to minimize the worst loss , thus ensuring the model is a reasonable fit for all samples ( at the expense of possibly being a worse fit for many ) . Similar criteria have been used , e.g. , in defining notions of fairness ( Hashimoto et al. , 2018 ; Samadi et al. , 2018 ) . We explore several use-cases involving robust regression and fairness in more detail in Section 5 . ( c ) Logistic regression : Finally , we consider a binary classification problem using logistic regression ( Figure 2c ) . For t P R , the TERM solution varies from the nearest cluster center ( tÑ´8 ) , to the logistic regression classifier ( t “ 0 ) , towards a classifier that magnifies the misclassified data ( tÑ ` 8 ) . We note that it is common to modify logistic regression classifiers by adjusting the decision threshold from 0.5 , which is equivalent to moving the intercept of the decision boundary . This is fundamentally different than what is offered by TERM ( where the slope is changing ) . As we show in Section 5 , this added flexibility affords TERM with competitive performance on a number of classification problems , such as those involving noisy data , class imbalance , or a combination of the two . Contributions . In this work , we explore TERM as a simple , unified framework to flexibly address various challenges with empirical risk minimization . We first analyze the objective and its solutions , showcasing the behavior of TERM with varying t ( Section 2 ) . Our analysis provides novel connections between tilted objectives and superquantile methods . We develop efficient methods for solving TERM ( Section 4 ) , and show via numerous case studies that TERM is competitive with existing , problemspecific state-of-the-art solutions ( Section 5 ) . We also extend TERM to handle compound issues , such as the simultaneous existence of noisy samples and imbalanced classes ( Section 3 ) . Our results demonstrate the effectiveness and versatility of tilted objectives in machine learning . 2 TERM : PROPERTIES & INTERPRETATIONS . To better understand the performance of the t-tilted losses in ( 2 ) , we provide several interpretations of the TERM solutions , leaving the full statements of theorems and proofs to the appendix . We make no distributional assumptions on the data , and study properties of TERM under the assumption that the loss function forms a generalized linear model , e.g. , L2 loss and logistic loss ( Appendix D ) . However , we also obtain favorable empirical results using TERM with other objectives such as deep neural networks and PCA in Section 5 , motivating the extension of our theory beyond GLMs in future work . General properties . We begin by noting several general properties of the TERM objective ( 2 ) . Given a smooth fpx ; θq , the t-tilted loss is smooth for all finite t ( Lemma 4 ) . If fpx ; θq is strongly convex , the t-tilted loss is strongly convex for t ą 0 ( Lemma 5 ) . We visualize the solutions to TERM for a toy problem in Figure 2 , which allows us to illustrate several special cases of the general framework . As discussed in Section 1 , TERM can recover traditional ERM ( t “ 0 ) , the max-loss ( tÑ ` 8 ) , and the min-loss ( tÑ´8 ) . As we demonstrate in Section 5 , providing a smooth tradeoff between these specific losses can be beneficial for a number of practical use-cases— both in terms of the resulting solution and the difficulty of solving the problem itself . Interestingly , we additionally show that the TERM solution can be viewed as a smooth approximation to a superquantile method , which aims to minimize quantiles of losses such as the median loss . In Figure 2 , it is clear to see why this may be beneficial , as the median loss ( orange ) can be highly non-smooth in practice . We make these rough connections more explicit via the interpretations below . ( Interpretation 1 ) Re-weighting samples to magnify/suppress outliers . As discussed via the toy examples in Section 1 , the TERM objective can be tuned ( using t ) to magnify or suppress the influence of outliers . We make this notion rigorous by exploring the gradient of the t-tilted loss in order to reason about the solutions to the objective defined in ( 2 ) . Lemma 1 ( Tilted gradient , proof in Appendix B ) . For a smooth loss function fpx ; θq , ∇θ rRpt ; θq “ ÿ iPrNs wipt ; θq∇θfpxi ; θq , where wipt ; θq : “ etfpxi ; θq ř jPrNse tfpxj ; θq “ 1 N etpfpxi ; θq´ rRpt ; θqq . ( 3 ) From this , we can observe that the tilted gradient is a weighted average of the gradients of the original individual losses , where each data point is weighted exponentially proportional to the value of its loss . Note that t “ 0 recovers the uniform weighting associated with ERM , i.e. , wipt ; θq “ 1 { N . For positive t , it magnifies the outliers—samples with large losses—by assigning more weight to them , and for negative t , it suppresses the outliers by assigning less weight to them . ( Interpretation 2 ) Tradeoff between average-loss and min/max-loss . To put Interpretation 1 in context and understand the limits of TERM , a benefit of the framework is that it offers a continuum of solutions between the min and max losses . Indeed , for positive values of t , TERM enables a smooth tradeoff between the average-loss and max-loss ( as we demonstrate in Figure 10 , Appendix I ) . Hence , TERM can selectively improve the worst-performing losses by paying a penalty on average performance , thus promoting a notion of uniformity or fairness ( Hashimoto et al. , 2018 ) . On the other hand , for negative t , the solutions achieve a smooth tradeoff between average-loss and min-loss , which can have the benefit of focusing on the ‘ best ’ losses , or ignoring outliers ( Theorem 3 , Appendix D ) . Theorem ( Formal statement and proof in Appendix D , Theorem 3 ) . Let θ̆ptq be the minimizer of rRpt ; θq , referred to as t-tilted solution . Then , for t ą 0 , max-loss , pRpθ̆ptqq , is non-increasing with t while the average loss , Rpθ̆ptqq , is non-decreasing with t. ( Interpretation 3 ) Empirical bias/variance tradeoff . Another key property of the TERM solutions is that the empirical variance of the loss across all samples decreases as t increases ( Theorem 4 ) . Hence , by increasing t , it is possible to trade off between optimizing the average loss vs. reducing variance , allowing the solutions to potentially achieve a better bias-variance tradeoff for generalization ( Bennett , 1962 ; Hoeffding , 1994 ; Maurer & Pontil , 2009 ) ( Figure 10 , Appendix I ) . We use this property to achieve better generalization in classification in Section 5 . We also prove that the cosine similarity between the loss vector and the all-ones vector monotonically increases with t ( Theorem 5 ) , which shows that larger t promotes a more uniform performance across all losses and can have implications for fairness defined as representation disparity ( Hashimoto et al. , 2018 ) ( Section 5.2 ) . Theorem ( Formal statement and proof in Appendix D , Theorem 4 ) . Let fpθq : “ pfpx1 ; θqq , . . . , fpxN ; θqq be the loss vector for parameter θ . Then , the variance of the vector fpθ̆ptqq is non-increasing with t while its average , i.e. , Rpθ̆ptqq , is non-decreasing with t. ( Interpretation 4 ) Approximate superquantile method . Finally , we show that TERM is related to superquantile-based objectives , which aim to minimize specific quantiles of the individual losses that exceed a certain value ( Rockafellar et al. , 2000 ) . For example , optimizing for 90 % of the individual losses ( ignoring the worst-performing 10 % ) could be a more reasonable practical objective than the pessimistic min-max objective . Another common application of this is to use the median in contrast to the mean in the presence of noisy outliers . As we discuss in Appendix G , superquantile methods can be reinterpreted as minimizing the k-loss , defined as the k-th smallest loss of N ( i.e. , 1-loss is the min-loss , N -loss is the max-loss , pN´1q { 2-loss is the median-loss ) . While minimizing the k-loss is more desirable than ERM in many applications , the k-loss is non-smooth ( and generally non-convex ) , and is challenging to solve for large-scale problems ( Jin et al. , 2020 ; Nouiehed et al. , 2019b ) . Theorem ( Formal statement and proof in Appendix G , Theorem 10 ) . The quantile of the losses that exceed a given value is upper bounded by a smooth function of the TERM objective . Further , the t-tilted solutions are good approximate solutions of the superquantile ( k-loss ) optimization .
This paper considers a unified framework named TERM for addressing a bunch of problems arising in the simple averaged empirical minimization. By leveraging the key hyper-parameter t in the TERM loss, it can recover the original average loss and approximate robust loss, min/max loss, and the superquantile loss, etc. The authors also propose gradient-based optimization algorithms for solving the TERM problem.
SP:478a18897696ba946947faeee860203186d7e756
HeteroFL: Computation and Communication Efficient Federated Learning for Heterogeneous Clients
1 INTRODUCTION . Mobile devices and the Internet of Things ( IoT ) devices are becoming the primary computing resource for billions of users worldwide ( Lim et al. , 2020 ) . These devices generate a significant amount of data that can be used to improve numerous existing applications ( Hard et al. , 2018 ) . From the privacy and economic point of view , due to these devices ’ growing computational capabilities , it becomes increasingly attractive to store data and train models locally . Federated learning ( FL ) ( Konečnỳ et al. , 2016 ; McMahan et al. , 2017 ) is a distributed machine learning framework that enables a number of clients to produce a global inference model without sharing local data by aggregating locally trained model parameters . A widely accepted assumption is that local models have to share the same architecture as the global model ( Li et al. , 2020b ) to produce a single global inference model . With this underlying assumption , we have to limit the global model complexity for the most indigent client to train its data . In practice , the computation and communication capabilities of each client may vary significantly and even dynamically . It is crucial to address heterogeneous clients equipped with very different computation and communication capabilities . In this work , we propose a new federated learning framework called HeteroFL to train heterogeneous local models with varying computation complexities and still produce a single global inference model . This model heterogeneity differs significantly from the classical distributed machine learning framework where local data are trained with the same model architecture ( Li et al. , 2020b ; Ben-Nun & Hoefler , 2019 ) . It is natural to adaptively distribute subnetworks according to clients ’ capabilities . However , to stably aggregate heterogeneous local models to a single global model under various heterogeneous settings is not apparent . Addressing these issues is thus a key component of our work . Our main contributions of this work are three-fold . • We identify the possibility of model heterogeneity and propose an easy-to-implement framework HeteroFL that can train heterogeneous local models and aggregate them stably and effectively into a single global inference model . Our approach outperforms state-ofthe-art results without introducing additional computation overhead . • Our proposed solution addresses various heterogeneous settings where different proportions of clients have distinct capabilities . Our results demonstrate that even when the model heterogeneity changes dynamically , the learning result from our framework is still stable and effective . • We introduce several strategies for improving FL training and demonstrate that our method is robust against the balanced non-IID statistical heterogeneity . Also , the proposed method can reduce the number of communication rounds needed to obtain state-of-the-art results . Experimental studies have been performed to evaluate the proposed approach . 2 RELATED WORK . Federated Learning aims to train massively distributed models at a large scale ( Bonawitz et al. , 2019 ) . FedAvg proposed by McMahan et al . ( 2017 ) is currently the most widely adopted FL baseline , which reduces communication cost by allowing clients to train multiple iterations locally . Major challenges involved in FL include communication efficiency , system heterogeneity , statistical heterogeneity , and privacy ( Li et al. , 2020b ) . To reduce communication costs in FL , some studies propose to use data compression techniques such as quantization and sketching ( Konečnỳ et al. , 2016 ; Alistarh et al. , 2017 ; Ivkin et al. , 2019 ) , and some propose to adopt split learning ( Thapa et al. , 2020 ) . To tackle system heterogeneity , techniques of asynchronous communication and active sampling of clients have been developed ( Bonawitz et al. , 2019 ; Nishio & Yonetani , 2019 ) . Statistical heterogeneity is the major battleground for current FL research . A research trend is to adapt the global model to accommodate personalized local models for non-IID data ( Liang et al. , 2020 ) , e.g. , by integrating FL with other frameworks such as assisted learning ( Xian et al. , 2020 ) , metalearning ( Jiang et al. , 2019 ; Khodak et al. , 2019 ) , multi-task learning ( Smith et al. , 2017 ) , transfer learning ( Wang et al. , 2019 ; Mansour et al. , 2020 ) , knowledge distillation ( Li & Wang , 2019 ) and lottery ticket hypothesis ( Li et al. , 2020a ) . Nevertheless , these personalization methods often introduce additional computation and communication overhead that may not be necessary . Another major concern of FL is data privacy ( Lyu et al. , 2020 ) , as model gradient updates can reveal sensitive information ( Melis et al. , 2019 ) and even local training data ( Zhu et al. , 2019 ; Zhao et al. , 2020 ) . To our best knowledge , what we present is the first work that allows local models to have different architectures from the global model . Heterogeneous local models can allow local clients to adaptively contribute to the training of global models . System heterogeneity and communication efficiency can be well addressed by our approach , where local clients can optimize low computation complexity models and therefore communicate a small number of model parameters . To address statistical heterogeneity , we propose a ” Masking Trick ” for balanced non-IID data partition in classification problems . We also propose a modification of Batch Normalization ( BN ) ( Ioffe & Szegedy , 2015 ) as privacy concern of running estimates hinders the usage of advanced deep learning models . 3 HETEROGENEOUS FEDERATED LEARNING . 3.1 HETEROGENEOUS MODELS . Federated Learning aims to train a global inference model from locally distributed data { X1 , . . . , Xm } across m clients . The local models are parameterized by model parameters { W1 , . . . , Wm } . The server will receive local model parameters and aggregate them into a global model Wg through model averaging . This process iterates multiple communication rounds and can be formulated as W tg = 1 m ∑m i=1W t i at iteration t. At the next iteration , W t g is transmitted to a subset of local clients and update their local models as W t+1i =W t g . In this work , we focus on the relaxation of the assumption that local models need to share the same architecture as the global model . Since our primary motivation is to reduce the computation and communication complexity of local clients , we consider local models to have similar architecture but can shrink their complexity within the same model class . To simplify global aggregation and local update , it is tempting to propose local model parameters to be a subset of global model parameters W t+1i ⊆ W tg . However , this raises several new challenges like the optimal way to select subsets of global model parameters , compatibility of the-state-of-art model architecture , and minimum modification from the existing FL framework . We develop Heterogeneous Federated Learning ( HeteroFL ) to address these issues in the context of deep learning models . A variety of works show that we can modulate the size of deep neural networks by varying the width and depth of networks ( Zagoruyko & Komodakis , 2016 ; Tan & Le , 2019 ) . Because we aim to reduce the computation complexity of local models , we choose to vary the width of hidden channels . In this way , we can significantly reduce the number of local model parameters , while the local and global model architectures are also within the same model class , which stabilizes global model aggregation . We demonstrate our method of selecting subsets of global model parameters Wl for a single hidden layer parameterized by Wg ∈ Rdg×kg in Fig . 1 , where dg and kg are the output and input channel size of this layer . It is possible to have multiple computation complexity levels W pl ⊂ W p−1 l · · · ⊂ W 1l as illustrated in Fig . 1 . Let r be the hidden channel shrinkage ratio such that d p l = r p−1dg and kpl = r p−1kg . It follows that the size of local model parameters |W pl | = r2 ( p−1 ) |Wg| and the model shrinkage ratio R = |W p l | |Wg| = r 2 ( p−1 ) . With this construction , we can adaptively allocate subsets of global model parameters according to the corresponding capabilities of local clients . Suppose that number of clients in each computation complexity level is { m1 , . . . , mp } . Specifically , we perform global aggregation in the following way . W pl = 1 m m∑ i=1 W pi , W p−1 l \W p l = 1 m−mp m−mp∑ i=1 W p−1i \W p i , . . . ( 1 ) W 1l \W 2l = 1 m−m2 : p m−m2 : p∑ i=1 W 1i \W 2i ( 2 ) Wg =W 1 l =W p l ∪ ( W p−1 l \W p l ) ∪ · · · ∪ ( W 1 l \W 2l ) ( 3 ) For notational convenience , we have dropped the iteration index t. We denote the W pi as a matrix/tensor . The W tg [ : dm , : km ] denotes the upper left submatrix with a size of dm × km . Also , W p−1 , t+1g \W p , t+1g denotes the set of elements included in W p−1 , t+1g but excluded in W p , t+1g . We exemplify the above equations using Fig . 1 . The first part of Equation ( 1 ) shows that the smallest part of model parameters ( blue , p = 3 ) is aggregated from all the local clients that contain it . In the second part of Equation ( 1 ) , the set difference between part p − 1 ( orange ) and p ( blue ) of model parameters is aggregated from local clients with computation complexity level smaller than p − 1 . In Equation ( 2 ) , the red part of model parameters can be similarly aggregated from m −m2 : p = m1 clients . In Equation ( 3 ) , the global model parameters W tg is constructed from the union of all disjoint sets of the partition . In summary , each parameter will be averaged from those clients whose allocated parameter matrix contains that parameter . Thus , a model of an intermediate complexity will have parameters fully averaged with all the other larger models but partially with smaller models ( according to the corresponding upper left submatrix ) . Several works show that wide neural networks can drop a tremendous number of parameters per layer and still produce acceptable results ( Han et al. , 2015 ; Frankle & Carbin , 2018 ) . The intuition is thus to perform global aggregation across all local models , at least on one subnetwork . To stabilize global model aggregation , we also allocate a fixed subnetwork for every computation complexity level . Our proposed inclusive subsets of global model parameters also guarantee that smaller local models will aggregate with more local models . Thus , small local models can benefit more from global aggregation by performing less global aggregation for part of larger local model parameters . We empirically found that this approach produces better results than uniformly sampled subnetworks for each client or computation complexity level . 3.2 STATIC BATCH NORMALIZATION . After global model parameters are distributed to active local clients , we can optimize local model parameters with private data . It is well-known that the latest deep learning models usually adopt Batch Normalization ( BN ) to facilitate and stabilize optimization . However , classical FedAvg and most recent works avoid BN . A major concern of BN is that it requires running estimates of representations at every hidden layer . Uploading these statistics to the server will cause higher communication costs and privacy issues Andreux et al . ( 2020 ) proposes to track running statistics locally . We highlight an adaptation of BN named as static Batch Normaliztion ( sBN ) for optimizing privacy constrained heterogeneous models . During the training phase , sBN does not track running estimates and simply normalize batch data . We do not track the local running statistics as the size of local models may also vary dynamically . This method is suitable for HeteroFL as every communication round is independent . After the training process finishes , the server sequentially query local clients and cumulatively update global BN statistics . There exist privacy concerns about calculating global statistics cumulatively and we hope to address those issues in the future work . We also empirically found this trick significantly outperforms other forms of normalization methods including the InstanceNorm ( Ulyanov et al. , 2016 ) , GroupNorm ( Wu & He , 2018 ) , and LayerNorm ( Ba et al. , 2016 ) as shown in Table 4 and Table 5 .
This work presents a novel FL algorithm named HeteroFL (the name might sounds weird to some peoples) and 3 different simple methods to improve FL in heterogeneous conditions (i.e. both in term of clients and data partitioning). These tricks are: 1. A revised batchnormalisation; 2. a pre-activity scaling; 3. a masked loss (i.e only consider local classes) to help with non-IID datasets. All these modifications have been tested on 3 different datasets and 2 different tasks. From the results, we can see that the proposed approach works better. Although, it is not clear from where the benefit comes.
SP:56e4d560f80360bd6f50d162caade651b5ff91a6
HeteroFL: Computation and Communication Efficient Federated Learning for Heterogeneous Clients
1 INTRODUCTION . Mobile devices and the Internet of Things ( IoT ) devices are becoming the primary computing resource for billions of users worldwide ( Lim et al. , 2020 ) . These devices generate a significant amount of data that can be used to improve numerous existing applications ( Hard et al. , 2018 ) . From the privacy and economic point of view , due to these devices ’ growing computational capabilities , it becomes increasingly attractive to store data and train models locally . Federated learning ( FL ) ( Konečnỳ et al. , 2016 ; McMahan et al. , 2017 ) is a distributed machine learning framework that enables a number of clients to produce a global inference model without sharing local data by aggregating locally trained model parameters . A widely accepted assumption is that local models have to share the same architecture as the global model ( Li et al. , 2020b ) to produce a single global inference model . With this underlying assumption , we have to limit the global model complexity for the most indigent client to train its data . In practice , the computation and communication capabilities of each client may vary significantly and even dynamically . It is crucial to address heterogeneous clients equipped with very different computation and communication capabilities . In this work , we propose a new federated learning framework called HeteroFL to train heterogeneous local models with varying computation complexities and still produce a single global inference model . This model heterogeneity differs significantly from the classical distributed machine learning framework where local data are trained with the same model architecture ( Li et al. , 2020b ; Ben-Nun & Hoefler , 2019 ) . It is natural to adaptively distribute subnetworks according to clients ’ capabilities . However , to stably aggregate heterogeneous local models to a single global model under various heterogeneous settings is not apparent . Addressing these issues is thus a key component of our work . Our main contributions of this work are three-fold . • We identify the possibility of model heterogeneity and propose an easy-to-implement framework HeteroFL that can train heterogeneous local models and aggregate them stably and effectively into a single global inference model . Our approach outperforms state-ofthe-art results without introducing additional computation overhead . • Our proposed solution addresses various heterogeneous settings where different proportions of clients have distinct capabilities . Our results demonstrate that even when the model heterogeneity changes dynamically , the learning result from our framework is still stable and effective . • We introduce several strategies for improving FL training and demonstrate that our method is robust against the balanced non-IID statistical heterogeneity . Also , the proposed method can reduce the number of communication rounds needed to obtain state-of-the-art results . Experimental studies have been performed to evaluate the proposed approach . 2 RELATED WORK . Federated Learning aims to train massively distributed models at a large scale ( Bonawitz et al. , 2019 ) . FedAvg proposed by McMahan et al . ( 2017 ) is currently the most widely adopted FL baseline , which reduces communication cost by allowing clients to train multiple iterations locally . Major challenges involved in FL include communication efficiency , system heterogeneity , statistical heterogeneity , and privacy ( Li et al. , 2020b ) . To reduce communication costs in FL , some studies propose to use data compression techniques such as quantization and sketching ( Konečnỳ et al. , 2016 ; Alistarh et al. , 2017 ; Ivkin et al. , 2019 ) , and some propose to adopt split learning ( Thapa et al. , 2020 ) . To tackle system heterogeneity , techniques of asynchronous communication and active sampling of clients have been developed ( Bonawitz et al. , 2019 ; Nishio & Yonetani , 2019 ) . Statistical heterogeneity is the major battleground for current FL research . A research trend is to adapt the global model to accommodate personalized local models for non-IID data ( Liang et al. , 2020 ) , e.g. , by integrating FL with other frameworks such as assisted learning ( Xian et al. , 2020 ) , metalearning ( Jiang et al. , 2019 ; Khodak et al. , 2019 ) , multi-task learning ( Smith et al. , 2017 ) , transfer learning ( Wang et al. , 2019 ; Mansour et al. , 2020 ) , knowledge distillation ( Li & Wang , 2019 ) and lottery ticket hypothesis ( Li et al. , 2020a ) . Nevertheless , these personalization methods often introduce additional computation and communication overhead that may not be necessary . Another major concern of FL is data privacy ( Lyu et al. , 2020 ) , as model gradient updates can reveal sensitive information ( Melis et al. , 2019 ) and even local training data ( Zhu et al. , 2019 ; Zhao et al. , 2020 ) . To our best knowledge , what we present is the first work that allows local models to have different architectures from the global model . Heterogeneous local models can allow local clients to adaptively contribute to the training of global models . System heterogeneity and communication efficiency can be well addressed by our approach , where local clients can optimize low computation complexity models and therefore communicate a small number of model parameters . To address statistical heterogeneity , we propose a ” Masking Trick ” for balanced non-IID data partition in classification problems . We also propose a modification of Batch Normalization ( BN ) ( Ioffe & Szegedy , 2015 ) as privacy concern of running estimates hinders the usage of advanced deep learning models . 3 HETEROGENEOUS FEDERATED LEARNING . 3.1 HETEROGENEOUS MODELS . Federated Learning aims to train a global inference model from locally distributed data { X1 , . . . , Xm } across m clients . The local models are parameterized by model parameters { W1 , . . . , Wm } . The server will receive local model parameters and aggregate them into a global model Wg through model averaging . This process iterates multiple communication rounds and can be formulated as W tg = 1 m ∑m i=1W t i at iteration t. At the next iteration , W t g is transmitted to a subset of local clients and update their local models as W t+1i =W t g . In this work , we focus on the relaxation of the assumption that local models need to share the same architecture as the global model . Since our primary motivation is to reduce the computation and communication complexity of local clients , we consider local models to have similar architecture but can shrink their complexity within the same model class . To simplify global aggregation and local update , it is tempting to propose local model parameters to be a subset of global model parameters W t+1i ⊆ W tg . However , this raises several new challenges like the optimal way to select subsets of global model parameters , compatibility of the-state-of-art model architecture , and minimum modification from the existing FL framework . We develop Heterogeneous Federated Learning ( HeteroFL ) to address these issues in the context of deep learning models . A variety of works show that we can modulate the size of deep neural networks by varying the width and depth of networks ( Zagoruyko & Komodakis , 2016 ; Tan & Le , 2019 ) . Because we aim to reduce the computation complexity of local models , we choose to vary the width of hidden channels . In this way , we can significantly reduce the number of local model parameters , while the local and global model architectures are also within the same model class , which stabilizes global model aggregation . We demonstrate our method of selecting subsets of global model parameters Wl for a single hidden layer parameterized by Wg ∈ Rdg×kg in Fig . 1 , where dg and kg are the output and input channel size of this layer . It is possible to have multiple computation complexity levels W pl ⊂ W p−1 l · · · ⊂ W 1l as illustrated in Fig . 1 . Let r be the hidden channel shrinkage ratio such that d p l = r p−1dg and kpl = r p−1kg . It follows that the size of local model parameters |W pl | = r2 ( p−1 ) |Wg| and the model shrinkage ratio R = |W p l | |Wg| = r 2 ( p−1 ) . With this construction , we can adaptively allocate subsets of global model parameters according to the corresponding capabilities of local clients . Suppose that number of clients in each computation complexity level is { m1 , . . . , mp } . Specifically , we perform global aggregation in the following way . W pl = 1 m m∑ i=1 W pi , W p−1 l \W p l = 1 m−mp m−mp∑ i=1 W p−1i \W p i , . . . ( 1 ) W 1l \W 2l = 1 m−m2 : p m−m2 : p∑ i=1 W 1i \W 2i ( 2 ) Wg =W 1 l =W p l ∪ ( W p−1 l \W p l ) ∪ · · · ∪ ( W 1 l \W 2l ) ( 3 ) For notational convenience , we have dropped the iteration index t. We denote the W pi as a matrix/tensor . The W tg [ : dm , : km ] denotes the upper left submatrix with a size of dm × km . Also , W p−1 , t+1g \W p , t+1g denotes the set of elements included in W p−1 , t+1g but excluded in W p , t+1g . We exemplify the above equations using Fig . 1 . The first part of Equation ( 1 ) shows that the smallest part of model parameters ( blue , p = 3 ) is aggregated from all the local clients that contain it . In the second part of Equation ( 1 ) , the set difference between part p − 1 ( orange ) and p ( blue ) of model parameters is aggregated from local clients with computation complexity level smaller than p − 1 . In Equation ( 2 ) , the red part of model parameters can be similarly aggregated from m −m2 : p = m1 clients . In Equation ( 3 ) , the global model parameters W tg is constructed from the union of all disjoint sets of the partition . In summary , each parameter will be averaged from those clients whose allocated parameter matrix contains that parameter . Thus , a model of an intermediate complexity will have parameters fully averaged with all the other larger models but partially with smaller models ( according to the corresponding upper left submatrix ) . Several works show that wide neural networks can drop a tremendous number of parameters per layer and still produce acceptable results ( Han et al. , 2015 ; Frankle & Carbin , 2018 ) . The intuition is thus to perform global aggregation across all local models , at least on one subnetwork . To stabilize global model aggregation , we also allocate a fixed subnetwork for every computation complexity level . Our proposed inclusive subsets of global model parameters also guarantee that smaller local models will aggregate with more local models . Thus , small local models can benefit more from global aggregation by performing less global aggregation for part of larger local model parameters . We empirically found that this approach produces better results than uniformly sampled subnetworks for each client or computation complexity level . 3.2 STATIC BATCH NORMALIZATION . After global model parameters are distributed to active local clients , we can optimize local model parameters with private data . It is well-known that the latest deep learning models usually adopt Batch Normalization ( BN ) to facilitate and stabilize optimization . However , classical FedAvg and most recent works avoid BN . A major concern of BN is that it requires running estimates of representations at every hidden layer . Uploading these statistics to the server will cause higher communication costs and privacy issues Andreux et al . ( 2020 ) proposes to track running statistics locally . We highlight an adaptation of BN named as static Batch Normaliztion ( sBN ) for optimizing privacy constrained heterogeneous models . During the training phase , sBN does not track running estimates and simply normalize batch data . We do not track the local running statistics as the size of local models may also vary dynamically . This method is suitable for HeteroFL as every communication round is independent . After the training process finishes , the server sequentially query local clients and cumulatively update global BN statistics . There exist privacy concerns about calculating global statistics cumulatively and we hope to address those issues in the future work . We also empirically found this trick significantly outperforms other forms of normalization methods including the InstanceNorm ( Ulyanov et al. , 2016 ) , GroupNorm ( Wu & He , 2018 ) , and LayerNorm ( Ba et al. , 2016 ) as shown in Table 4 and Table 5 .
This paper proposes a new federated learning framework called HeteroFL, which supports the training of different sizes of local models in heterogeneous clients. Clients with higher computation capability can train larger models while clients with less computation capability train smaller models, and all these model architectures belong to the same model class. This approach dramatically benefits clients with limited computation capability and fully exploits their computation power.
SP:56e4d560f80360bd6f50d162caade651b5ff91a6
AlgebraNets
1 Introduction . Nearly universally , the atomic building blocks of artificial neural networks are scalar real-valued weights and scalar real-valued neuron activations that interact using standard rules of multiplication and addition . We propose AlgebraNets , where we replace the commonly used real-valued algebra with other associative algebras . Briefly , this amounts to replacing scalars by tuples and real multiplication by a tuple multiplication rule . For example , by replacing each scalar weight and activation with 2 × 2 matrices , and standard real addition / multiplication with matrix addition / multiplication . These alternative algebras provide three clear benefits for deep learning at scale : Parameter efficiency . One sweeping benefit of AlgebraNets is they are able to match baseline performance on a variety of tasks , spread over multiple domains , with fewer parameters than the competitive real-valued baselines . This means that equivalently capable models can be trained on smaller hardware , and for a given amount of memory , a model with greater effective capacity can be trained . We find some variants of AlgebraNets that are more parameter efficient than the previously considered C and H algebras . Throughout the text , we count parameters as the total number of real values e.g . a complex number counts as two parameters . Computational efficiency . For scaling large models , parameter efficiency is not the only bottleneck : FLOP efficiency – reducing the relative number of floating-point operations to achieve an equivalent accuracy – is also important . We find instantiations of AlgebraNets that are more FLOP efficient than the previously considered C and H algebras and as FLOP efficient as R. Additionally , all of the proposed algebras offer parameter reuse greater than 1 ( see Table 1 ) . That is , the ratio of multiplications performed to values consumed is greater than or equal to 1:1 . By contrast , for multiplication in R it is only 1:2 . Modern hardware requires a high ratio of floating point operations to bytes loaded ( bandwidth ) to become compute bound and saturate the arithmetic units . This is particularly problematic for auto-regressive inference ( dominated by matrix-vector multiplies ) , sparse models , depthwise convolutions and other operations with low arithmetic density . Architectural exploration . The choice of real numbers for weights and activations is usually taken for granted ( with some exceptions , e.g . those discussed in Sec . 3 ) . With AlgebraNets , we challenge this established design choice and open up a vast new space for neural network architecture exploration by showing that real numbers can be easily replaced with a variety of algebraic structures . Leveraging these new building blocks , one can consider different algebraic interactions , different choices of non-linearities , and different network architecture choices . Importantly , as we demonstrate in this work , AlgebraNets are not only scalable to large models and complex tasks , but they in fact offer improvements in model efficiency , which makes them a viable practical choice . We believe we have only begun to scratch the surface of what these alternative building blocks can enable , and we hope that their broader adoption will usher in further progress across the field . In summary , our main contributions are as follows : • We propose AlgebraNets — a novel class of neural networks , which replaces the nearly ubiquitously used real algebra with alternatives . We show that in contrast to previous work , algebra specific initializations and replacement of batch normalization by an expensive whitening procedure ( Trabelsi et al. , 2018 ; Gaudet and Maida , 2018 ; Wu et al. , 2020 ; Pan et al. , 2019 ) is not necessary , making them a near drop-in replacement to real-valued networks . • We evaluate AlgebraNets based on a wide range of algebras on three challenging large scale benchmarks : ImageNet image classification ( Russakovsky et al. , 2015 ) , Enwik8 ( LLC , 2009 ) , and WikiText language modelling ( Merity et al. , 2016 ) . • We explore sparse AlgebraNets to take advantage of their higher compute density . • We find that AlgebraNets offer improved parameter efficiency and FLOP parity compared to the real-valued baselines , which establishes them as a viable choice for efficient deep learning at scale . 2 AlgebraNets . 2.1 Why Algebras ? . We consider algebras because they have the right properties to make them a drop-in replacement for real numbers in typical neural networks . This is not surprising as the real numbers are an algebra over themselves . An algebra A over a field K ( which we take to always be the field of real or complex numbers ) satisfies the following properties1 ( Wikipedia contributors , 2020b ; a ) : 1 . It is a vector space overK . • It has an associative and commutative addition operator with an identity element ( x+ 0 = x ) and inverse element ( x+ ( −x ) = 0 ) . • It is possible to multiply elements of fieldK with vectors.2 2 . There is a right and left distributive multiplication operator • over vectors closed in A . 3 . Scalar multiplication combines with • in a compatible way : ( ax ) • ( by ) = ( ab ) ( x • y ) . We do not claim that these properties are all required as neural network building-blocks , merely that they are convenient . For example , one could imagine not having associative addition – this would require a careful implementation to get right but is possible . One could eliminate the requirement that scalars fromK multiply with vectors from A - this would make various normalizations ( e.g . batch normalization ) impossible , but they are not required . Most importantly , removing some of these requirements does not lead to an obviously useful class of mathematical objects to consider . In addition to the previously considered C and H algebras , we also consider the algebras of n× n matrices over R and C ( i.e . Mn ( R ) orMn ( C ) ) as they have higher compute density than R and map well to the matrix multiplication units that are becoming common in processors ( Oh , 2019 ) . We note 1We use the terminology ‘ vector ’ in the definition as that is the generally accepted mathematical term , however throughout the rest of the paper we use the term ‘ tuple ’ instead . This is to avoid the confusion of calling a matrix a vector , which is technically correct in this context , but rife with potential for confusion . 2a ( bx ) = ( ab ) x ; 1x = x for 1 , the multiplicative identity inK ; a ( x+y ) = ax+ay ; ( a+ b ) x = ax+ bx thatM2 ( R ) is isomorphic to the split-quaternion ( Cockle , 1849 ) algebra andM2 ( C ) is isomorphic to the biquaternion ( Hamilton , 1844 ) algebra , but the matrix algebras are more familiar so we retain that terminology . Lastly , we consider the dual numbers and the cross product of length-3 tuples . 2.2 Algebra Details . R ; Real Numbers All baseline networks are real-valued with scalar weights ; standard multiplication rules apply . For two weight values , we load 2 scalars and perform 1 multiply . C a b a a b b b −a We provide tables describing the multiplicative interaction between tuples . The interaction between two tuples ( oa , ob , ... ) = ( ta , tb , ... ) • ( va , vb , ... ) is described by a matrix where the indices of t are on the left , v are on the top and entries correspond to which component of o the interaction contributes to . A 0 means there is no interaction and a negative index means the result is subtracted . C ; Complex Numbers Each weight , w , is a length 2 tuple ( ta , tb ) representing the complex number ta + tbi . For two weight values we load 4 scalars and perform 4 multiplies . Mn ( R ) ; n×nMatricesEachweight is a lengthn2 tuple , representing ann×nmatrix . Multiplication and addition proceed with standard rules for matrices . We consider up toM4 ( R ) matrices . For two weight values we load 2n2 scalars and perform n3 multiplies . H a b c d a a b c d b b -a d -c c c -d -a b d d c -b -a Mn ( C ) ; n×nComplexMatricesWeights are length 2n2 tuples representing n × n complex-valued matrices . We consider only n = 2 . For two weight values we load 4n2 scalars and perform 4n3 multiplies . The multiplication table is in Appendix A. H ; Quaternions Each weight , wi is replaced by a length 4 tuple , ( ta , tb , tc , td ) . Multiplication is not commutative , with the product of two quaternions given by the Hamilton product ( Hamilton , 1843 ) . For two weight values , we load 8 elements and perform 16 multiplies . D a b c d a a 0 0 0 b 0 b 0 0 c 0 0 c 0 d 0 0 0 d Diagonal Algebra The high FLOP cost of the whitening operation required by ( Trabelsi et al. , 2018 ; Gaudet and Maida , 2018 ; Wu et al. , 2020 ; Pan et al. , 2019 ) makes networks using it inefficient at training and inference in terms of FLOPs . We attempt to design an algebra where using whitening would in fact be competitive by eliminating the interaction of terms through the algebra . Only when combining the ‘ diagonal ’ D algebra with whitening are there interactions between the different tuple components . a b a a b b b 0 Dual Numbers Each weight is represented by a length 2 tuple representing the dual number ( t0 + t1 ) . For a multiplication , we load 4 values and perform 3 multiplies . R3 a b c a 0 c -b b -c 0 a c b -a 0 R3 Cross Product Each weight is represented by a length 3 tuple . We use the cross product between two tuples for the multiplication rule , resulting in 6 different multiplies for 6 values loaded . 2.3 Initialization , Normalization , Non-Linearities , and Pruning . Prior work ( Trabelsi et al. , 2018 ; Gaudet andMaida , 2018 ) has advocated algebra-specific initializations and expensive whitening procedures to replace batch normalization . We find that this is not necessary to achieve good performance , and we are able to use the same initialization , normalization , and non-linearities across all algebras which facilitates exploring a wide variety of options . To initialize all the components of the algebra tuple at the beginning of a network we set the first tuple component to the typical input . For ResNet , MobileNet , and the RNN we initialize the other components of the tuple with a small one or two-layer MLP , i.e . tb , c , ... = MLP ( ta ) . For the transformer , we take advantage of the fact that the embedding is already a learned representation and simply reshape the output embedding appropriately . We find that the specifics of the input initialization do not have a large effect on performance , though allowing a learnable transformation outperformed initializing additional components to 0 or replicating the input . We use standard Glorot ( Glorot and Bengio , 2010 ) weight initialization of each component independently . Comparisons with the algebra specific initializations ( Trabelsi et al. , 2018 ; Gaudet and Maida , 2018 ) can be found in Appendix B . Existing activation functions can be applied component-wise ( t = ( f ( ta ) , · · · , f ( td ) ) ) and we found that ReLU and swish ( Ramachandran et al. , 2017 ) work well ; tanh and sigmoid can also be applied component-wise as part of GRUs and LSTMs . Applying the activation function to the entire tuple has possible computational advantages if it is ReLU-like as it would allow an entire tuple multiplication to be skipped . For example , consider t = f ( g ( t ) ) t. If g ( • ) returns the mean of the tuple , and if f was H the Heaviside step function , then one can remove entire components . Appendix B examines different choices for doing this , but we do not consider it further in the main text . The final logits of an AlgebraNet must be real-valued . We use an Algebra-specific final linear layer and convert the final algebra tuple to a scalar with the tuple-wise L2 norm before applying softmax . More details are in Appendix B . To apply magnitude pruning ( Zhu and Gupta , 2017 ; Gale et al. , 2019 ) to prune tuples we used the tuple L2 norm as the criterion for pruning for all AlgebraNet variants . For theMn ( R ) algebras we also experimented with criteria based on the eigenvalues , λi , and singular values , σi , of each n× n matrix . The Frobenius norm corresponds to ( ∑ i σ 2 i ) 1/2 and the determinant corresponds to ( ∏ i λi ) . We found pruning based on the Frobenius norm to be the most effective , followed by pruning based on the largest eigenvalue . See Appendix C for a comparison between different methods . ( Trabelsi et al. , 2018 ) , ( Gaudet and Maida , 2018 ) , and ( Wu et al. , 2020 ) use whitening in place of batch normalization . Whitening normalizes and de-correlates the different tuple elements from one another . However , this extension results in a substantial increase in both training and test time computational costs , as described in ( Pan et al. , 2019 ) . The inclusion of the whitening cost to the FLOP count in Fig . 1 highlights the substantial cost inference cost . Cholesky decomposition ( Press et al. , 2007 ) of the inverted covariance matrix is required during training and at inference it is not possible to fold the whitening transformation into adjacent convolutions . A contribution from each of the algebra elements contributes to each element in the whitened output . We find that batch normalization does not substantially decrease performance , trains 1.9× faster and has no inference cost , so we use it for all experiments , unless explicitly stated .
In this paper, the authors propose the usage of complex numbers in deep neural networks. Would be good to know that complex numbers, n x n matrices, quaternions, diagonal matrices, etc. all can be used in neural networks. The authors also claims benchmark performance in large-scale image classification and language modeling.
SP:9fad18ae03570219f7b9fd631dc6eccbbb41fa30
AlgebraNets
1 Introduction . Nearly universally , the atomic building blocks of artificial neural networks are scalar real-valued weights and scalar real-valued neuron activations that interact using standard rules of multiplication and addition . We propose AlgebraNets , where we replace the commonly used real-valued algebra with other associative algebras . Briefly , this amounts to replacing scalars by tuples and real multiplication by a tuple multiplication rule . For example , by replacing each scalar weight and activation with 2 × 2 matrices , and standard real addition / multiplication with matrix addition / multiplication . These alternative algebras provide three clear benefits for deep learning at scale : Parameter efficiency . One sweeping benefit of AlgebraNets is they are able to match baseline performance on a variety of tasks , spread over multiple domains , with fewer parameters than the competitive real-valued baselines . This means that equivalently capable models can be trained on smaller hardware , and for a given amount of memory , a model with greater effective capacity can be trained . We find some variants of AlgebraNets that are more parameter efficient than the previously considered C and H algebras . Throughout the text , we count parameters as the total number of real values e.g . a complex number counts as two parameters . Computational efficiency . For scaling large models , parameter efficiency is not the only bottleneck : FLOP efficiency – reducing the relative number of floating-point operations to achieve an equivalent accuracy – is also important . We find instantiations of AlgebraNets that are more FLOP efficient than the previously considered C and H algebras and as FLOP efficient as R. Additionally , all of the proposed algebras offer parameter reuse greater than 1 ( see Table 1 ) . That is , the ratio of multiplications performed to values consumed is greater than or equal to 1:1 . By contrast , for multiplication in R it is only 1:2 . Modern hardware requires a high ratio of floating point operations to bytes loaded ( bandwidth ) to become compute bound and saturate the arithmetic units . This is particularly problematic for auto-regressive inference ( dominated by matrix-vector multiplies ) , sparse models , depthwise convolutions and other operations with low arithmetic density . Architectural exploration . The choice of real numbers for weights and activations is usually taken for granted ( with some exceptions , e.g . those discussed in Sec . 3 ) . With AlgebraNets , we challenge this established design choice and open up a vast new space for neural network architecture exploration by showing that real numbers can be easily replaced with a variety of algebraic structures . Leveraging these new building blocks , one can consider different algebraic interactions , different choices of non-linearities , and different network architecture choices . Importantly , as we demonstrate in this work , AlgebraNets are not only scalable to large models and complex tasks , but they in fact offer improvements in model efficiency , which makes them a viable practical choice . We believe we have only begun to scratch the surface of what these alternative building blocks can enable , and we hope that their broader adoption will usher in further progress across the field . In summary , our main contributions are as follows : • We propose AlgebraNets — a novel class of neural networks , which replaces the nearly ubiquitously used real algebra with alternatives . We show that in contrast to previous work , algebra specific initializations and replacement of batch normalization by an expensive whitening procedure ( Trabelsi et al. , 2018 ; Gaudet and Maida , 2018 ; Wu et al. , 2020 ; Pan et al. , 2019 ) is not necessary , making them a near drop-in replacement to real-valued networks . • We evaluate AlgebraNets based on a wide range of algebras on three challenging large scale benchmarks : ImageNet image classification ( Russakovsky et al. , 2015 ) , Enwik8 ( LLC , 2009 ) , and WikiText language modelling ( Merity et al. , 2016 ) . • We explore sparse AlgebraNets to take advantage of their higher compute density . • We find that AlgebraNets offer improved parameter efficiency and FLOP parity compared to the real-valued baselines , which establishes them as a viable choice for efficient deep learning at scale . 2 AlgebraNets . 2.1 Why Algebras ? . We consider algebras because they have the right properties to make them a drop-in replacement for real numbers in typical neural networks . This is not surprising as the real numbers are an algebra over themselves . An algebra A over a field K ( which we take to always be the field of real or complex numbers ) satisfies the following properties1 ( Wikipedia contributors , 2020b ; a ) : 1 . It is a vector space overK . • It has an associative and commutative addition operator with an identity element ( x+ 0 = x ) and inverse element ( x+ ( −x ) = 0 ) . • It is possible to multiply elements of fieldK with vectors.2 2 . There is a right and left distributive multiplication operator • over vectors closed in A . 3 . Scalar multiplication combines with • in a compatible way : ( ax ) • ( by ) = ( ab ) ( x • y ) . We do not claim that these properties are all required as neural network building-blocks , merely that they are convenient . For example , one could imagine not having associative addition – this would require a careful implementation to get right but is possible . One could eliminate the requirement that scalars fromK multiply with vectors from A - this would make various normalizations ( e.g . batch normalization ) impossible , but they are not required . Most importantly , removing some of these requirements does not lead to an obviously useful class of mathematical objects to consider . In addition to the previously considered C and H algebras , we also consider the algebras of n× n matrices over R and C ( i.e . Mn ( R ) orMn ( C ) ) as they have higher compute density than R and map well to the matrix multiplication units that are becoming common in processors ( Oh , 2019 ) . We note 1We use the terminology ‘ vector ’ in the definition as that is the generally accepted mathematical term , however throughout the rest of the paper we use the term ‘ tuple ’ instead . This is to avoid the confusion of calling a matrix a vector , which is technically correct in this context , but rife with potential for confusion . 2a ( bx ) = ( ab ) x ; 1x = x for 1 , the multiplicative identity inK ; a ( x+y ) = ax+ay ; ( a+ b ) x = ax+ bx thatM2 ( R ) is isomorphic to the split-quaternion ( Cockle , 1849 ) algebra andM2 ( C ) is isomorphic to the biquaternion ( Hamilton , 1844 ) algebra , but the matrix algebras are more familiar so we retain that terminology . Lastly , we consider the dual numbers and the cross product of length-3 tuples . 2.2 Algebra Details . R ; Real Numbers All baseline networks are real-valued with scalar weights ; standard multiplication rules apply . For two weight values , we load 2 scalars and perform 1 multiply . C a b a a b b b −a We provide tables describing the multiplicative interaction between tuples . The interaction between two tuples ( oa , ob , ... ) = ( ta , tb , ... ) • ( va , vb , ... ) is described by a matrix where the indices of t are on the left , v are on the top and entries correspond to which component of o the interaction contributes to . A 0 means there is no interaction and a negative index means the result is subtracted . C ; Complex Numbers Each weight , w , is a length 2 tuple ( ta , tb ) representing the complex number ta + tbi . For two weight values we load 4 scalars and perform 4 multiplies . Mn ( R ) ; n×nMatricesEachweight is a lengthn2 tuple , representing ann×nmatrix . Multiplication and addition proceed with standard rules for matrices . We consider up toM4 ( R ) matrices . For two weight values we load 2n2 scalars and perform n3 multiplies . H a b c d a a b c d b b -a d -c c c -d -a b d d c -b -a Mn ( C ) ; n×nComplexMatricesWeights are length 2n2 tuples representing n × n complex-valued matrices . We consider only n = 2 . For two weight values we load 4n2 scalars and perform 4n3 multiplies . The multiplication table is in Appendix A. H ; Quaternions Each weight , wi is replaced by a length 4 tuple , ( ta , tb , tc , td ) . Multiplication is not commutative , with the product of two quaternions given by the Hamilton product ( Hamilton , 1843 ) . For two weight values , we load 8 elements and perform 16 multiplies . D a b c d a a 0 0 0 b 0 b 0 0 c 0 0 c 0 d 0 0 0 d Diagonal Algebra The high FLOP cost of the whitening operation required by ( Trabelsi et al. , 2018 ; Gaudet and Maida , 2018 ; Wu et al. , 2020 ; Pan et al. , 2019 ) makes networks using it inefficient at training and inference in terms of FLOPs . We attempt to design an algebra where using whitening would in fact be competitive by eliminating the interaction of terms through the algebra . Only when combining the ‘ diagonal ’ D algebra with whitening are there interactions between the different tuple components . a b a a b b b 0 Dual Numbers Each weight is represented by a length 2 tuple representing the dual number ( t0 + t1 ) . For a multiplication , we load 4 values and perform 3 multiplies . R3 a b c a 0 c -b b -c 0 a c b -a 0 R3 Cross Product Each weight is represented by a length 3 tuple . We use the cross product between two tuples for the multiplication rule , resulting in 6 different multiplies for 6 values loaded . 2.3 Initialization , Normalization , Non-Linearities , and Pruning . Prior work ( Trabelsi et al. , 2018 ; Gaudet andMaida , 2018 ) has advocated algebra-specific initializations and expensive whitening procedures to replace batch normalization . We find that this is not necessary to achieve good performance , and we are able to use the same initialization , normalization , and non-linearities across all algebras which facilitates exploring a wide variety of options . To initialize all the components of the algebra tuple at the beginning of a network we set the first tuple component to the typical input . For ResNet , MobileNet , and the RNN we initialize the other components of the tuple with a small one or two-layer MLP , i.e . tb , c , ... = MLP ( ta ) . For the transformer , we take advantage of the fact that the embedding is already a learned representation and simply reshape the output embedding appropriately . We find that the specifics of the input initialization do not have a large effect on performance , though allowing a learnable transformation outperformed initializing additional components to 0 or replicating the input . We use standard Glorot ( Glorot and Bengio , 2010 ) weight initialization of each component independently . Comparisons with the algebra specific initializations ( Trabelsi et al. , 2018 ; Gaudet and Maida , 2018 ) can be found in Appendix B . Existing activation functions can be applied component-wise ( t = ( f ( ta ) , · · · , f ( td ) ) ) and we found that ReLU and swish ( Ramachandran et al. , 2017 ) work well ; tanh and sigmoid can also be applied component-wise as part of GRUs and LSTMs . Applying the activation function to the entire tuple has possible computational advantages if it is ReLU-like as it would allow an entire tuple multiplication to be skipped . For example , consider t = f ( g ( t ) ) t. If g ( • ) returns the mean of the tuple , and if f was H the Heaviside step function , then one can remove entire components . Appendix B examines different choices for doing this , but we do not consider it further in the main text . The final logits of an AlgebraNet must be real-valued . We use an Algebra-specific final linear layer and convert the final algebra tuple to a scalar with the tuple-wise L2 norm before applying softmax . More details are in Appendix B . To apply magnitude pruning ( Zhu and Gupta , 2017 ; Gale et al. , 2019 ) to prune tuples we used the tuple L2 norm as the criterion for pruning for all AlgebraNet variants . For theMn ( R ) algebras we also experimented with criteria based on the eigenvalues , λi , and singular values , σi , of each n× n matrix . The Frobenius norm corresponds to ( ∑ i σ 2 i ) 1/2 and the determinant corresponds to ( ∏ i λi ) . We found pruning based on the Frobenius norm to be the most effective , followed by pruning based on the largest eigenvalue . See Appendix C for a comparison between different methods . ( Trabelsi et al. , 2018 ) , ( Gaudet and Maida , 2018 ) , and ( Wu et al. , 2020 ) use whitening in place of batch normalization . Whitening normalizes and de-correlates the different tuple elements from one another . However , this extension results in a substantial increase in both training and test time computational costs , as described in ( Pan et al. , 2019 ) . The inclusion of the whitening cost to the FLOP count in Fig . 1 highlights the substantial cost inference cost . Cholesky decomposition ( Press et al. , 2007 ) of the inverted covariance matrix is required during training and at inference it is not possible to fold the whitening transformation into adjacent convolutions . A contribution from each of the algebra elements contributes to each element in the whitened output . We find that batch normalization does not substantially decrease performance , trains 1.9× faster and has no inference cost , so we use it for all experiments , unless explicitly stated .
The authors propose AlgebraNets - a previously explored approach to replace real-valued algebra in deep learning models with other associative algebras that include 2x2 matrices over real and complex numbers. They provide a comprehensive overview of prior methods in this direction and motivate their work with potential for both parameter and computational efficiency, and suggest that the latter is typically overlooked in prior literature. The paper is very well-written and follows a nice narrative, and the claims are mostly backed empirically with experimental results.
SP:9fad18ae03570219f7b9fd631dc6eccbbb41fa30
Graph Convolution with Low-rank Learnable Local Filters
1 Introduction . Deep methods have achieved great success in visual cognition , yet they still lack capability to tackle severe geometric transformations such as rotation , scaling and viewpoint changes . This problem is often handled by conducting data augmentations with these geometric variations included , e.g . by randomly rotating images , so as to make the trained model robust to these variations . However , this would remarkably increase the cost of training time and model parameters . Another way is to make use of certain underlying structures of objects , e.g . facial landmarks ( Chen et al. , 2013 ) and human skeleton landmarks ( Vemulapalli et al. , 2014a ) , c.f . Fig . 1 ( right ) . Nevertheless , these methods then adopt hand-crafted features based on landmarks , which greatly constrains their ability to obtain rich features for downstream tasks . One of the main obstacles for feature extraction is the non-Euclidean property of underlying structures , and particularly , it prohibits the direct usage of prevalent convolutional neural network ( CNN ) architectures ( He et al. , 2016 ; Huang et al. , 2017 ) . Whereas there are recent CNN models designed for non-Euclidean grids , e.g. , for spherical mesh ( Jiang et al. , 2019 ; Cohen et al. , 2018 ; Coors et al. , 2018 ) and manifold mesh in computer graphics ( Bronstein et al. , 2017 ; Fey et al. , 2018 ) , they mainly rely on partial differential operators which only can be calculated precisely on fine and regular mesh , and may not be applicable to the landmarks which are irregular and course . Recent works have also applied Graph Neural Network ( GNN ) approaches to coarse non-Euclidean data , yet methods using GCN ( Kipf & Welling , 2016 ) may fall short of model capacity , and other methods adopting GAT ( Veličković et al. , 2017 ) are mostly heuristic and lacking theoretical analysis . A detailed review is provided in Sec . 1.1 . In this paper , we propose a graph convolution model , called L3Net , originating from lowrank graph filter decomposition , c.f . Fig . 1 ( left ) . The model provides a unified framework for graph convolutions , including ChebNet ( Defferrard et al. , 2016 ) , GAT , EdgeNet ( Isufi et al. , 2020 ) and CNN/geometrical CNN with low-rank filter as special cases . In addition , we theoretically prove that L3Net is strictly more expressive to represent graph signals than spectral graph convolutions based on global adjacency/graph Laplacian matrices , which is then empirically validated , c.f . Sec . 3.1 . We also prove a Lipschitz-type representation stability of the new graph convolution layer using perturbation analysis . Because our model allows neighborhood specialized local graph filters , regularization may be needed to prevent over-fitting , so as to handle changing underlying graph topology and other graph noise , e.g. , inaccurately detected landmarks or missing landmark points due to occlusions . Therefore , we also introduce a regularization scheme based on local graph Laplacians , motivated by the eigen property of the latter . This further improves the representation stability aforementioned . The improved performance of L3Net compared to other GNN benchmarks is demonstrated in a series of experiments , and with the the proposed graph regularization , our model shows robustness to a variety of graph data noise . In summary , the contributions of the work are the following : • We propose a new graph convolution model by a low-rank decomposition of graph filters over trainable local basis , which unifies several previous models of both spectral and spatial graph convolutions . • Regularization by local graph Laplacians is introduced to improve the robustness against graph noise . • We provide theoretical proof of the enlarged expressiveness for representing graph signals and the Lipschitz-type input-perturbation stability of the new graph convolution model . • We demonstrate with applications to object recognition of spherical data and facial expression/skeleton-based action recognition using landmarks . Model robustness against graph data noise is validated on both real-world and simulated datasets . 1.1 Related Works . Modeling on face/body landmark data . Many applications in computer vision , such as facial expression recognition ( FER ) and skeleton-based action recognition , need to extract high-level features from landmarked data which are sampled at irregular grid points on human face or at body joints . While CNN methods ( Guo et al. , 2016 ; Ding et al. , 2017 ; Meng et al. , 2017 ) prevail in FER task , landmark methods have the potential advantage in lighter model size as well as more robustness to previously mentioned geometric transformations like pose variation . Earlier methods based on facial landmarks used hand-crafted features ( Jeong & Ko , 2018 ; Morales-Vargas et al. , 2019 ) rather than deep networks . Skeleton-based methods in action recognition have been developed intensively recently ( Ren et al. , 2020 ) , including non-deep methods ( Vemulapalli et al. , 2014b ; Wang et al. , 2012 ) and deep methods ( Ke et al. , 2017 ; Kim & Reiter , 2017 ; Liu et al. , 2016 ; Yan et al. , 2018 ) . Facial and skeleton landmarks only give a coarse and irregular grid , and then mesh-based geometrical CNN ’ s are hardly applicable , while previous GNN models on such tasks may lack sufficient expressive power . Graph convolutional network . A systematic review can be found in several places , e.g . Wu et al . ( 2020 ) . Spectral graph convolution was proposed using full eigen decomposition of the graph Laplacian in Bruna et al . ( 2013 ) , Chebyshev polynomial in ChebNet ( Defferrard et al. , 2016 ) , by Cayley polynomials in Levie et al . ( 2018 ) . GCN ( Kipf & Welling , 2016 ) , the mostly-used GNN , is a variant of ChebNet using degree-1 polynomial . Liao et al . ( 2019 ) accelerated the spectral computation by Lanczos algorithm . Graph scattering transform has been developed using graph wavelets ( Zou & Lerman , 2020 ; Gama et al. , 2019b ) , which can be constructed in the spectral domain ( Hammond et al. , 2011 ) and by diffusion wavelets ( Coifman & Maggioni , 2006 ) . The scattering transform enjoys theoretical properties of the representation but lacks adaptivity compared to trainable neural networks . Spatial graph convolution has been performed by summing up neighbor nodes ’ transformed features in NN4G ( Scarselli et al. , 2008 ) , by graph diffusion process in DCNN ( Atwood & Towsley , 2016 ) , where the graph propagation across nodes is by the adjacency matrix . Graph convolution with trainable filter has also been proposed in several settings : MPNN ( Gilmer et al. , 2017 ) enhanced model expressiveness by message passing and sub-network ; GraphSage ( Hamilton et al. , 2017 ) used trainable differential local aggregator functions in the form of LSTM or mean/max-pooling ; GAT ( Veličković et al. , 2017 ) and variants ( Li et al. , 2018 ; Zhang et al. , 2018 ; Liu et al. , 2019 ) introduced attention mechanism to achieve adaptive graph affinity , which remains non-negative valued ; EdgeNet ( Isufi et al. , 2020 ) developed adaptive filters by taking products of trainable local filters . Our model learns local filters which can take negative values and contains GAT and EdgeNet as special cases . Theoretically , expressive power of GNN has been studied in Morris et al . ( 2019 ) ; Xu et al . ( 2019 ) ; Maron et al . ( 2019a ; b ) ; Keriven & Peyré ( 2019 ) , mainly focusing on distinguishing graph topologies , while our primary concern is to distinguish signals lying on a graph . CNN and geometrical CNN . Standard CNN applies local filters translated and shared across locations on an Euclidean domain . To extend CNN to non-Euclidean domains , convolution on a regular spherical mesh using geometrical information has been studied in S2CNN ( Cohen et al. , 2018 ) , SphereNet ( Coors et al. , 2018 ) , SphericalCNN ( Esteves et al. , 2018 ) , and UGSCNN ( Jiang et al. , 2019 ) , and applied to 3D object recognition , for which other deep methods include 3D convolutional ( Qi et al. , 2016 ) and non-convolutional architectures ( Qi et al. , 2017a ; b ) . CNN ’ s on manifolds construct weight-sharing across local atlas making use of a mesh , e.g. , by patch operator in Masci et al . ( 2015 ) , anisotropic convolution in ACNN ( Boscaini et al. , 2016 ) , mixture model parametrization in MoNet ( Monti et al. , 2017 ) , spline functions in SplineCNN ( Fey et al. , 2018 ) , and manifold parallel transport in Schonsheck et al . ( 2018 ) . These geometric CNN models use information of non-Euclidean meshes which usually need sufficiently fine resolution . 2 Method . 2.1 Decomposed local filters . Consider an undirected graph G = ( V , E ) , |V | = n. A graph convolution layer maps from input node features X ( u′ , c′ ) to output Y ( u , c ) , where u , u′ ∈ V , c′ ∈ [ C ′ ] ( c ∈ [ C ] ) is the input ( output ) channel index , the notation [ m ] means { 1 , · · · , m } , and Y ( u , c ) = σ ( ∑ u′∈V , c′∈ [ C′ ] M ( u′ , u ; c′ , c ) X ( u′ , c′ ) + bias ( c ) ) , u ∈ V , c ∈ [ C ] . ( 1 ) The spatial and spectral graph convolutions correspond to different ways of specifying M , c.f . Sec . 2.3 . The proposed graph convolution is defined as M ( u′ , u ; c′ , c ) = K∑ k=1 ak ( c ′ , c ) Bk ( u ′ , u ) , ak ( c ′ , c ) ∈ R , ( 2 ) where Bk ( u ′ , u ) is non-zero only when u′ ∈ N ( dk ) u , N ( d ) u denoting the d-th order neighborhood of u ( i.e. , the set of d-neighbors of u ) , and K is a fixed number . In other words , Bk ’ s are K basis of local filters around each u , and the order dk can differ with 1 ≤ k ≤ K. Both ak and Bk are trainable , so the number of parameters are K ·CC ′ + ∑K k=1 ∑ u∈V |N ( dk ) u | ∼ K ·CC ′ +Knp , where p stands for the average local patch size . In our experiments we use K up to 5 , and dk up to 3 . We provide the matrix notation of ( 2 ) in Appendix A.1 . The construction ( 2 ) can be used as a layer type in larger GNN architectures . Pooling of graphs can be added between layers , and see Appendix C.5 for further discussion on multiscale model . The choice of K and neighborhood orders ( d1 , · · · , dK ) can also be adjusted accordingly . The model may be extended in several ways to be discussed in the last section .
This paper proposed L3Net which is a new graph convolution with decomposing the learnable local filters into low-rank. It can contain both spatial and spectral graph convolution (including ChebNet, GAT, EdgeNet and so on) as subsets. It is also robust to graph noise. Experiments are conducted on mesh data, facial recognition and action recognition, indicating out-performed performance over baselines. Its robustness to graph noise is also tested.
SP:cbfb4439fcbf27dc2c05675123b7b0555acdbf33
Graph Convolution with Low-rank Learnable Local Filters
1 Introduction . Deep methods have achieved great success in visual cognition , yet they still lack capability to tackle severe geometric transformations such as rotation , scaling and viewpoint changes . This problem is often handled by conducting data augmentations with these geometric variations included , e.g . by randomly rotating images , so as to make the trained model robust to these variations . However , this would remarkably increase the cost of training time and model parameters . Another way is to make use of certain underlying structures of objects , e.g . facial landmarks ( Chen et al. , 2013 ) and human skeleton landmarks ( Vemulapalli et al. , 2014a ) , c.f . Fig . 1 ( right ) . Nevertheless , these methods then adopt hand-crafted features based on landmarks , which greatly constrains their ability to obtain rich features for downstream tasks . One of the main obstacles for feature extraction is the non-Euclidean property of underlying structures , and particularly , it prohibits the direct usage of prevalent convolutional neural network ( CNN ) architectures ( He et al. , 2016 ; Huang et al. , 2017 ) . Whereas there are recent CNN models designed for non-Euclidean grids , e.g. , for spherical mesh ( Jiang et al. , 2019 ; Cohen et al. , 2018 ; Coors et al. , 2018 ) and manifold mesh in computer graphics ( Bronstein et al. , 2017 ; Fey et al. , 2018 ) , they mainly rely on partial differential operators which only can be calculated precisely on fine and regular mesh , and may not be applicable to the landmarks which are irregular and course . Recent works have also applied Graph Neural Network ( GNN ) approaches to coarse non-Euclidean data , yet methods using GCN ( Kipf & Welling , 2016 ) may fall short of model capacity , and other methods adopting GAT ( Veličković et al. , 2017 ) are mostly heuristic and lacking theoretical analysis . A detailed review is provided in Sec . 1.1 . In this paper , we propose a graph convolution model , called L3Net , originating from lowrank graph filter decomposition , c.f . Fig . 1 ( left ) . The model provides a unified framework for graph convolutions , including ChebNet ( Defferrard et al. , 2016 ) , GAT , EdgeNet ( Isufi et al. , 2020 ) and CNN/geometrical CNN with low-rank filter as special cases . In addition , we theoretically prove that L3Net is strictly more expressive to represent graph signals than spectral graph convolutions based on global adjacency/graph Laplacian matrices , which is then empirically validated , c.f . Sec . 3.1 . We also prove a Lipschitz-type representation stability of the new graph convolution layer using perturbation analysis . Because our model allows neighborhood specialized local graph filters , regularization may be needed to prevent over-fitting , so as to handle changing underlying graph topology and other graph noise , e.g. , inaccurately detected landmarks or missing landmark points due to occlusions . Therefore , we also introduce a regularization scheme based on local graph Laplacians , motivated by the eigen property of the latter . This further improves the representation stability aforementioned . The improved performance of L3Net compared to other GNN benchmarks is demonstrated in a series of experiments , and with the the proposed graph regularization , our model shows robustness to a variety of graph data noise . In summary , the contributions of the work are the following : • We propose a new graph convolution model by a low-rank decomposition of graph filters over trainable local basis , which unifies several previous models of both spectral and spatial graph convolutions . • Regularization by local graph Laplacians is introduced to improve the robustness against graph noise . • We provide theoretical proof of the enlarged expressiveness for representing graph signals and the Lipschitz-type input-perturbation stability of the new graph convolution model . • We demonstrate with applications to object recognition of spherical data and facial expression/skeleton-based action recognition using landmarks . Model robustness against graph data noise is validated on both real-world and simulated datasets . 1.1 Related Works . Modeling on face/body landmark data . Many applications in computer vision , such as facial expression recognition ( FER ) and skeleton-based action recognition , need to extract high-level features from landmarked data which are sampled at irregular grid points on human face or at body joints . While CNN methods ( Guo et al. , 2016 ; Ding et al. , 2017 ; Meng et al. , 2017 ) prevail in FER task , landmark methods have the potential advantage in lighter model size as well as more robustness to previously mentioned geometric transformations like pose variation . Earlier methods based on facial landmarks used hand-crafted features ( Jeong & Ko , 2018 ; Morales-Vargas et al. , 2019 ) rather than deep networks . Skeleton-based methods in action recognition have been developed intensively recently ( Ren et al. , 2020 ) , including non-deep methods ( Vemulapalli et al. , 2014b ; Wang et al. , 2012 ) and deep methods ( Ke et al. , 2017 ; Kim & Reiter , 2017 ; Liu et al. , 2016 ; Yan et al. , 2018 ) . Facial and skeleton landmarks only give a coarse and irregular grid , and then mesh-based geometrical CNN ’ s are hardly applicable , while previous GNN models on such tasks may lack sufficient expressive power . Graph convolutional network . A systematic review can be found in several places , e.g . Wu et al . ( 2020 ) . Spectral graph convolution was proposed using full eigen decomposition of the graph Laplacian in Bruna et al . ( 2013 ) , Chebyshev polynomial in ChebNet ( Defferrard et al. , 2016 ) , by Cayley polynomials in Levie et al . ( 2018 ) . GCN ( Kipf & Welling , 2016 ) , the mostly-used GNN , is a variant of ChebNet using degree-1 polynomial . Liao et al . ( 2019 ) accelerated the spectral computation by Lanczos algorithm . Graph scattering transform has been developed using graph wavelets ( Zou & Lerman , 2020 ; Gama et al. , 2019b ) , which can be constructed in the spectral domain ( Hammond et al. , 2011 ) and by diffusion wavelets ( Coifman & Maggioni , 2006 ) . The scattering transform enjoys theoretical properties of the representation but lacks adaptivity compared to trainable neural networks . Spatial graph convolution has been performed by summing up neighbor nodes ’ transformed features in NN4G ( Scarselli et al. , 2008 ) , by graph diffusion process in DCNN ( Atwood & Towsley , 2016 ) , where the graph propagation across nodes is by the adjacency matrix . Graph convolution with trainable filter has also been proposed in several settings : MPNN ( Gilmer et al. , 2017 ) enhanced model expressiveness by message passing and sub-network ; GraphSage ( Hamilton et al. , 2017 ) used trainable differential local aggregator functions in the form of LSTM or mean/max-pooling ; GAT ( Veličković et al. , 2017 ) and variants ( Li et al. , 2018 ; Zhang et al. , 2018 ; Liu et al. , 2019 ) introduced attention mechanism to achieve adaptive graph affinity , which remains non-negative valued ; EdgeNet ( Isufi et al. , 2020 ) developed adaptive filters by taking products of trainable local filters . Our model learns local filters which can take negative values and contains GAT and EdgeNet as special cases . Theoretically , expressive power of GNN has been studied in Morris et al . ( 2019 ) ; Xu et al . ( 2019 ) ; Maron et al . ( 2019a ; b ) ; Keriven & Peyré ( 2019 ) , mainly focusing on distinguishing graph topologies , while our primary concern is to distinguish signals lying on a graph . CNN and geometrical CNN . Standard CNN applies local filters translated and shared across locations on an Euclidean domain . To extend CNN to non-Euclidean domains , convolution on a regular spherical mesh using geometrical information has been studied in S2CNN ( Cohen et al. , 2018 ) , SphereNet ( Coors et al. , 2018 ) , SphericalCNN ( Esteves et al. , 2018 ) , and UGSCNN ( Jiang et al. , 2019 ) , and applied to 3D object recognition , for which other deep methods include 3D convolutional ( Qi et al. , 2016 ) and non-convolutional architectures ( Qi et al. , 2017a ; b ) . CNN ’ s on manifolds construct weight-sharing across local atlas making use of a mesh , e.g. , by patch operator in Masci et al . ( 2015 ) , anisotropic convolution in ACNN ( Boscaini et al. , 2016 ) , mixture model parametrization in MoNet ( Monti et al. , 2017 ) , spline functions in SplineCNN ( Fey et al. , 2018 ) , and manifold parallel transport in Schonsheck et al . ( 2018 ) . These geometric CNN models use information of non-Euclidean meshes which usually need sufficiently fine resolution . 2 Method . 2.1 Decomposed local filters . Consider an undirected graph G = ( V , E ) , |V | = n. A graph convolution layer maps from input node features X ( u′ , c′ ) to output Y ( u , c ) , where u , u′ ∈ V , c′ ∈ [ C ′ ] ( c ∈ [ C ] ) is the input ( output ) channel index , the notation [ m ] means { 1 , · · · , m } , and Y ( u , c ) = σ ( ∑ u′∈V , c′∈ [ C′ ] M ( u′ , u ; c′ , c ) X ( u′ , c′ ) + bias ( c ) ) , u ∈ V , c ∈ [ C ] . ( 1 ) The spatial and spectral graph convolutions correspond to different ways of specifying M , c.f . Sec . 2.3 . The proposed graph convolution is defined as M ( u′ , u ; c′ , c ) = K∑ k=1 ak ( c ′ , c ) Bk ( u ′ , u ) , ak ( c ′ , c ) ∈ R , ( 2 ) where Bk ( u ′ , u ) is non-zero only when u′ ∈ N ( dk ) u , N ( d ) u denoting the d-th order neighborhood of u ( i.e. , the set of d-neighbors of u ) , and K is a fixed number . In other words , Bk ’ s are K basis of local filters around each u , and the order dk can differ with 1 ≤ k ≤ K. Both ak and Bk are trainable , so the number of parameters are K ·CC ′ + ∑K k=1 ∑ u∈V |N ( dk ) u | ∼ K ·CC ′ +Knp , where p stands for the average local patch size . In our experiments we use K up to 5 , and dk up to 3 . We provide the matrix notation of ( 2 ) in Appendix A.1 . The construction ( 2 ) can be used as a layer type in larger GNN architectures . Pooling of graphs can be added between layers , and see Appendix C.5 for further discussion on multiscale model . The choice of K and neighborhood orders ( d1 , · · · , dK ) can also be adjusted accordingly . The model may be extended in several ways to be discussed in the last section .
The paper presents a graph neural network (GNN) architecture with learnable low-rank filters that unifies various recently-proposed GNN-based methods. The local filters substitute the graph shift operator (GSO) by a learnable set of parameters that capture the local connectivity of each node in the graph. Moreover, a regularization penalty is proposed to increase the robustness of the model and prevent these local structures to overfit. The paper provides proofs to justify the generality of the approach and how different methods can be seen as a particularization of the proposed scheme. Two theorems are also proved to claim the stability of the GNN architecture against dilation perturbations in the input signal. Several numerical experiments are conducted to empirically test the usefulness of the model.
SP:cbfb4439fcbf27dc2c05675123b7b0555acdbf33
Explainable Subgraph Reasoning for Forecasting on Temporal Knowledge Graphs
1 INTRODUCTION . Reasoning , a process of inferring new knowledge from available facts , has long been considered an essential topic in AI research . Recently , reasoning on knowledge graphs ( KG ) has gained increasing interest ( Das et al. , 2017 ; Ren et al. , 2020 ; Hildebrandt et al. , 2020 ) . A knowledge graph is a graphstructured knowledge base that stores factual information in the form of triples ( s , p , o ) , e.g. , ( Alice , livesIn , Toronto ) . In particular , s ( subject ) and o ( object ) are expressed as nodes and p ( predicate ) as an edge type . Most knowledge graph models assume that the underlying graph is static . However , in the real world , facts and knowledge can change with time . For example , ( Alice , livesIn , Toronto ) becomes invalid after Alice moves to Vancouver . To accommodate time-evolving multi-relational data , temporal KGs have been introduced ( Boschee et al. , 2015 ) , where a temporal fact is represented as a quadruple by extending the static triple with a timestamp t indicating the triple is valid at t , i.e . ( Barack Obama , visit , India , 2010-11-06 ) . In this work , we focus on forecasting on temporal KGs , where we infer future events based on past events . Forecasting on temporal KGs can improve a plethora of downstream applications such as decision support in personalized health care and finance . The use cases often require the predictions made by the learning models to be interpretable , such that users can understand and trust the predictions . However , current machine learning approaches ( Trivedi et al. , 2017 ; Jin et al. , 2019 ) for temporal KG forecasting operate in a black-box fashion , where they design an embedding-based score function to estimate the plausibility of a quadruple . These models can not clearly show which evidence contributes to a prediction and lack explainability to the forecast , making them less suitable for many real-world applications . ∗Equal contribution . †Corresponding authors . Explainable approaches can generally be categorized into post-hoc interpretable methods and integrated transparent methods ( Došilović et al. , 2018 ) . Post-hoc interpretable approaches ( Montavon et al. , 2017 ; Ying et al. , 2019 ) aim to interpret the results of a black-box model , while integrated transparent approaches ( Das et al. , 2017 ; Qiu et al. , 2019 ; Wang et al. , 2019 ) have an explainable internal mechanism . In particular , most integrated transparent ( Lin et al. , 2018 ; Hildebrandt et al. , 2020 ) approaches for KGs employ path-based methods to derive an explicit reasoning path and demonstrate a transparent reasoning process . The path-based methods focus on finding the answer to a query within a single reasoning chain . However , many complicated queries require multiple supporting reasoning chains rather than just one reasoning path . Recent work ( Xu et al. , 2019 ; Teru et al. , 2019 ) has shown that reasoning over local subgraphs substantially boosts performance while maintaining interpretability . However , these explainable models can not be applied to temporal graph-structured data because they do not take time information into account . This work aims to design a transparent forecasting mechanism on temporal KGs that can generate informative explanations of the predictions . In this paper , we propose an explainable reasoning framework for forecasting future links on temporal knowledge graphs , xERTE , which employs a sequential reasoning process over local subgraphs . To answer a query in the form of ( subject eq , predicate pq , ? , timestamp tq ) , xERTE starts from the query subject , iteratively samples relevant edges of entities included in the subgraph and propagates attention along the sampled edges . After several rounds of expansion and pruning , the missing object is predicted from entities in the subgraph . Thus , the extracted subgraph can be seen as a concise and compact graphical explanation of the prediction . To guide the subgraph to expand in the direction of the query ’ s interest , we propose a temporal relational graph attention ( TRGA ) mechanism . We pose temporal constraints on passing messages to preserve the causal nature of the temporal data . Specifically , we update the time-dependent hidden representation of an entity ei at a timestamp t by attentively aggregating messages from its temporal neighbors that were linked with ei prior to t. We call such temporal neighbors as prior neighbors of ei . Additionally , we use an embedding module consisting of stationary entity embeddings and functional time encoding , enabling the model to capture both global structural information and temporal dynamics . Besides , we develop a novel representation update mechanism to mimic human reasoning behavior . When humans perform a reasoning process , their perceived profiles of observed entities will update , as new clues are found . Thus , it is necessary to ensure that all entities in a subgraph can receive messages from prior neighbors newly added to the subgraph . To this end , the proposed representation update mechanism enables every entity to receive messages from its farthest prior neighbors in the subgraph . The major contributions of this work are as follows . ( 1 ) We develop xERTE , the first explainable model for predicting future links on temporal KGs . The model is based on a temporal relational attention mechanisms that preserves the causal nature of the temporal multi-relational data . ( 2 ) Unlike most black-box embedding-based models , xERTE visualizes the reasoning process and provides an interpretable inference graph to emphasize important evidence . ( 3 ) The dynamical pruning procedure enables our model to perform reasoning on large-scale temporal knowledge graphs with millions of edges . ( 4 ) We apply our model for forecasting future links on four benchmark temporal knowledge graphs . The results show that our method achieves on average a better performance than current state-of-the-art methods , thus providing a new baseline . ( 5 ) We conduct a survey with 53 respondents to evaluate whether the extracted evidence is aligned with human understanding . 2 RELATED WORK . Representation learning is an expressive and popular paradigm underlying many KG models . The embedding-based approaches for knowledge graphs can generally be categorized into bilinear models ( Nickel et al. , 2011 ; Yang et al. , 2014 ; Ma et al. , 2018a ) , translational models ( Bordes et al. , 2013 ; Lv et al. , 2018 ; Sun et al. , 2019 ; Hao et al. , 2019 ) , and deep-learning models ( Dettmers et al. , 2017 ; Schlichtkrull et al. , 2018 ) . However , the above methods are not able to use rich dynamics available on temporal knowledge graphs . To this end , several studies have been conducted for temporal knowledge graph reasoning ( Garcı́a-Durán et al. , 2018 ; Ma et al. , 2018b ; Jin et al. , 2019 ; Goel et al. , 2019 ; Lacroix et al. , 2020 ; Han et al. , 2020a ; b ; Zhu et al. , 2020 ) . The published approaches are largely black-box , lacking the ability to interpret their predictions . Recently , several explainable reasoning methods for knowledge graphs have been proposed ( Das et al. , 2017 ; Xu et al. , 2019 ; Hildebrandt et al. , 2020 ; Teru et al. , 2019 ) . However , the above explainable methods can only deal with static KGs , while our model is designed for interpretable forecasting on temporal KGs . 3 PRELIMINARIES . Let E and P represent a finite set of entities and predicates , respectively . A temporal knowledge graph is a collection of timestamped facts written as quadruples . A quadruple q = ( es , p , eo , t ) represents a timestamped and labeled edge between a subject entity es ∈ E and an object entity eo ∈ E , where p ∈ P denotes the edge type ( predicate ) . The temporal knowledge graph forecasting task aims to predict unknown links at future timestamps based on observed past events . Definition 1 ( Temporal KG forecasting ) . Let F represent the set of all ground-truth quadruples , and let ( eq , pq , eo , tq ) ∈ F denote the target quadruple . Given a query ( eq , pq , ? , tq ) derived from the target quadruple and a set of observed prior facts O = { ( ei , pk , ej , tl ) ∈ F|tl < tq } , the temporal KG forecasting task is to predict the missing object entity eo . Specifically , we consider all entities in the set E as candidates and rank them by their likelihood to form a true quadruple together with the given subject-predicate-pair at timestamp tq1 . For a given query q = ( eq , pq , ? , tq ) , we build an inference graph Ginf to visualize the reasoning process . Unlike in temporal KGs , where a node represents an entity , each node in Ginf is an entitytimestamp pair . The inference graph is a directed graph in which a link points from a node with an earlier timestamp to a node with a later timestamp . Definition 2 ( Node in Inference Graph and its Temporal Neighborhood ) . Let E represent all entities , F denote all ground-truth quadruples , and let t represent a timestamp . A node in an inference graph Ginf is defined as an entity-timestamp pair v = ( ei , t ) , ei ∈ E . We define the set of one-hop prior neighbors of v as Nv= ( ei , t ) = { ( ej , t′ ) | ( ei , pk , ej , t′ ) ∈ F ∧ ( t′ < t ) } 2 . For simplicity , we denote one-hop prior neighbors as Nv . Similarly , we define the set of one-hop posterior neighbors of v as N v= ( ei , t ) = { ( ej , t′ ) | ( ej , pk , ei , t ) ∈ F ∧ ( t′ > t ) } . We denote them as N v for short . We provide an example in Figure 4 in the appendix to illustrate the inference graph . 4 OUR MODEL . We describe xERTE in a top-down fashion where we provide an overview in Section 4.1 and then explain each module from Section 4.2 to 4.6 . 4.1 SUBGRAPH REASONING PROCESS . Our model conducts the reasoning process on a dynamically expanded inference graph Ginf extracted from the temporal KG . We show a toy example in Figure 1 . Given query q = ( eq , pq , ? , tq ) , we initialize Ginf with node vq = ( eq , tq ) consisting of the query subject and the query time . The inference graph expands by sampling prior neighbors of vq . For example , suppose that ( eq , pk , ej , t′ ) is a valid quadruple where t′ < tq , we add the node v1 = ( ej , t′ ) into Ginf and link it with vq where the link is labeled with pk and points from vq to v1 . We use an embedding module to assign each node and predicate included in Ginf a temporal embedding that is shared across queries . The main goal of the embedding module is to let the nodes access query-independent information and get a broad view of the graph structure since the following temporal relational graph attention ( TRGA ) layer only performs query-dependent message passing locally . Next , we feed the inference graph into the TRGA layer that takes node embeddings and predicate embeddings as the input , produces a query-dependent representation for each node by passing messages on the small inference graph , and computes a query-dependent attention score for each edge . As explained in Section 4.7 , we propagate the attention of each node to its prior neighbors using the edge attention scores . Then we further expand Ginf by sampling the prior neighbors of the nodes in Ginf . The expansion will grow 1Throughout this work , we add reciprocal relations for every quadruple , i.e. , we add ( eo , p−1 , es , t ) for every ( es , p , eo , t ) . Hence , the restriction to predict object entities does not lead to a loss of generality . 2Prior neighbors linked with ei as subject entity , e.g. , ( ej , pk , ei , t ) , are covered using reciprocal relations . rapidly and cover almost all nodes after a few steps . To prevent the inference graph from exploding , we reduce the edge amount by pruning the edges that gain less attention . As the expansion and pruning iterate , Ginf allocates more and more information from the temporal KG . After running L inference steps , the model selects the entity with the highest attention score in Ginf as the prediction of the missing query object , where the inference graph itself serves as a graphical explanation .
This paper proposes xERTE, a comprehensive set of strategies (i.e. a temporal relational attention mechanism and a human-mimic representation update scheme, temporal neighborhood sampling and pruning, etc.) for link forecasting in temporal knowledge graphs (tKGs). Experiments on real-world tKGs show significant improvements and better explainability on KG forecasting.
SP:7a333ae10f9732f3e0bed9bf009914e5d1bc265f
Explainable Subgraph Reasoning for Forecasting on Temporal Knowledge Graphs
1 INTRODUCTION . Reasoning , a process of inferring new knowledge from available facts , has long been considered an essential topic in AI research . Recently , reasoning on knowledge graphs ( KG ) has gained increasing interest ( Das et al. , 2017 ; Ren et al. , 2020 ; Hildebrandt et al. , 2020 ) . A knowledge graph is a graphstructured knowledge base that stores factual information in the form of triples ( s , p , o ) , e.g. , ( Alice , livesIn , Toronto ) . In particular , s ( subject ) and o ( object ) are expressed as nodes and p ( predicate ) as an edge type . Most knowledge graph models assume that the underlying graph is static . However , in the real world , facts and knowledge can change with time . For example , ( Alice , livesIn , Toronto ) becomes invalid after Alice moves to Vancouver . To accommodate time-evolving multi-relational data , temporal KGs have been introduced ( Boschee et al. , 2015 ) , where a temporal fact is represented as a quadruple by extending the static triple with a timestamp t indicating the triple is valid at t , i.e . ( Barack Obama , visit , India , 2010-11-06 ) . In this work , we focus on forecasting on temporal KGs , where we infer future events based on past events . Forecasting on temporal KGs can improve a plethora of downstream applications such as decision support in personalized health care and finance . The use cases often require the predictions made by the learning models to be interpretable , such that users can understand and trust the predictions . However , current machine learning approaches ( Trivedi et al. , 2017 ; Jin et al. , 2019 ) for temporal KG forecasting operate in a black-box fashion , where they design an embedding-based score function to estimate the plausibility of a quadruple . These models can not clearly show which evidence contributes to a prediction and lack explainability to the forecast , making them less suitable for many real-world applications . ∗Equal contribution . †Corresponding authors . Explainable approaches can generally be categorized into post-hoc interpretable methods and integrated transparent methods ( Došilović et al. , 2018 ) . Post-hoc interpretable approaches ( Montavon et al. , 2017 ; Ying et al. , 2019 ) aim to interpret the results of a black-box model , while integrated transparent approaches ( Das et al. , 2017 ; Qiu et al. , 2019 ; Wang et al. , 2019 ) have an explainable internal mechanism . In particular , most integrated transparent ( Lin et al. , 2018 ; Hildebrandt et al. , 2020 ) approaches for KGs employ path-based methods to derive an explicit reasoning path and demonstrate a transparent reasoning process . The path-based methods focus on finding the answer to a query within a single reasoning chain . However , many complicated queries require multiple supporting reasoning chains rather than just one reasoning path . Recent work ( Xu et al. , 2019 ; Teru et al. , 2019 ) has shown that reasoning over local subgraphs substantially boosts performance while maintaining interpretability . However , these explainable models can not be applied to temporal graph-structured data because they do not take time information into account . This work aims to design a transparent forecasting mechanism on temporal KGs that can generate informative explanations of the predictions . In this paper , we propose an explainable reasoning framework for forecasting future links on temporal knowledge graphs , xERTE , which employs a sequential reasoning process over local subgraphs . To answer a query in the form of ( subject eq , predicate pq , ? , timestamp tq ) , xERTE starts from the query subject , iteratively samples relevant edges of entities included in the subgraph and propagates attention along the sampled edges . After several rounds of expansion and pruning , the missing object is predicted from entities in the subgraph . Thus , the extracted subgraph can be seen as a concise and compact graphical explanation of the prediction . To guide the subgraph to expand in the direction of the query ’ s interest , we propose a temporal relational graph attention ( TRGA ) mechanism . We pose temporal constraints on passing messages to preserve the causal nature of the temporal data . Specifically , we update the time-dependent hidden representation of an entity ei at a timestamp t by attentively aggregating messages from its temporal neighbors that were linked with ei prior to t. We call such temporal neighbors as prior neighbors of ei . Additionally , we use an embedding module consisting of stationary entity embeddings and functional time encoding , enabling the model to capture both global structural information and temporal dynamics . Besides , we develop a novel representation update mechanism to mimic human reasoning behavior . When humans perform a reasoning process , their perceived profiles of observed entities will update , as new clues are found . Thus , it is necessary to ensure that all entities in a subgraph can receive messages from prior neighbors newly added to the subgraph . To this end , the proposed representation update mechanism enables every entity to receive messages from its farthest prior neighbors in the subgraph . The major contributions of this work are as follows . ( 1 ) We develop xERTE , the first explainable model for predicting future links on temporal KGs . The model is based on a temporal relational attention mechanisms that preserves the causal nature of the temporal multi-relational data . ( 2 ) Unlike most black-box embedding-based models , xERTE visualizes the reasoning process and provides an interpretable inference graph to emphasize important evidence . ( 3 ) The dynamical pruning procedure enables our model to perform reasoning on large-scale temporal knowledge graphs with millions of edges . ( 4 ) We apply our model for forecasting future links on four benchmark temporal knowledge graphs . The results show that our method achieves on average a better performance than current state-of-the-art methods , thus providing a new baseline . ( 5 ) We conduct a survey with 53 respondents to evaluate whether the extracted evidence is aligned with human understanding . 2 RELATED WORK . Representation learning is an expressive and popular paradigm underlying many KG models . The embedding-based approaches for knowledge graphs can generally be categorized into bilinear models ( Nickel et al. , 2011 ; Yang et al. , 2014 ; Ma et al. , 2018a ) , translational models ( Bordes et al. , 2013 ; Lv et al. , 2018 ; Sun et al. , 2019 ; Hao et al. , 2019 ) , and deep-learning models ( Dettmers et al. , 2017 ; Schlichtkrull et al. , 2018 ) . However , the above methods are not able to use rich dynamics available on temporal knowledge graphs . To this end , several studies have been conducted for temporal knowledge graph reasoning ( Garcı́a-Durán et al. , 2018 ; Ma et al. , 2018b ; Jin et al. , 2019 ; Goel et al. , 2019 ; Lacroix et al. , 2020 ; Han et al. , 2020a ; b ; Zhu et al. , 2020 ) . The published approaches are largely black-box , lacking the ability to interpret their predictions . Recently , several explainable reasoning methods for knowledge graphs have been proposed ( Das et al. , 2017 ; Xu et al. , 2019 ; Hildebrandt et al. , 2020 ; Teru et al. , 2019 ) . However , the above explainable methods can only deal with static KGs , while our model is designed for interpretable forecasting on temporal KGs . 3 PRELIMINARIES . Let E and P represent a finite set of entities and predicates , respectively . A temporal knowledge graph is a collection of timestamped facts written as quadruples . A quadruple q = ( es , p , eo , t ) represents a timestamped and labeled edge between a subject entity es ∈ E and an object entity eo ∈ E , where p ∈ P denotes the edge type ( predicate ) . The temporal knowledge graph forecasting task aims to predict unknown links at future timestamps based on observed past events . Definition 1 ( Temporal KG forecasting ) . Let F represent the set of all ground-truth quadruples , and let ( eq , pq , eo , tq ) ∈ F denote the target quadruple . Given a query ( eq , pq , ? , tq ) derived from the target quadruple and a set of observed prior facts O = { ( ei , pk , ej , tl ) ∈ F|tl < tq } , the temporal KG forecasting task is to predict the missing object entity eo . Specifically , we consider all entities in the set E as candidates and rank them by their likelihood to form a true quadruple together with the given subject-predicate-pair at timestamp tq1 . For a given query q = ( eq , pq , ? , tq ) , we build an inference graph Ginf to visualize the reasoning process . Unlike in temporal KGs , where a node represents an entity , each node in Ginf is an entitytimestamp pair . The inference graph is a directed graph in which a link points from a node with an earlier timestamp to a node with a later timestamp . Definition 2 ( Node in Inference Graph and its Temporal Neighborhood ) . Let E represent all entities , F denote all ground-truth quadruples , and let t represent a timestamp . A node in an inference graph Ginf is defined as an entity-timestamp pair v = ( ei , t ) , ei ∈ E . We define the set of one-hop prior neighbors of v as Nv= ( ei , t ) = { ( ej , t′ ) | ( ei , pk , ej , t′ ) ∈ F ∧ ( t′ < t ) } 2 . For simplicity , we denote one-hop prior neighbors as Nv . Similarly , we define the set of one-hop posterior neighbors of v as N v= ( ei , t ) = { ( ej , t′ ) | ( ej , pk , ei , t ) ∈ F ∧ ( t′ > t ) } . We denote them as N v for short . We provide an example in Figure 4 in the appendix to illustrate the inference graph . 4 OUR MODEL . We describe xERTE in a top-down fashion where we provide an overview in Section 4.1 and then explain each module from Section 4.2 to 4.6 . 4.1 SUBGRAPH REASONING PROCESS . Our model conducts the reasoning process on a dynamically expanded inference graph Ginf extracted from the temporal KG . We show a toy example in Figure 1 . Given query q = ( eq , pq , ? , tq ) , we initialize Ginf with node vq = ( eq , tq ) consisting of the query subject and the query time . The inference graph expands by sampling prior neighbors of vq . For example , suppose that ( eq , pk , ej , t′ ) is a valid quadruple where t′ < tq , we add the node v1 = ( ej , t′ ) into Ginf and link it with vq where the link is labeled with pk and points from vq to v1 . We use an embedding module to assign each node and predicate included in Ginf a temporal embedding that is shared across queries . The main goal of the embedding module is to let the nodes access query-independent information and get a broad view of the graph structure since the following temporal relational graph attention ( TRGA ) layer only performs query-dependent message passing locally . Next , we feed the inference graph into the TRGA layer that takes node embeddings and predicate embeddings as the input , produces a query-dependent representation for each node by passing messages on the small inference graph , and computes a query-dependent attention score for each edge . As explained in Section 4.7 , we propagate the attention of each node to its prior neighbors using the edge attention scores . Then we further expand Ginf by sampling the prior neighbors of the nodes in Ginf . The expansion will grow 1Throughout this work , we add reciprocal relations for every quadruple , i.e. , we add ( eo , p−1 , es , t ) for every ( es , p , eo , t ) . Hence , the restriction to predict object entities does not lead to a loss of generality . 2Prior neighbors linked with ei as subject entity , e.g. , ( ej , pk , ei , t ) , are covered using reciprocal relations . rapidly and cover almost all nodes after a few steps . To prevent the inference graph from exploding , we reduce the edge amount by pruning the edges that gain less attention . As the expansion and pruning iterate , Ginf allocates more and more information from the temporal KG . After running L inference steps , the model selects the entity with the highest attention score in Ginf as the prediction of the missing query object , where the inference graph itself serves as a graphical explanation .
Authors have presented a method to forecast future links on temporal knowledge graphs (KGs). They use attention mechanisms to extract a query-dependent subgraph. According to the authors, this extracted subgraph provides a graphical explanation of the prediction. Authors have performed an ablation study to denote the effect of different components (e.g., updating the representation of nodes, time encoding, sampling strategy) in their method. They have tested the performance of their approach on 3 datasets and have shown that their approach outperforms other baselines in terms of Hits and MRR.
SP:7a333ae10f9732f3e0bed9bf009914e5d1bc265f
Federated Learning with Decoupled Probabilistic-Weighted Gradient Aggregation
1 INTRODUCTION . Federated learning ( FL ) has emerged as a novel distributed machine learning paradigm that allows a global machine learning model to be trained by multiple mobile clients collaboratively . In such paradigm , mobile clients train local models based on datasets generated by edge devices such as sensors and smartphones , and the server is responsible to aggregate parameters/gradients from local models to form a global model without transferring data to a central server . Federated learning has been drawn much attention in mobile-edge computing ( Konecný et al . ( 2016 ) ; Sun et al . ( 2017 ) ) with its advantages in preserving data privacy ( Zhu & Jin ( 2020 ) ; Jiang et al . ( 2019 ) ; Keller et al . ( 2018 ) ) and enhancing communication efficiency ( Shamir et al . ( 2014 ) ; Smith et al . ( 2018 ) ; Zhang et al . ( 2013 ) ; McMahan et al . ( 2017 ) ; Wang et al . ( 2020 ) ) . Gradient aggregation is the key technology of federated learning , which typically involves the following three steps repeated periodically during training process : ( 1 ) the involved clients train the same type of models with their local data independently ; ( 2 ) when the server sends aggregation signal to the clients , the clients transmit their parameters or gradients to the server ; ( 3 ) when server receives all parameters or gradients , it applies an aggregation methods to the received parameters or gradients to form the global model . The standard aggregation method FedAvg ( McMahan et al . ( 2017 ) ) and its variants such as FedProx ( Li et al . ( 2020a ) ) , Zeno ( Xie et al . ( 2019 ) ) and q-FedSGD ( Li et al . ( 2020b ) ) applied the synchronous parameter averaging method to the entire model indiscriminately . Agnostic federated learning ( AFL ) ( Mohri et al . ( 2019 ) ) defined an agnostic and risk-averse objective to optimize a mixture of the client distributions . FedMA ( Wang et al . ( 2020 ) ) constructed the shared global model in a layer-wise manner by matching and averaging hidden elements with similar feature extraction signatures . The recurrent neural network ( RNN ) based aggregator ( Ji et al . ( 2019 ) ) learned an aggregation method to make it resilient to Byzantine attack . Despite the efforts that have been made , applying the existing parameter aggregation methods for large number of heterogeneous clients in federated learning still suffers from performance issues . It was reported in ( Zhao et al . ( 2018 ) ) that the accuracy of a convolutional neural network ( CNN ) model trained by FedAvg reduces by up to 55 % for highly skewed non-IID dataset . The work of ( Wang et al . ( 2020 ) ) showed that the accuracy of FadAvg ( McMahan et al . ( 2017 ) ) and FedProx ( Li et al . ( 2020a ) ) dropped from 61 % to under 50 % when the client number increases from 5 to 20 under heterogeneous data partition . A possible reason to explain the performance drops in federated learning could be the different levels of bias caused by inappropriate gradient aggregation , on which we make the following observations . Data Bias : In the federated learning setting , local datasets are only accessible by the owner and they are typically non-IID . Conventional approaches aggregate gradients uniformly from the clients , which could cause great bias to the real data distribution . Fig . 1 shows the distribution of the real dataset and the distributions of uniformly taking samples from different number of clients in the CIFAR-10 dataset ( Krizhevsky ( 2009 ) ) . It is observed that there are great differences between the real data and the sampled distributions . The more clients involved , the more difference occurs . Parameter Bias : A CNN model typically contains two different types of parameters : the gradient parameters from the convolutional ( Conv ) layers and full connected ( FC ) layers ; and the statistical parameters such as mean and variance from the batch normalization ( BN ) layers . Existing approaches such as FedAvg average the entire model parameters indiscriminately using distributed stochastic gradient descent ( SGD ) , which will lead to bias on the means and variances in BN layer . Fig . 2 shows the means and variances in BN layer distribution of a centrally-trained CNN model and that of FedAvg-trained models with different number of clients on non-IID local datasets . It is observed that the more clients involved , the larger deviation between the central model and the federated learning models . Our contributions : In the context of federated learning , the problems of data bias and parameter bias have not been carefully addressed in the literature . In this paper , we propose a novel gradient aggregation approach called FeDEC . The main contribution of our work are summarized as follows . ( 1 ) We propose the key idea of optimizing gradient aggregation with a decoupled probabilisticweighted method . To the best of our knowledge , we make the first attempt to aggregate gradient parameters and statistical parameters separatively , and adopt a probabilistic mixture model to resolve the problem of aggregation bias for federated learning with heterogeneous clients . ( 2 ) We propose a variational inference method to derive the optimal probabilistic weights for gradient aggregation , and prove the convergence bound of the proposed approach . ( 3 ) We conduct extensive experiments using five mainstream CNN models based on three federated datasets under non-IID conditions . It is shown that FeDEC significantly outperforms the state-of-the-arts in terms of model accuracy and training efficiency . 2 RELATED WORK . We summarize the related work as two categories : parameter/gradient aggregation for distributed learning and federated learning . Distributed Learning : In distributed learning , the most famous parameter aggregation paradigm is the Parameter Server Framework ( Li et al . ( 2014 ) ) . In this framework , multiple servers maintain a partition of the globally shared parameters and communicate with each other to replicate and migrate parameters , while the clients compute gradients locally with a portion of the training data , and communicate with the server for model update . Parameter server paradigm had motivated the development of numerous distributed optimization methods ( Boyd et al . ( 2011 ) ; Dean et al . ( 2012 ) ; Dekel et al . ( 2012 ) ; Richtárik & Takác ( 2016 ) ; Zhang et al . ( 2015 ) ) . Several works focused on improving the communication-efficiency for distributed learning ( Shamir et al . ( 2014 ) ; Smith et al . ( 2018 ) ; Zhang et al . ( 2013 ) ) . To address the issue of model robustness , Zeno ( Xie et al . ( 2019 ) ) was proposed to make distributed machine learning tolerant to an arbitrary number of faulty workers . The RNN based aggregator ( Ji et al . ( 2019 ) ) adopted a meta-learning approach that utilizes a recurrent neural network ( RNN ) in the parameter server to learn to aggregate the gradients from the workers , and designed a coordinatewise preprocessing and postprocessing method to improve its robustness . Federated Learning : Federated learning ( Konečnỳ et al . ( 2015 ) ) is an emerging edge distributed machine learning paradigm that aims to build machine-learning models based on datasets distributing across multiple clients . One of the standard parameter aggregation methods is FedAvg ( McMahan et al . ( 2017 ) ) , which combines local stochastic gradient descent ( SGD ) on each client with a server that performs parameter averaging . The lazily aggregated gradient ( Lag ) method ( Chen et al . ( 2018 ) ) allowed clients running multiple epochs before model aggregation to reduce communication cost . For heterogeneous datasets , FedProx ( Li et al . ( 2020a ) ) modified FedAvg by adding a heterogeneity bound on datasets and devices to tackle heterogeneity . The FedMA ( Wang et al . ( 2020 ) ) method , derived from AFL Mohri et al . ( 2019 ) and PFNM ( Yurochkin et al . ( 2019 ) ) , demonstrated that permutations of layers can affect the gradient aggregation results , and proposed a layer-wise gradient aggregation method to solve the problem . For fair resources allocation , the q-FedSGD ( Li et al . ( 2020b ) ) method encouraged a more uniform accuracy distribution across devices in federated networks . However , all the methods did not differentiate gradient parameters and statistical parameters and aggregated the entire model in a coupled manner . In this paper , we make the first attempt to decouple the aggregation of gradient parameters and statistical parameters with probabilistic weights to optimize the global model to achieve fast convergence and high accuracy in non-IID conditions . 3 FEDEC : A DECOUPLED GRADIENT AGGREGATION METHOD . 3.1 OBJECTIVE OF FEDERATED LEARNING WITH NON-IID DATA . Consider a federated learning scenario with K clients that train their local CNN models independently based on local datasets x1 , x2 , . . . , xK and report their gradients and model parameters to a central server . The objective of the server is to form an aggregate global CNN model to minimize the loss function over the total datasets x = { x1 , x2 , . . . , xK } . Conventional federated learning tends to optimize the following loss function : min W L ( W , x ) : = K∑ k=1 |xk| |x| Lk ( Wk , xk ) , ( 1 ) where W is the parameters of the global model , Wk ( k = 1 , 2 , · · · , K ) is the parameters of the k-th local model ; L ( · ) and Lk ( · ) indicate the loss functions for global model and local models accordingly . The above objective assumes training samples uniformly distributed among the clients , so that the aggregated loss can be represented by the sum of percentage-weighted of the local losses . As discussed in section 1 , conventional federated learning has two drawbacks . Firstly , local datasets are collected by mobile devices used by particular users , which are typically non-IID . Training samples on each client may be drawn from a different distribution , therefore the data points available locally could be bias from the overall distribution . Secondly , since a neural network model is typically consists of convolutional ( Conv ) layers and full-connected ( FC ) layers that are formed by gradient parameters , and batch normalization ( BN ) layers that are formed by statistical parameters such as mean and variance , aggregating them without distinction will cause severe deviation of the global model parameters . To address the above issues , we propose a decoupled probabilistic-weighted approach for federated learning that focuses on optimizing the following loss function : min W∗ L ( { WtNN , Wtmean , Wtvar } , x ) : = K∑ k=1 πkLk ( { Wt−1 , kNN , W t−1 , k mean , W t−1 , k var } , xk ) , ( 2 ) where ∗ indicates NN , mean and var ; WtNN , Wtmean and Wtvar are the parameters of Conv and FC layers of the global model after t-th aggregation epoch ; Wt−1 , kNN , W t−1 , k mean and W t−1 , k var are the k-th local model been trained several local epoch based t− 1-th global model ; πk ( k = 1 , . . . , K ) is the probability that a sample is drawn from the distribution of the k-th client , i.e. , πk ∈ [ 0 , 1 ] ( k = 1 , . . . , K ) and ∑K k=1 πk = 1 . The above formulation objects to minimize the expected loss over K clients with non-IID datasets . Next , we will introduce a decoupled method called FeDEC to optimize the parameters of different types of layers separatively , and derived the probability weights πk for parameter aggregation .
The paper proposed FedDEC, a novel approach to conduct model updates aggregation in federated learning. The main motivation of this paper is to decouple the aggregation of normal model weights and statistics in BNs separately such that both data and model heterogeneity can be handled. Theoretical analysis indicates that the proposed FedDEC method enjoys a good convergence guarantee. Extensive experimental results are provided to show that FedDEC enjoys high efficiency and better model accuracy under the non-IID environment compared to the considered baseline methods.
SP:759c0a0298f9845f41d6b556a2187867230a0ca5
Federated Learning with Decoupled Probabilistic-Weighted Gradient Aggregation
1 INTRODUCTION . Federated learning ( FL ) has emerged as a novel distributed machine learning paradigm that allows a global machine learning model to be trained by multiple mobile clients collaboratively . In such paradigm , mobile clients train local models based on datasets generated by edge devices such as sensors and smartphones , and the server is responsible to aggregate parameters/gradients from local models to form a global model without transferring data to a central server . Federated learning has been drawn much attention in mobile-edge computing ( Konecný et al . ( 2016 ) ; Sun et al . ( 2017 ) ) with its advantages in preserving data privacy ( Zhu & Jin ( 2020 ) ; Jiang et al . ( 2019 ) ; Keller et al . ( 2018 ) ) and enhancing communication efficiency ( Shamir et al . ( 2014 ) ; Smith et al . ( 2018 ) ; Zhang et al . ( 2013 ) ; McMahan et al . ( 2017 ) ; Wang et al . ( 2020 ) ) . Gradient aggregation is the key technology of federated learning , which typically involves the following three steps repeated periodically during training process : ( 1 ) the involved clients train the same type of models with their local data independently ; ( 2 ) when the server sends aggregation signal to the clients , the clients transmit their parameters or gradients to the server ; ( 3 ) when server receives all parameters or gradients , it applies an aggregation methods to the received parameters or gradients to form the global model . The standard aggregation method FedAvg ( McMahan et al . ( 2017 ) ) and its variants such as FedProx ( Li et al . ( 2020a ) ) , Zeno ( Xie et al . ( 2019 ) ) and q-FedSGD ( Li et al . ( 2020b ) ) applied the synchronous parameter averaging method to the entire model indiscriminately . Agnostic federated learning ( AFL ) ( Mohri et al . ( 2019 ) ) defined an agnostic and risk-averse objective to optimize a mixture of the client distributions . FedMA ( Wang et al . ( 2020 ) ) constructed the shared global model in a layer-wise manner by matching and averaging hidden elements with similar feature extraction signatures . The recurrent neural network ( RNN ) based aggregator ( Ji et al . ( 2019 ) ) learned an aggregation method to make it resilient to Byzantine attack . Despite the efforts that have been made , applying the existing parameter aggregation methods for large number of heterogeneous clients in federated learning still suffers from performance issues . It was reported in ( Zhao et al . ( 2018 ) ) that the accuracy of a convolutional neural network ( CNN ) model trained by FedAvg reduces by up to 55 % for highly skewed non-IID dataset . The work of ( Wang et al . ( 2020 ) ) showed that the accuracy of FadAvg ( McMahan et al . ( 2017 ) ) and FedProx ( Li et al . ( 2020a ) ) dropped from 61 % to under 50 % when the client number increases from 5 to 20 under heterogeneous data partition . A possible reason to explain the performance drops in federated learning could be the different levels of bias caused by inappropriate gradient aggregation , on which we make the following observations . Data Bias : In the federated learning setting , local datasets are only accessible by the owner and they are typically non-IID . Conventional approaches aggregate gradients uniformly from the clients , which could cause great bias to the real data distribution . Fig . 1 shows the distribution of the real dataset and the distributions of uniformly taking samples from different number of clients in the CIFAR-10 dataset ( Krizhevsky ( 2009 ) ) . It is observed that there are great differences between the real data and the sampled distributions . The more clients involved , the more difference occurs . Parameter Bias : A CNN model typically contains two different types of parameters : the gradient parameters from the convolutional ( Conv ) layers and full connected ( FC ) layers ; and the statistical parameters such as mean and variance from the batch normalization ( BN ) layers . Existing approaches such as FedAvg average the entire model parameters indiscriminately using distributed stochastic gradient descent ( SGD ) , which will lead to bias on the means and variances in BN layer . Fig . 2 shows the means and variances in BN layer distribution of a centrally-trained CNN model and that of FedAvg-trained models with different number of clients on non-IID local datasets . It is observed that the more clients involved , the larger deviation between the central model and the federated learning models . Our contributions : In the context of federated learning , the problems of data bias and parameter bias have not been carefully addressed in the literature . In this paper , we propose a novel gradient aggregation approach called FeDEC . The main contribution of our work are summarized as follows . ( 1 ) We propose the key idea of optimizing gradient aggregation with a decoupled probabilisticweighted method . To the best of our knowledge , we make the first attempt to aggregate gradient parameters and statistical parameters separatively , and adopt a probabilistic mixture model to resolve the problem of aggregation bias for federated learning with heterogeneous clients . ( 2 ) We propose a variational inference method to derive the optimal probabilistic weights for gradient aggregation , and prove the convergence bound of the proposed approach . ( 3 ) We conduct extensive experiments using five mainstream CNN models based on three federated datasets under non-IID conditions . It is shown that FeDEC significantly outperforms the state-of-the-arts in terms of model accuracy and training efficiency . 2 RELATED WORK . We summarize the related work as two categories : parameter/gradient aggregation for distributed learning and federated learning . Distributed Learning : In distributed learning , the most famous parameter aggregation paradigm is the Parameter Server Framework ( Li et al . ( 2014 ) ) . In this framework , multiple servers maintain a partition of the globally shared parameters and communicate with each other to replicate and migrate parameters , while the clients compute gradients locally with a portion of the training data , and communicate with the server for model update . Parameter server paradigm had motivated the development of numerous distributed optimization methods ( Boyd et al . ( 2011 ) ; Dean et al . ( 2012 ) ; Dekel et al . ( 2012 ) ; Richtárik & Takác ( 2016 ) ; Zhang et al . ( 2015 ) ) . Several works focused on improving the communication-efficiency for distributed learning ( Shamir et al . ( 2014 ) ; Smith et al . ( 2018 ) ; Zhang et al . ( 2013 ) ) . To address the issue of model robustness , Zeno ( Xie et al . ( 2019 ) ) was proposed to make distributed machine learning tolerant to an arbitrary number of faulty workers . The RNN based aggregator ( Ji et al . ( 2019 ) ) adopted a meta-learning approach that utilizes a recurrent neural network ( RNN ) in the parameter server to learn to aggregate the gradients from the workers , and designed a coordinatewise preprocessing and postprocessing method to improve its robustness . Federated Learning : Federated learning ( Konečnỳ et al . ( 2015 ) ) is an emerging edge distributed machine learning paradigm that aims to build machine-learning models based on datasets distributing across multiple clients . One of the standard parameter aggregation methods is FedAvg ( McMahan et al . ( 2017 ) ) , which combines local stochastic gradient descent ( SGD ) on each client with a server that performs parameter averaging . The lazily aggregated gradient ( Lag ) method ( Chen et al . ( 2018 ) ) allowed clients running multiple epochs before model aggregation to reduce communication cost . For heterogeneous datasets , FedProx ( Li et al . ( 2020a ) ) modified FedAvg by adding a heterogeneity bound on datasets and devices to tackle heterogeneity . The FedMA ( Wang et al . ( 2020 ) ) method , derived from AFL Mohri et al . ( 2019 ) and PFNM ( Yurochkin et al . ( 2019 ) ) , demonstrated that permutations of layers can affect the gradient aggregation results , and proposed a layer-wise gradient aggregation method to solve the problem . For fair resources allocation , the q-FedSGD ( Li et al . ( 2020b ) ) method encouraged a more uniform accuracy distribution across devices in federated networks . However , all the methods did not differentiate gradient parameters and statistical parameters and aggregated the entire model in a coupled manner . In this paper , we make the first attempt to decouple the aggregation of gradient parameters and statistical parameters with probabilistic weights to optimize the global model to achieve fast convergence and high accuracy in non-IID conditions . 3 FEDEC : A DECOUPLED GRADIENT AGGREGATION METHOD . 3.1 OBJECTIVE OF FEDERATED LEARNING WITH NON-IID DATA . Consider a federated learning scenario with K clients that train their local CNN models independently based on local datasets x1 , x2 , . . . , xK and report their gradients and model parameters to a central server . The objective of the server is to form an aggregate global CNN model to minimize the loss function over the total datasets x = { x1 , x2 , . . . , xK } . Conventional federated learning tends to optimize the following loss function : min W L ( W , x ) : = K∑ k=1 |xk| |x| Lk ( Wk , xk ) , ( 1 ) where W is the parameters of the global model , Wk ( k = 1 , 2 , · · · , K ) is the parameters of the k-th local model ; L ( · ) and Lk ( · ) indicate the loss functions for global model and local models accordingly . The above objective assumes training samples uniformly distributed among the clients , so that the aggregated loss can be represented by the sum of percentage-weighted of the local losses . As discussed in section 1 , conventional federated learning has two drawbacks . Firstly , local datasets are collected by mobile devices used by particular users , which are typically non-IID . Training samples on each client may be drawn from a different distribution , therefore the data points available locally could be bias from the overall distribution . Secondly , since a neural network model is typically consists of convolutional ( Conv ) layers and full-connected ( FC ) layers that are formed by gradient parameters , and batch normalization ( BN ) layers that are formed by statistical parameters such as mean and variance , aggregating them without distinction will cause severe deviation of the global model parameters . To address the above issues , we propose a decoupled probabilistic-weighted approach for federated learning that focuses on optimizing the following loss function : min W∗ L ( { WtNN , Wtmean , Wtvar } , x ) : = K∑ k=1 πkLk ( { Wt−1 , kNN , W t−1 , k mean , W t−1 , k var } , xk ) , ( 2 ) where ∗ indicates NN , mean and var ; WtNN , Wtmean and Wtvar are the parameters of Conv and FC layers of the global model after t-th aggregation epoch ; Wt−1 , kNN , W t−1 , k mean and W t−1 , k var are the k-th local model been trained several local epoch based t− 1-th global model ; πk ( k = 1 , . . . , K ) is the probability that a sample is drawn from the distribution of the k-th client , i.e. , πk ∈ [ 0 , 1 ] ( k = 1 , . . . , K ) and ∑K k=1 πk = 1 . The above formulation objects to minimize the expected loss over K clients with non-IID datasets . Next , we will introduce a decoupled method called FeDEC to optimize the parameters of different types of layers separatively , and derived the probability weights πk for parameter aggregation .
This paper introduces an aggregation mechanism designed for neural networks with batch normalisation layers. This mechanism relies on two parts: probabilistic mixing weights of the loss function and the use of a weighted pool estimator for aggregating the BN variance parameters. The mixing weights are derived from a GMM with variational inference. A convergence result in the *convex* case is provided. Experimental results on 3 image datasets show that this approach yields better results than other standard FL algorithms (FedAvg, FedProx, q-FedSGD, FedMA…) as well as a better resilience to heterogeneity (understood as class imbalance).
SP:759c0a0298f9845f41d6b556a2187867230a0ca5
How Neural Networks Extrapolate: From Feedforward to Graph Neural Networks
1 INTRODUCTION . Humans extrapolate well in many tasks . For example , we can apply arithmetics to arbitrarily large numbers . One may wonder whether a neural network can do the same and generalize to examples arbitrarily far from the training data ( Lake et al. , 2017 ) . Curiously , previous works report mixed extrapolation results with neural networks . Early works demonstrate feedforward neural networks , a.k.a . multilayer perceptrons ( MLPs ) , fail to extrapolate well when learning simple polynomial functions ( Barnard & Wessels , 1992 ; Haley & Soloway , 1992 ) . However , recent works show Graph Neural Networks ( GNNs ) ( Scarselli et al. , 2009 ) , a class of structured networks with MLP building blocks , can generalize to graphs much larger than training graphs in challenging algorithmic tasks , such as predicting the time evolution of physical systems ( Battaglia et al. , 2016 ) , learning graph algorithms ( Velickovic et al. , 2020 ) , and solving mathematical equations ( Lample & Charton , 2020 ) . To explain this puzzle , we formally study how neural networks trained by gradient descent ( GD ) extrapolate , i.e. , what they learn outside the support of training distribution . We say a neural network extrapolates well if it learns a task outside the training distribution . At first glance , it may seem that neural networks can behave arbitrarily outside the training distribution since they have high capacity ( Zhang et al. , 2017 ) and are universal approximators ( Cybenko , 1989 ; Funahashi , 1989 ; Hornik et al. , 1989 ; Kurkova , 1992 ) . However , neural networks are constrained by gradient descent training ( Hardt et al. , 2016 ; Soudry et al. , 2018 ) . In our analysis , we explicitly consider such implicit bias through the analogy of the training dynamics of over-parameterized neural networks and kernel regression via the neural tangent kernel ( NTK ) ( Jacot et al. , 2018 ) . Starting with feedforward networks , the simplest neural networks and building blocks of more complex architectures such as GNNs , we establish that the predictions of over-parameterized MLPs with ReLU activation trained by GD converge to linear functions along any direction from the origin . We prove a convergence rate for two-layer networks and empirically observe that convergence often occurs close to the training data ( Figure 1 ) , which suggests ReLU MLPs can not extrapolate well for most nonlinear tasks . We emphasize that our results do not follow from the fact that ReLU networks have finitely many linear regions ( Arora et al. , 2018 ; Hanin & Rolnick , 2019 ; Hein et al. , 2019 ) . While having finitely many linear regions implies ReLU MLPs eventually become linear , it does not say whether MLPs will learn the correct target function close to the training distribution . In contrast , our results are non-asymptotic and quantify what kind of functions MLPs will learn close to the training distribution . Second , we identify a condition when MLPs extrapolate well : the task is linear and the geometry of the training distribution is sufficiently “ diverse ” . To our knowledge , our results are the first extrapolation results of this kind for feedforward neural networks . We then relate our insights into feedforward neural networks to GNNs , to explain why GNNs extrapolate well in some algorithmic tasks . Prior works report successful extrapolation for tasks that can be solved by dynamic programming ( DP ) ( Bellman , 1966 ) , which has a computation structure aligned with GNNs ( Xu et al. , 2020 ) . DP updates can often be decomposed into nonlinear and linear steps . Hence , we hypothesize that GNNs trained by GD can extrapolate well in a DP task , if we encode appropriate non-linearities in the architecture and input representation ( Figure 2 ) . Importantly , encoding non-linearities may be unnecessary for GNNs to interpolate , because the MLP modules can easily learn many nonlinear functions inside the training distribution ( Cybenko , 1989 ; Hornik et al. , 1989 ; Xu et al. , 2020 ) , but it is crucial for GNNs to extrapolate correctly . We prove this hypothesis for a simplified case using Graph NTK ( Du et al. , 2019b ) . Empirically , we validate the hypothesis on three DP tasks : max degree , shortest paths , and n-body problem . We show GNNs with appropriate architecture , input representation , and training distribution can predict well on graphs with unseen sizes , structures , edge weights , and node features . Our theory explains the empirical success in previous works and suggests their limitations : successful extrapolation relies on encoding task-specific non-linearities , which requires domain knowledge or extensive model search . From a broader standpoint , our insights go beyond GNNs and apply broadly to other neural networks . To summarize , we study how neural networks extrapolate . First , ReLU MLPs trained by GD converge to linear functions along directions from the origin with a rate of O ( 1/t ) . Second , to explain why GNNs extrapolate well in some algorithmic tasks , we prove that ReLU MLPs can extrapolate well in linear tasks , leading to a hypothesis : a neural network can extrapolate well when appropriate nonlinearities are encoded into the architecture and features . We prove this hypothesis for a simplified case and provide empirical support for more general settings . 1.1 RELATED WORK . Early works show example tasks where MLPs do not extrapolate well , e.g . learning simple polynomials ( Barnard & Wessels , 1992 ; Haley & Soloway , 1992 ) . We instead show a general pattern of how ReLU MLPs extrapolate and identify conditions for MLPs to extrapolate well . More recent works study the implicit biases induced on MLPs by gradient descent , for both the NTK and mean field regimes ( Bietti & Mairal , 2019 ; Chizat & Bach , 2018 ; Song et al. , 2018 ) . Related to our results , some works show MLP predictions converge to “ simple ” piecewise linear functions , e.g. , with few linear regions ( Hanin & Rolnick , 2019 ; Maennel et al. , 2018 ; Savarese et al. , 2019 ; Williams et al. , 2019 ) . Our work differs in that none of these works explicitly studies extrapolation , and some focus only on one-dimensional inputs . Recent works also show that in high-dimensional settings of the NTK regime , MLP is asymptotically at most a linear predictor in certain scaling limits ( Ba et al. , 2020 ; Ghorbani et al. , 2019 ) . We study a different setting ( extrapolation ) , and our analysis is non-asymptotic in nature and does not rely on random matrix theory . Prior works explore GNN extrapolation by testing on larger graphs ( Battaglia et al. , 2018 ; Santoro et al. , 2018 ; Saxton et al. , 2019 ; Velickovic et al. , 2020 ) . We are the first to theoretically study GNN extrapolation , and we complete the notion of extrapolation to include unseen features and structures . 2 PRELIMINARIES . We begin by introducing our setting . Let X be the domain of interest , e.g. , vectors or graphs . The task is to learn an underlying function g : X → R with a training set { ( xi , yi ) } ni=1 ⊂ D , where yi = g ( xi ) and D is the support of training distribution . Previous works have extensively studied in-distribution generalization where the training and the test distributions are identical ( Valiant , 1984 ; Vapnik , 2013 ) ; i.e. , D = X . In contrast , extrapolation addresses predictions on a domain X that is larger than the support of the training distribution D. We will say a model extrapolates well if it has a small extrapolation error . Definition 1 . ( Extrapolation error ) . Let f : X → R be a model trained on { ( xi , yi ) } ni=1 ⊂ D with underlying function g : X → R. Let P be a distribution over X \ D and let ` : R× R→ R be a loss function . We define the extrapolation error of f as Ex∼P [ ` ( f ( x ) , g ( x ) ) ] . We focus on neural networks trained by gradient descent ( GD ) or its variants with squared loss . We study two network architectures : feedforward and graph neural networks . Graph Neural Networks . GNNs are structured networks operating on graphs with MLP modules ( Battaglia et al. , 2018 ; Xu et al. , 2019 ) . Let G = ( V , E ) be a graph . Each node u ∈ V has a feature vector xu , and each edge ( u , v ) ∈ E has a feature vector w ( u , v ) . GNNs recursively compute node representations h ( k ) u at iteration k ( Gilmer et al. , 2017 ; Xu et al. , 2018 ) . Initially , h ( 0 ) u = xu . For k = 1 .. K , GNNs update h ( k ) u by aggregating the neighbor representations . We can optionally compute a graph representation hG by aggregating the final node representations . That is , h ( k ) u = ∑ v∈N ( u ) MLP ( k ) ( h ( k−1 ) u , h ( k−1 ) v , w ( v , u ) ) , hG = MLP ( K+1 ) ( ∑ u∈G h ( K ) u ) . ( 1 ) The final output is the graph representation hG or final node representations h ( K ) u depending on the task . We refer to the neighbor aggregation step for h ( k ) u as aggregation and the pooling step in hG as readout . Previous works typically use sum-aggregation and sum-readout ( Battaglia et al. , 2018 ) . Our results indicate why replacing them may help extrapolation ( Section 4 ) . 3 HOW FEEDFORWARD NEURAL NETWORKS EXTRAPOLATE . Feedforward networks are the simplest neural networks and building blocks of more complex architectures such as GNNs , so we first study how they extrapolate when trained by GD . Throughout the paper , we assume ReLU activation . Section 3.3 contains preliminary results for other activations . 3.1 LINEAR EXTRAPOLATION BEHAVIOR OF RELU MLPS . By architecture , ReLU networks learn piecewise linear functions , but what do these regions precisely look like outside the support of the training data ? Figure 1 illustrates examples of how ReLU MLPs extrapolate when trained by GD on various nonlinear functions . These examples suggest that outside the training support , the predictions quickly become linear along directions from the origin . We systematically verify this pattern by linear regression on MLPs ’ predictions : the coefficient of determination ( R2 ) is always greater than 0.99 ( Appendix C.2 ) . That is , ReLU MLPs “ linearize ” almost immediately outside the training data range . We formalize this observation using the implicit biases of neural networks trained by GD via the neural tangent kernel ( NTK ) : optimization trajectories of over-parameterized networks trained by GD are equivalent to those of kernel regression with a specific neural tangent kernel , under a set of assumptions called the “ NTK regime ” ( Jacot et al. , 2018 ) . We provide an informal definition here ; for further details , we refer the readers to Jacot et al . ( 2018 ) and Appendix A . Definition 2 . ( Informal ) A neural network trained in the NTK regime is infinitely wide , randomly initialized with certain scaling , and trained by GD with infinitesimal steps . Prior works analyze optimization and in-distribution generalization of over-parameterized neural networks via NTK ( Allen-Zhu et al. , 2019a ; b ; Arora et al. , 2019a ; b ; Cao & Gu , 2019 ; Du et al. , 2019c ; a ; Li & Liang , 2018 ; Nitanda & Suzuki , 2021 ) . We instead analyze extrapolation . Theorem 1 formalizes our observation from Figure 1 : outside the training data range , along any direction tv from the origin , the prediction of a two-layer ReLU MLP quickly converges to a linear function with rate O ( 1t ) . The linear coefficients βv and the constant terms in the convergence rate depend on the training data and direction v. The proof is in Appendix B.1 . Theorem 1 . ( Linear extrapolation ) . Suppose we train a two-layer ReLU MLP f : Rd → R with squared loss in the NTK regime . For any direction v ∈ Rd , let x0 = tv . As t → ∞ , f ( x0 + hv ) − f ( x0 ) → βv · h for any h > 0 , where βv is a constant linear coefficient . Moreover , given > 0 , for t = O ( 1 ) , we have | f ( x0+hv ) −f ( x0 ) h − βv| < . ReLU networks have finitely many linear regions ( Arora et al. , 2018 ; Hanin & Rolnick , 2019 ) , hence their predictions eventually become linear . In contrast , Theorem 1 is a more fine-grained analysis of how MLPs extrapolate and provides a convergence rate . While Theorem 1 assumes two-layer networks in the NTK regime , experiments confirm that the linear extrapolation behavior happens across networks with different depths , widths , learning rates , and batch sizes ( Appendix C.1 and C.2 ) . Our proof technique potentially also extends to deeper networks . Theorem 1 implies which target functions a ReLU MLP may be able to match outside the training data : only functions that are almost-linear along the directions away from the origin . Indeed , Figure 4a shows ReLU MLPs do not extrapolate target functions such as x > Ax ( quadratic ) , ∑d i=1 cos ( 2π ·x ( i ) ) ( cos ) , and ∑d i=1 √ x ( i ) ( sqrt ) , where x ( i ) is the i-th dimension of x . With suitable hyperparameters , MLPs extrapolate the L1 norm correctly , which satisfies the directional linearity condition . Figure 4a provides one more positive result : MLPs extrapolate linear target functions well , across many different hyperparameters . While learning linear functions may seem very limited at first , in Section 4 this insight will help explain extrapolation properties of GNNs in non-linear practical tasks . Before that , we first theoretically analyze when MLPs extrapolate well .
This paper tackles the challenging question of how deep networks might learn to extrapolate knowledge outside the support of their training distribution. The paper contributes both with novel theoretical arguments as well as with empirical evidence collected on targeted cases. Differently from other recent approaches to the problem, the theoretical analyses presented here are non-asymptotic and provide precise information about the kind of functions that MLPs can learn in the proximity of the training region. Moreover, the authors provide compelling arguments about the need to explicitly encoding (task-specific) non-linearities in the input representation and/or in the model architecture in order to promote successful extrapolation.
SP:43728b5763907cbe84f1c7ded63e5f63c45415c5
How Neural Networks Extrapolate: From Feedforward to Graph Neural Networks
1 INTRODUCTION . Humans extrapolate well in many tasks . For example , we can apply arithmetics to arbitrarily large numbers . One may wonder whether a neural network can do the same and generalize to examples arbitrarily far from the training data ( Lake et al. , 2017 ) . Curiously , previous works report mixed extrapolation results with neural networks . Early works demonstrate feedforward neural networks , a.k.a . multilayer perceptrons ( MLPs ) , fail to extrapolate well when learning simple polynomial functions ( Barnard & Wessels , 1992 ; Haley & Soloway , 1992 ) . However , recent works show Graph Neural Networks ( GNNs ) ( Scarselli et al. , 2009 ) , a class of structured networks with MLP building blocks , can generalize to graphs much larger than training graphs in challenging algorithmic tasks , such as predicting the time evolution of physical systems ( Battaglia et al. , 2016 ) , learning graph algorithms ( Velickovic et al. , 2020 ) , and solving mathematical equations ( Lample & Charton , 2020 ) . To explain this puzzle , we formally study how neural networks trained by gradient descent ( GD ) extrapolate , i.e. , what they learn outside the support of training distribution . We say a neural network extrapolates well if it learns a task outside the training distribution . At first glance , it may seem that neural networks can behave arbitrarily outside the training distribution since they have high capacity ( Zhang et al. , 2017 ) and are universal approximators ( Cybenko , 1989 ; Funahashi , 1989 ; Hornik et al. , 1989 ; Kurkova , 1992 ) . However , neural networks are constrained by gradient descent training ( Hardt et al. , 2016 ; Soudry et al. , 2018 ) . In our analysis , we explicitly consider such implicit bias through the analogy of the training dynamics of over-parameterized neural networks and kernel regression via the neural tangent kernel ( NTK ) ( Jacot et al. , 2018 ) . Starting with feedforward networks , the simplest neural networks and building blocks of more complex architectures such as GNNs , we establish that the predictions of over-parameterized MLPs with ReLU activation trained by GD converge to linear functions along any direction from the origin . We prove a convergence rate for two-layer networks and empirically observe that convergence often occurs close to the training data ( Figure 1 ) , which suggests ReLU MLPs can not extrapolate well for most nonlinear tasks . We emphasize that our results do not follow from the fact that ReLU networks have finitely many linear regions ( Arora et al. , 2018 ; Hanin & Rolnick , 2019 ; Hein et al. , 2019 ) . While having finitely many linear regions implies ReLU MLPs eventually become linear , it does not say whether MLPs will learn the correct target function close to the training distribution . In contrast , our results are non-asymptotic and quantify what kind of functions MLPs will learn close to the training distribution . Second , we identify a condition when MLPs extrapolate well : the task is linear and the geometry of the training distribution is sufficiently “ diverse ” . To our knowledge , our results are the first extrapolation results of this kind for feedforward neural networks . We then relate our insights into feedforward neural networks to GNNs , to explain why GNNs extrapolate well in some algorithmic tasks . Prior works report successful extrapolation for tasks that can be solved by dynamic programming ( DP ) ( Bellman , 1966 ) , which has a computation structure aligned with GNNs ( Xu et al. , 2020 ) . DP updates can often be decomposed into nonlinear and linear steps . Hence , we hypothesize that GNNs trained by GD can extrapolate well in a DP task , if we encode appropriate non-linearities in the architecture and input representation ( Figure 2 ) . Importantly , encoding non-linearities may be unnecessary for GNNs to interpolate , because the MLP modules can easily learn many nonlinear functions inside the training distribution ( Cybenko , 1989 ; Hornik et al. , 1989 ; Xu et al. , 2020 ) , but it is crucial for GNNs to extrapolate correctly . We prove this hypothesis for a simplified case using Graph NTK ( Du et al. , 2019b ) . Empirically , we validate the hypothesis on three DP tasks : max degree , shortest paths , and n-body problem . We show GNNs with appropriate architecture , input representation , and training distribution can predict well on graphs with unseen sizes , structures , edge weights , and node features . Our theory explains the empirical success in previous works and suggests their limitations : successful extrapolation relies on encoding task-specific non-linearities , which requires domain knowledge or extensive model search . From a broader standpoint , our insights go beyond GNNs and apply broadly to other neural networks . To summarize , we study how neural networks extrapolate . First , ReLU MLPs trained by GD converge to linear functions along directions from the origin with a rate of O ( 1/t ) . Second , to explain why GNNs extrapolate well in some algorithmic tasks , we prove that ReLU MLPs can extrapolate well in linear tasks , leading to a hypothesis : a neural network can extrapolate well when appropriate nonlinearities are encoded into the architecture and features . We prove this hypothesis for a simplified case and provide empirical support for more general settings . 1.1 RELATED WORK . Early works show example tasks where MLPs do not extrapolate well , e.g . learning simple polynomials ( Barnard & Wessels , 1992 ; Haley & Soloway , 1992 ) . We instead show a general pattern of how ReLU MLPs extrapolate and identify conditions for MLPs to extrapolate well . More recent works study the implicit biases induced on MLPs by gradient descent , for both the NTK and mean field regimes ( Bietti & Mairal , 2019 ; Chizat & Bach , 2018 ; Song et al. , 2018 ) . Related to our results , some works show MLP predictions converge to “ simple ” piecewise linear functions , e.g. , with few linear regions ( Hanin & Rolnick , 2019 ; Maennel et al. , 2018 ; Savarese et al. , 2019 ; Williams et al. , 2019 ) . Our work differs in that none of these works explicitly studies extrapolation , and some focus only on one-dimensional inputs . Recent works also show that in high-dimensional settings of the NTK regime , MLP is asymptotically at most a linear predictor in certain scaling limits ( Ba et al. , 2020 ; Ghorbani et al. , 2019 ) . We study a different setting ( extrapolation ) , and our analysis is non-asymptotic in nature and does not rely on random matrix theory . Prior works explore GNN extrapolation by testing on larger graphs ( Battaglia et al. , 2018 ; Santoro et al. , 2018 ; Saxton et al. , 2019 ; Velickovic et al. , 2020 ) . We are the first to theoretically study GNN extrapolation , and we complete the notion of extrapolation to include unseen features and structures . 2 PRELIMINARIES . We begin by introducing our setting . Let X be the domain of interest , e.g. , vectors or graphs . The task is to learn an underlying function g : X → R with a training set { ( xi , yi ) } ni=1 ⊂ D , where yi = g ( xi ) and D is the support of training distribution . Previous works have extensively studied in-distribution generalization where the training and the test distributions are identical ( Valiant , 1984 ; Vapnik , 2013 ) ; i.e. , D = X . In contrast , extrapolation addresses predictions on a domain X that is larger than the support of the training distribution D. We will say a model extrapolates well if it has a small extrapolation error . Definition 1 . ( Extrapolation error ) . Let f : X → R be a model trained on { ( xi , yi ) } ni=1 ⊂ D with underlying function g : X → R. Let P be a distribution over X \ D and let ` : R× R→ R be a loss function . We define the extrapolation error of f as Ex∼P [ ` ( f ( x ) , g ( x ) ) ] . We focus on neural networks trained by gradient descent ( GD ) or its variants with squared loss . We study two network architectures : feedforward and graph neural networks . Graph Neural Networks . GNNs are structured networks operating on graphs with MLP modules ( Battaglia et al. , 2018 ; Xu et al. , 2019 ) . Let G = ( V , E ) be a graph . Each node u ∈ V has a feature vector xu , and each edge ( u , v ) ∈ E has a feature vector w ( u , v ) . GNNs recursively compute node representations h ( k ) u at iteration k ( Gilmer et al. , 2017 ; Xu et al. , 2018 ) . Initially , h ( 0 ) u = xu . For k = 1 .. K , GNNs update h ( k ) u by aggregating the neighbor representations . We can optionally compute a graph representation hG by aggregating the final node representations . That is , h ( k ) u = ∑ v∈N ( u ) MLP ( k ) ( h ( k−1 ) u , h ( k−1 ) v , w ( v , u ) ) , hG = MLP ( K+1 ) ( ∑ u∈G h ( K ) u ) . ( 1 ) The final output is the graph representation hG or final node representations h ( K ) u depending on the task . We refer to the neighbor aggregation step for h ( k ) u as aggregation and the pooling step in hG as readout . Previous works typically use sum-aggregation and sum-readout ( Battaglia et al. , 2018 ) . Our results indicate why replacing them may help extrapolation ( Section 4 ) . 3 HOW FEEDFORWARD NEURAL NETWORKS EXTRAPOLATE . Feedforward networks are the simplest neural networks and building blocks of more complex architectures such as GNNs , so we first study how they extrapolate when trained by GD . Throughout the paper , we assume ReLU activation . Section 3.3 contains preliminary results for other activations . 3.1 LINEAR EXTRAPOLATION BEHAVIOR OF RELU MLPS . By architecture , ReLU networks learn piecewise linear functions , but what do these regions precisely look like outside the support of the training data ? Figure 1 illustrates examples of how ReLU MLPs extrapolate when trained by GD on various nonlinear functions . These examples suggest that outside the training support , the predictions quickly become linear along directions from the origin . We systematically verify this pattern by linear regression on MLPs ’ predictions : the coefficient of determination ( R2 ) is always greater than 0.99 ( Appendix C.2 ) . That is , ReLU MLPs “ linearize ” almost immediately outside the training data range . We formalize this observation using the implicit biases of neural networks trained by GD via the neural tangent kernel ( NTK ) : optimization trajectories of over-parameterized networks trained by GD are equivalent to those of kernel regression with a specific neural tangent kernel , under a set of assumptions called the “ NTK regime ” ( Jacot et al. , 2018 ) . We provide an informal definition here ; for further details , we refer the readers to Jacot et al . ( 2018 ) and Appendix A . Definition 2 . ( Informal ) A neural network trained in the NTK regime is infinitely wide , randomly initialized with certain scaling , and trained by GD with infinitesimal steps . Prior works analyze optimization and in-distribution generalization of over-parameterized neural networks via NTK ( Allen-Zhu et al. , 2019a ; b ; Arora et al. , 2019a ; b ; Cao & Gu , 2019 ; Du et al. , 2019c ; a ; Li & Liang , 2018 ; Nitanda & Suzuki , 2021 ) . We instead analyze extrapolation . Theorem 1 formalizes our observation from Figure 1 : outside the training data range , along any direction tv from the origin , the prediction of a two-layer ReLU MLP quickly converges to a linear function with rate O ( 1t ) . The linear coefficients βv and the constant terms in the convergence rate depend on the training data and direction v. The proof is in Appendix B.1 . Theorem 1 . ( Linear extrapolation ) . Suppose we train a two-layer ReLU MLP f : Rd → R with squared loss in the NTK regime . For any direction v ∈ Rd , let x0 = tv . As t → ∞ , f ( x0 + hv ) − f ( x0 ) → βv · h for any h > 0 , where βv is a constant linear coefficient . Moreover , given > 0 , for t = O ( 1 ) , we have | f ( x0+hv ) −f ( x0 ) h − βv| < . ReLU networks have finitely many linear regions ( Arora et al. , 2018 ; Hanin & Rolnick , 2019 ) , hence their predictions eventually become linear . In contrast , Theorem 1 is a more fine-grained analysis of how MLPs extrapolate and provides a convergence rate . While Theorem 1 assumes two-layer networks in the NTK regime , experiments confirm that the linear extrapolation behavior happens across networks with different depths , widths , learning rates , and batch sizes ( Appendix C.1 and C.2 ) . Our proof technique potentially also extends to deeper networks . Theorem 1 implies which target functions a ReLU MLP may be able to match outside the training data : only functions that are almost-linear along the directions away from the origin . Indeed , Figure 4a shows ReLU MLPs do not extrapolate target functions such as x > Ax ( quadratic ) , ∑d i=1 cos ( 2π ·x ( i ) ) ( cos ) , and ∑d i=1 √ x ( i ) ( sqrt ) , where x ( i ) is the i-th dimension of x . With suitable hyperparameters , MLPs extrapolate the L1 norm correctly , which satisfies the directional linearity condition . Figure 4a provides one more positive result : MLPs extrapolate linear target functions well , across many different hyperparameters . While learning linear functions may seem very limited at first , in Section 4 this insight will help explain extrapolation properties of GNNs in non-linear practical tasks . Before that , we first theoretically analyze when MLPs extrapolate well .
This paper analyzes the extrapolate ability of MLPs and GNNs. In contrast to the existing theoretical works that focus on generalizability and capacity of these models, this paper emphasizes the behavior of training algorithm using gradient descent. It takes analogy of kernel regression via the neural tangent kernel as an example to study the bias induced by the gradient descent algorithm. The presentation of this paper is clear and well-organized with the most significant result shown in the first section, raising interest of the readers, as opposed to leaving them behind a massive amount of proofs. The contribution of this paper is significant as well since it draws attention of the researcher to theoretical analysis on the bias induced from the implementations of the algorithms as compared to the theoretical analysis on the model structure itself. Model extrapolation is also closely connected to topics such as meta-learning, multi-task learning, domain adaptation and semi-supervised learning since the ability of model extrapolation will limit its performance when applied to other tasks.
SP:43728b5763907cbe84f1c7ded63e5f63c45415c5
STRATA: Simple, Gradient-free Attacks for Models of Code
1 INTRODUCTION . Although machine learning has been shown to be effective at a wide variety of tasks across computing , statistical models are susceptible to adversarial examples . Adversarial examples , first identified in the continuous domain by Szegedy et al . ( 2014 ) , are imperceptible perturbations to input that result in misclassification . Researchers have developed effective techniques for adversarial example generation in the image domain ( Goodfellow et al. , 2015 ; Moosavi-Dezfooli et al. , 2017 ; Papernot et al. , 2016a ) and in the natural language domain ( Alzantot et al. , 2018 ; Belinkov & Bisk , 2018 ; Cheng et al. , 2020 ; Ebrahimi et al. , 2018 ; Michel et al. , 2019 ; Papernot et al. , 2016b ) , although work in the source code domain is less extensive ( see Related Work ) . The development of adversarial examples for deep learning models has progressed in tandem with the development of methods to make models which are robust to such adversarial attacks , though much is still being learned about model robustness ( Goodfellow et al. , 2015 ; Madry et al. , 2018 ; Shafahi et al. , 2019 ; Wong et al. , 2019 ) . The threat of adversarial examples poses severe risks for ML-based malware defenses ( Al-Dujaili et al. , 2018 ; Grosse et al. , 2016 ; Kaur & Kaur , 2015 ; Kolosnjaji et al. , 2018 ; Kreuk et al. , 2019 ; Suciu et al. , 2019 ) , and introduces the ability of malicious actors to trick ML-based code-suggestion tools to suggest bugs to an unknowing developer ( Schuster et al. , 2020 ) . Thus , developing state-of-the-art attacks and constructing machine learning models that are robust to these attacks is important for computer security applications . Generating adversarial examples for models of code poses a challenge compared to the image and natural language domain , since the input data is discrete and textual and adversarial perturbations must abide by strict syntactical rules and semantic requirements . The CODE2SEQ model is a state-of-the-art model of code that has been used to explore adversarial example design and robustness methods on models of code ( Rabin & Alipour , 2020 ; Ramakrishnan et al. , 2020 ) . In this work , we propose the Simple TRAined Token Attack ( STRATA ) , a novel and effective method for generating black-box and white-box adversarial attacks against CODE2SEQ . Our method replaces local variable names with high impact candidates that are identified by dataset statistics . It can also be used effectively for targeted attacks , where the perturbation targets a specific ( altered ) output classification . Further , we demonstrate that adversarial training , that is , injecting adversarial examples into CODE2SEQ ’ s training set , improves the robustness of CODE2SEQ to adversarial attacks . We evaluate STRATA on CODE2SEQ , though we hypothesize that the method can be applied to other models . The principles underlying STRATA apply not only to models of source code , but also to natural language models in contexts where the vocabulary is large and there is limited training data . STRATA has a number of advantages compared to previously proposed adversarial attack strategies : 1 . STRATA constructs state-of-the-art adversarial examples using a gradient-free approach that outperforms gradient-based methods ; 2 . STRATA generates white-box adversarial examples that are extremely effective ; blackbox attacks that use dictionaries created from unrelated code datasets perform similarly ( Appendix C ) 3 . STRATA does not require the use of a GPU and can be executed more quickly than competing gradient-based attacks ( Appendix D.1 ) ; 4 . STRATA is the only available method ( known to the authors at present ) which performs targeted attacks on CODE2SEQ , which is the current state-of-the-art for models of code . 2 MOTIVATION . CODE2SEQ , developed by Alon et al . ( 2019a ) , is an encoder-decoder model inspired by SEQ2SEQ ( Sutskever et al. , 2014 ) ; it operates on code rather than natural language . CODE2SEQ is the state-ofthe-art code model , and therefore it represents a good target for adversarial attacks and adversarial training . The model is tasked to predict method names from the source code body of a method . The model considers both the structure of an input program ’ s Abstract Syntax Trees ( ASTs ) as well as the tokens corresponding to identifiers such as variable names , types , and invoked method names . To reduce the vocabulary size , identifier tokens are split into subtokens by commonly used delimiters such as camelCase and under_scores . In this example , subtokens would include “ camel ” and “ case ” and “ under ” and “ scores ” . CODE2SEQ encodes subtokens into distributed embedding vectors . These subtoken embedding vectors are trained to capture semantic structure , so nearby embedding vectors should correspond to semantically similar subtokens ( Bengio et al. , 2003 ) . In this paper , we distinguish between subtoken embedding vectors and token embedding vectors . Subtoken embedding vectors are trained model parameters . Token embedding vectors are computed as a sum of the embedding vectors of the constituent subtokens . If the token contains more than five subtokens , only the first five are summed , as per the CODE2SEQ architecture . The full description and architecture of the CODE2SEQ model is given in the original paper by Alon et al . ( 2019a ) . The CODE2SEQ model only updates a subtoken embedding as frequently as that subtoken appears during training , which is proportional to its representation in the training dataset . However , the training datasets have very large vocabularies consisting not only of standard programming language keywords , but also a huge quantity of neologisms . The frequency at which subtokens appear in the CODE2SEQ java-large training set varies over many orders of magnitude , with the least common subtokens appearing fewer than 150 times , and the most common over 108 times . Thus , subtoken embedding vectors corresponding with infrequently-appearing subtokens will be modified by the training procedure much less often than common subtokens . Figure 1a demonstrates this phenomenon , showing a disparity between L2 norms of frequent and infrequently-appearing subtoken embedding vectors . We confirm this empirically . When we initialized embedding vectors uniformly at random and then trained the model as normal , as per Alon et al . ( 2019a ) , we found that the vast majority of final , i.e. , post-training , embedding vectors change very little from their initialization value . In fact , 90 % of embedding tokens had an L2 distance of less than 0.05 between the initial vector and final , post-training vector when trained on a java dataset . About 10 % of subtokens had a large L2 distance between the initial embedding and final embedding ; these subtokens were more frequent in the training dataset and had embedding vectors with a notably larger final L2 magnitude ( Figure 1 ) . The observation that high-L2-norm embedding vectors are associated with subtokens that appear sufficiently frequently in the dataset motivates the core intuitions of our attack1 . We show in this paper that subtokens with high-L2-norm embedding vectors can be used for effective adversarial examples , which are constructed as follows : 1We note very-high-frequency subtokens have small L2 norms . Examples of these very-high-frequency subtokens include : get , set , string , and void , which appear so often as to not be useful for classification . Despite the fact that these subtokens are not good adversarial candidates for STRATA , there are so few of them that we expect them to have minimal influence on the effectiveness of our attack . 1 . To maximize adversarial effectiveness in a white-box setting , we should use tokens with high L2 norm embedding vectors as local variable name replacements . We confirm this empirically in the Experiments section . 2 . In the absence of information about the L2 norms of embedding vectors , we can isolate high-L2-norm subtokens for local variable name replacement by selecting tokens which appear in the training dataset often enough to be well trained . This is empirically confirmed by the large intersection of high-L2-norm subtokens and subtokens with high frequency . 3 METHODS . 3.1 DATASET DEFINITIONS AND CONSIDERATIONS . We evaluate our attack on four datasets that are used for training different CODE2SEQ models . There are three , non-overlapping Java datasets : java-small ( 700k examples ) , java-medium ( 4M examples ) , and java-large ( 16M examples ) ( Alon et al. , 2019a ) , and one Python dataset , python150k ( Raychev et al. , 2016 ) . We disambiguate the trained CODE2SEQ models for each datasets by denoting them CODE2SEQ-SM , CODE2SEQ-MD , CODE2SEQ-LG , and CODE2SEQ-PY for models trained on java-small , -medium , -large , and python150k respectively . Many of our experiments are evaluated on all four models ; however , experiments that require adversarial training are only evaluated on CODE2SEQ-SM , for computational feasibility . 3.2 THE ATTACK . Traditional adversarial attacks on discrete spaces involve searching the discrete space for semantically similar perturbations that yield a misclassification . Searching the space of all possible valid discrete changes in source code is often intractable or even impossible ( Rice , 1953 ) . However , there are strategies to reduce the search space . For example , perturbations may be limited to a small number of predefined operations which are known to be semantically equivalent , such as inserting deadcode , replacing local variable names , or replacing expressions with known equivalent expressions . Gradientbased attacks on the embedding space may also be used in order to optimize the search of the space itself ( Ramakrishnan et al. , 2020 ; Yefet et al. , 2020 ) . However , gradient-based attacks are computationally expensive and rely heavily on knowledge of the exact parameters of the model . We propose STRATA , which replaces local variable names with high-impact subtokens to generate adversarial examples . STRATA leverages the fact that only a relatively small number of subtoken embeddings are critical for the classification task performed by the CODE2SEQ model . In Section 2 , we presented two ways to identify high-impact subtokens . STRATA will use these to replace local variable names . Recall that the model composes these subtokens into tokens by summing the first five constituent subtoken embedding vectors . We wish to maximize the L2 norm of the resulting token , while minimizing the semantic change . We propose three strategies : 1. single : pick a single subtoken as the token ; 2 . 5-diff : pick five different ( not necessarily unique ) subtokens and concatenate them , which will have a higher expected L2 norm than single ; 3 . 5-same : pick a single subtoken , and repeat the subtoken five times to form a token , which will have the largest expected L2 norm , by the triangle inequality2 . We subjectively propose that single is the smallest and most realistic semantic change , 5-same is the largest change and the “ best-case '' for an adversarial example , and 5-diff represents an intermediate attack strength . For a given method , STRATA generates an untargeted perturbation as follows : 1 . Select one random local variable v ; 2 . Choose an adversarial token v∗ appropriately , using the chosen concatenation strategy ( single , 5-diff , or 5-same ) . For white-box attacks , choose each subtoken from a high-L2norm vocabulary ( top-n by L2 norm ) . For black-box attacks , choose each subtoken with sufficiently high frequency ( top-n by frequency ) . We discuss the optimal cutoff values ( n ) for L2 and frequency in Section 3.4 . 3 . Replace v with v∗ . For attacks on the Python dataset , since determining whether a variable is local or non-local is not always possible by looking at only the body of the method , we treat all variables as local . To perform targeted attacks in which we want the output to include a particular subtoken t , we perform the same steps as the untargeted attack , and choose v∗ to be a 5-same concatenation of t .
This paper proposes STRATA, a simple adversarial attack against the code2seq model. The key idea is to replace local variable names in the input code with other randomly chosen sub-tokens with embedding vectors of relatively high L2 norms. Meanwhile, they observe that such tokens often appear frequently in the training set, thus alternatively they can simply use frequently appeared tokens as the target to perform the attacks. In this way, they can attack the model in the black-box scenario, without the knowledge of the model parameters and the training data, as long as they can roughly approximate the frequency distribution of different code sub-tokens in the training set. They evaluate their approach on code2seq models trained for the Java code, and compare with existing attacks against code2seq models. They first show that the 5-same attack, i.e., repeating a sub-token 5 times and concatenating them as the new local variable name, is the most effective attack. This attack decreases the F1 scores more compared to the baseline attack from prior work. In addition, they show that by adding STRATA adversarial examples for adversarial training, the new model becomes more robust to their proposed attacks.
SP:8c168e9fb22c78e446487b4c0c4b3a1e27a716aa
STRATA: Simple, Gradient-free Attacks for Models of Code
1 INTRODUCTION . Although machine learning has been shown to be effective at a wide variety of tasks across computing , statistical models are susceptible to adversarial examples . Adversarial examples , first identified in the continuous domain by Szegedy et al . ( 2014 ) , are imperceptible perturbations to input that result in misclassification . Researchers have developed effective techniques for adversarial example generation in the image domain ( Goodfellow et al. , 2015 ; Moosavi-Dezfooli et al. , 2017 ; Papernot et al. , 2016a ) and in the natural language domain ( Alzantot et al. , 2018 ; Belinkov & Bisk , 2018 ; Cheng et al. , 2020 ; Ebrahimi et al. , 2018 ; Michel et al. , 2019 ; Papernot et al. , 2016b ) , although work in the source code domain is less extensive ( see Related Work ) . The development of adversarial examples for deep learning models has progressed in tandem with the development of methods to make models which are robust to such adversarial attacks , though much is still being learned about model robustness ( Goodfellow et al. , 2015 ; Madry et al. , 2018 ; Shafahi et al. , 2019 ; Wong et al. , 2019 ) . The threat of adversarial examples poses severe risks for ML-based malware defenses ( Al-Dujaili et al. , 2018 ; Grosse et al. , 2016 ; Kaur & Kaur , 2015 ; Kolosnjaji et al. , 2018 ; Kreuk et al. , 2019 ; Suciu et al. , 2019 ) , and introduces the ability of malicious actors to trick ML-based code-suggestion tools to suggest bugs to an unknowing developer ( Schuster et al. , 2020 ) . Thus , developing state-of-the-art attacks and constructing machine learning models that are robust to these attacks is important for computer security applications . Generating adversarial examples for models of code poses a challenge compared to the image and natural language domain , since the input data is discrete and textual and adversarial perturbations must abide by strict syntactical rules and semantic requirements . The CODE2SEQ model is a state-of-the-art model of code that has been used to explore adversarial example design and robustness methods on models of code ( Rabin & Alipour , 2020 ; Ramakrishnan et al. , 2020 ) . In this work , we propose the Simple TRAined Token Attack ( STRATA ) , a novel and effective method for generating black-box and white-box adversarial attacks against CODE2SEQ . Our method replaces local variable names with high impact candidates that are identified by dataset statistics . It can also be used effectively for targeted attacks , where the perturbation targets a specific ( altered ) output classification . Further , we demonstrate that adversarial training , that is , injecting adversarial examples into CODE2SEQ ’ s training set , improves the robustness of CODE2SEQ to adversarial attacks . We evaluate STRATA on CODE2SEQ , though we hypothesize that the method can be applied to other models . The principles underlying STRATA apply not only to models of source code , but also to natural language models in contexts where the vocabulary is large and there is limited training data . STRATA has a number of advantages compared to previously proposed adversarial attack strategies : 1 . STRATA constructs state-of-the-art adversarial examples using a gradient-free approach that outperforms gradient-based methods ; 2 . STRATA generates white-box adversarial examples that are extremely effective ; blackbox attacks that use dictionaries created from unrelated code datasets perform similarly ( Appendix C ) 3 . STRATA does not require the use of a GPU and can be executed more quickly than competing gradient-based attacks ( Appendix D.1 ) ; 4 . STRATA is the only available method ( known to the authors at present ) which performs targeted attacks on CODE2SEQ , which is the current state-of-the-art for models of code . 2 MOTIVATION . CODE2SEQ , developed by Alon et al . ( 2019a ) , is an encoder-decoder model inspired by SEQ2SEQ ( Sutskever et al. , 2014 ) ; it operates on code rather than natural language . CODE2SEQ is the state-ofthe-art code model , and therefore it represents a good target for adversarial attacks and adversarial training . The model is tasked to predict method names from the source code body of a method . The model considers both the structure of an input program ’ s Abstract Syntax Trees ( ASTs ) as well as the tokens corresponding to identifiers such as variable names , types , and invoked method names . To reduce the vocabulary size , identifier tokens are split into subtokens by commonly used delimiters such as camelCase and under_scores . In this example , subtokens would include “ camel ” and “ case ” and “ under ” and “ scores ” . CODE2SEQ encodes subtokens into distributed embedding vectors . These subtoken embedding vectors are trained to capture semantic structure , so nearby embedding vectors should correspond to semantically similar subtokens ( Bengio et al. , 2003 ) . In this paper , we distinguish between subtoken embedding vectors and token embedding vectors . Subtoken embedding vectors are trained model parameters . Token embedding vectors are computed as a sum of the embedding vectors of the constituent subtokens . If the token contains more than five subtokens , only the first five are summed , as per the CODE2SEQ architecture . The full description and architecture of the CODE2SEQ model is given in the original paper by Alon et al . ( 2019a ) . The CODE2SEQ model only updates a subtoken embedding as frequently as that subtoken appears during training , which is proportional to its representation in the training dataset . However , the training datasets have very large vocabularies consisting not only of standard programming language keywords , but also a huge quantity of neologisms . The frequency at which subtokens appear in the CODE2SEQ java-large training set varies over many orders of magnitude , with the least common subtokens appearing fewer than 150 times , and the most common over 108 times . Thus , subtoken embedding vectors corresponding with infrequently-appearing subtokens will be modified by the training procedure much less often than common subtokens . Figure 1a demonstrates this phenomenon , showing a disparity between L2 norms of frequent and infrequently-appearing subtoken embedding vectors . We confirm this empirically . When we initialized embedding vectors uniformly at random and then trained the model as normal , as per Alon et al . ( 2019a ) , we found that the vast majority of final , i.e. , post-training , embedding vectors change very little from their initialization value . In fact , 90 % of embedding tokens had an L2 distance of less than 0.05 between the initial vector and final , post-training vector when trained on a java dataset . About 10 % of subtokens had a large L2 distance between the initial embedding and final embedding ; these subtokens were more frequent in the training dataset and had embedding vectors with a notably larger final L2 magnitude ( Figure 1 ) . The observation that high-L2-norm embedding vectors are associated with subtokens that appear sufficiently frequently in the dataset motivates the core intuitions of our attack1 . We show in this paper that subtokens with high-L2-norm embedding vectors can be used for effective adversarial examples , which are constructed as follows : 1We note very-high-frequency subtokens have small L2 norms . Examples of these very-high-frequency subtokens include : get , set , string , and void , which appear so often as to not be useful for classification . Despite the fact that these subtokens are not good adversarial candidates for STRATA , there are so few of them that we expect them to have minimal influence on the effectiveness of our attack . 1 . To maximize adversarial effectiveness in a white-box setting , we should use tokens with high L2 norm embedding vectors as local variable name replacements . We confirm this empirically in the Experiments section . 2 . In the absence of information about the L2 norms of embedding vectors , we can isolate high-L2-norm subtokens for local variable name replacement by selecting tokens which appear in the training dataset often enough to be well trained . This is empirically confirmed by the large intersection of high-L2-norm subtokens and subtokens with high frequency . 3 METHODS . 3.1 DATASET DEFINITIONS AND CONSIDERATIONS . We evaluate our attack on four datasets that are used for training different CODE2SEQ models . There are three , non-overlapping Java datasets : java-small ( 700k examples ) , java-medium ( 4M examples ) , and java-large ( 16M examples ) ( Alon et al. , 2019a ) , and one Python dataset , python150k ( Raychev et al. , 2016 ) . We disambiguate the trained CODE2SEQ models for each datasets by denoting them CODE2SEQ-SM , CODE2SEQ-MD , CODE2SEQ-LG , and CODE2SEQ-PY for models trained on java-small , -medium , -large , and python150k respectively . Many of our experiments are evaluated on all four models ; however , experiments that require adversarial training are only evaluated on CODE2SEQ-SM , for computational feasibility . 3.2 THE ATTACK . Traditional adversarial attacks on discrete spaces involve searching the discrete space for semantically similar perturbations that yield a misclassification . Searching the space of all possible valid discrete changes in source code is often intractable or even impossible ( Rice , 1953 ) . However , there are strategies to reduce the search space . For example , perturbations may be limited to a small number of predefined operations which are known to be semantically equivalent , such as inserting deadcode , replacing local variable names , or replacing expressions with known equivalent expressions . Gradientbased attacks on the embedding space may also be used in order to optimize the search of the space itself ( Ramakrishnan et al. , 2020 ; Yefet et al. , 2020 ) . However , gradient-based attacks are computationally expensive and rely heavily on knowledge of the exact parameters of the model . We propose STRATA , which replaces local variable names with high-impact subtokens to generate adversarial examples . STRATA leverages the fact that only a relatively small number of subtoken embeddings are critical for the classification task performed by the CODE2SEQ model . In Section 2 , we presented two ways to identify high-impact subtokens . STRATA will use these to replace local variable names . Recall that the model composes these subtokens into tokens by summing the first five constituent subtoken embedding vectors . We wish to maximize the L2 norm of the resulting token , while minimizing the semantic change . We propose three strategies : 1. single : pick a single subtoken as the token ; 2 . 5-diff : pick five different ( not necessarily unique ) subtokens and concatenate them , which will have a higher expected L2 norm than single ; 3 . 5-same : pick a single subtoken , and repeat the subtoken five times to form a token , which will have the largest expected L2 norm , by the triangle inequality2 . We subjectively propose that single is the smallest and most realistic semantic change , 5-same is the largest change and the “ best-case '' for an adversarial example , and 5-diff represents an intermediate attack strength . For a given method , STRATA generates an untargeted perturbation as follows : 1 . Select one random local variable v ; 2 . Choose an adversarial token v∗ appropriately , using the chosen concatenation strategy ( single , 5-diff , or 5-same ) . For white-box attacks , choose each subtoken from a high-L2norm vocabulary ( top-n by L2 norm ) . For black-box attacks , choose each subtoken with sufficiently high frequency ( top-n by frequency ) . We discuss the optimal cutoff values ( n ) for L2 and frequency in Section 3.4 . 3 . Replace v with v∗ . For attacks on the Python dataset , since determining whether a variable is local or non-local is not always possible by looking at only the body of the method , we treat all variables as local . To perform targeted attacks in which we want the output to include a particular subtoken t , we perform the same steps as the untargeted attack , and choose v∗ to be a 5-same concatenation of t .
This paper proposes STRATA, a novel adversarial attack against source code models, more precisely against code2seq. The attack strategy can be applied under black- or white-box threat models, targeted or untargeted. Adversarial training is based on STRATA adversarial examples is proposed to render the models robust. Experiments are performed on Java code datasets of variable sizes.
SP:8c168e9fb22c78e446487b4c0c4b3a1e27a716aa
Deep Ensembles for Low-Data Transfer Learning
1 INTRODUCTION . There are many ways to construct models with minimal data . It has been shown that fine-tuning pre-trained deep models is a compellingly simple and performant approach ( Dhillon et al. , 2020 ; Kolesnikov et al. , 2019 ) , and this is the paradigm our work operates in . It is common to use networks pre-trained on ImageNet ( Deng et al. , 2009 ) , but recent works show considerable improvements by careful , task-specific pre-trained model selection ( Ngiam et al. , 2018 ; Puigcerver et al. , 2020 ) . Ensembling multiple models is a powerful idea that often leads to better predictive performance . Its secret relies on combining different predictions . The source of diversity for deep networks has been studied ( Fort et al. , 2019 ; Wenzel et al. , 2020 ) , though not thoroughly in the low-data regime . Two of the most common approaches involve training independent models from scratch with ( a ) different random initialisations , ( b ) different random subsets of the training data . Neither of these are directly applicable downstream with minimal data , as we require a pre-trained initialisation to train competitive models1 , and data scarcity makes further data fragmentation impractical . We study some ways of encouraging model diversity in a supervised transfer-learning setup , but fundamentally argue that the nature of pre-training is itself an easily accessible and valuable form of diversity . Previous works consider the construction of ensembles from a set of candidate models ( Caruana et al. , 2004 ) . Services such as Tensorflow Hub ( Google , 2018 ) and PyTorch Hub ( FAIR , 2019 ) contain hundreds of pre-trained models for computer vision ; these could all be fine-tuned on a new task to generate candidates . Factoring in the cost of hyperparameter search , this may be prohibitively expensive . We would like to know how suited a pre-trained model is for our given task before training it . This need has given rise to cheap proxy metrics which assess this suitability ( Puigcerver et al. , 2020 ) . We use such metrics - leave-one-out nearest-neighbour ( kNN ) accuracy , in particular - as a way of selecting a subset of pre-trained models , suitable for creating diverse ensembles of task-specific experts . We show that our approach is capable of quickly narrowing large pools ( up to 2,000 ) of candidate pre-trained models down to manageable ( 15 models ) task-specific sets , yielding a practical algorithm in the common context of the availability of many pre-trained models . 1For an illustration of the importance of using pre-trained models in the low-data regime see Appendix C.1 . We first experiment with sources of downstream diversity ( induced only by hyperparameterisation , augmentation or random data ordering ) , giving significant performance boosts over single models . Using our algorithm on different pools of candidate pre-trained models , we show that various forms of upstream diversity produce ensembles that are more accurate and robust to domain shift than this . Figure 1 illustrates the different approaches studied in our work . Ultimately , this new form of diversity improves on the Visual Task Adaptation Benchmark ( Zhai et al. , 2019 ) SOTA by 1.8 % . The contributions of this paper can be summarized as follows : • We study ensembling in the context of transfer learning in the low data regime & propose a number of ways to induce advantageous ensemble diversity which best leverage pre-trained models . • We show that diversity from upstream pre-training achieves better accuracy than that from the downstream fine-tuning stage ( +1.2 absolute points on average across the 19 downstream classification VTAB tasks ) , and that it is more robust to distribution shift ( +2.2 absolute average accuracy increase on distribution shifted ImageNet variants ) . • We show that they also surpass the accuracy of large SOTA models ( 76.2 % vs. 77.6 % ) at a much lower inference cost , and achieve equal performance with less than a sixth of the FLOPS . • We extend the work from Puigcerver et al . ( 2020 ) and demonstrate the efficacy of kNN accuracy as a cheap proxy metric for selecting a subset of candidate pre-trained models . 2 CREATING ENSEMBLES FROM PRE-TRAINED MODELS . We first formally introduce the technical problem we address in this paper . Next we discuss baseline approaches which use a single pre-trained model , and then we present our method that exploits using multiple pre-trained models as a source of diversity . 2.1 THE LEARNING SETUP : UPSTREAM , MODEL SELECTION , DOWNSTREAM . Transfer learning studies how models trained in one context boost learning in a different one . The most common approach pre-trains a single model on a large dataset such as ImageNet , to then tune the model weights to a downstream task . Despite algorithmic simplicity , this idea has been very successful . In a downstream low-data scenario , it is more difficult for a one-size-fits-all approach to triumph as specializing the initial representation becomes harder . As in Puigcerver et al . ( 2020 ) , we explore the scenario where a range of pre-trained models is available , and we can look at the target data to make a decision on which models to fine-tune . However , we generalize and improve it by simultaneously selected several models for fine-tuning , since downstream tasks may benefit from combining expert representations aimed at capturing different aspects of the learning task : for instance , on a natural scenery dataset one could merge different models that focus on animals , plants , food , or buildings . Fine-tuning all pre-trained models to pick the best one is a sensible strategy , but rarely feasible . To keep the algorithms practical , we identify two compute budgets that should be controlled for : The fine-tuning budget , i.e . the total number of models we can fine-tune on a downstream task ; and the inference budget , the maximum size of the final model . 2.2 BASELINES : DIVERSITY FROM DOWNSTREAM TRAINING . The baselines we propose leverage transfer learning by requiring a pre-trained model - this is crucial , see Appendix C.1 . We use a strong generalist model ( BiT-ResNet 50s from Kolesnikov et al . ( 2019 ) , trained on all upstream data ) and consider three methods to create a model set for ensemble selection . Random Seeds . Fine-tuning a generalist model multiple times with fixed hyperparameters will yield different classifiers , analagous to the DeepEnsembles of Lakshminarayanan et al . ( 2017 ) . Note , here we can only take advantage of randomised data ordering/augmentation , which Fort et al . ( 2019 ) showed , though useful , was not as beneficial as diversity from random initalisation . HyperEnsembles . Hyperparameter diversity was recently shown to further improve DeepEnsembles ( Wenzel et al. , 2020 ) . We define a hyperparameter search space , randomly sample as many configurations as we have fine-tuning budget , and fine-tune the generalist on downstream data with each of those configurations . Further details on training are given in Appendix A.2 . AugEnsembles . We generate a set of models by fine-tuning the generalist on each task with randomly sampled families of augmentation ( but fixed hyperparameters ) . Details are in Appendix A.3 . 2.3 OUR METHOD : DIVERSITY FROM UPSTREAM PRE-TRAINING . Fort et al . ( 2019 ) explain the strong performance of classical ensembling approaches – independently training randomly initialised deep networks – by showing that each constituent model explores a different mode in the function space . For transfer learning , Neyshabur et al . ( 2020 ) show that with pre-trained weights , fine-tuned models stay in a local ‘ basin ’ in the loss landscape . Combining both gives a compelling reasoning for the use of multiple pre-trained networks for transfer with ensembles , as we propose here . Instead of diversity from downstream fine-tuning , we show that in the low data regime , better ensembles can be created using diversity from pre-training . We consider three sources of upstream diversity . First , we consider generalists that were pre-trained with different random seeds on the same architecture and data . Second , we consider experts , specialist models which were pre-trained on different subsets of the large upstream dataset . Lastly , we exploit diversity in scale – pre-trained models with architectures of different sizes . Given a pool of candidate models containing such diversity , we propose the following algorithm ( Figure 1 ) : 1 . Pre-trained model selection . Fine-tuning all experts on the new task would be prohibitively expensive . Following Puigcerver et al . ( 2020 ) , we rank all the models by their kNN leave-one-out accuracy as a proxy for final fine-tuned accuracy , instead keeping the K best models ( rather than 1 ) . 2 . Fine-tuning . We add a fully connected layer to each model ’ s final representation , and then train the whole model by minimising categorical cross-entropy via SGD . Given a pool of K pre-trained models from stage 1 , we tune each with 4 learning rate schedules , yielding a total of L = 4K models for the step 3 ( Usually K = 15 and L = 60 ) . See Appendix A.1.1 for more details . 3 . Ensemble construction . This is shared among all presented ensembles . We use the greedy algorithm introduced by Caruana et al . ( 2004 ) . At each step , we greedily pick the next model which minimises cross-entropy on the validation set when it is ensembled with already chosen models . These steps are independently applied to each task ; each step makes use of the downstream dataset , so each dataset gets a tailored set of pre-trained models to create the ensemble pool and therefore very different final ensembles result . We also considered a greedy ensembling algorithm in kNN space which aims to sequentially pick complementary models which will likely ensemble well together ( Appendix C.6 ) , but picking top-K was generally better . 2.3.1 COMBINED APPROACHES . The diversity induced by different upstream models and distinct downstream hyperparameters should be complementary . Given a fine-tuning budget of L , we can set the number of pre-trained models K in advance , providing each of them with a random hyperparameter sweep of size L/K . However , for some tasks it may be more beneficial to have fewer different pre-trained models and a wider sweep , or vice versa . We aim to dynamically set this balance per-dataset using a heuristic based on the kNN accuracies ; namely , we keep all pre-trained models within some threshold percentage τ % of the top kNN accuracy , up to a maximum of K = 15 . Ideally , this would adaptively discard experts poorly suited to a given task , whose inclusion would likely harm ensemble performance . The saved compute budget is then used to squeeze more performance from available experts by testing more hyperparameters , and hopefully leading to greater useful diversity . We arbitrarily set τ = 15 % for our experiments , but this choice could likely be improved upon . Appendix C.5 shows how the number of models picked varies per task , and the gains with respect to having a fixed K . 2.3.2 PRE-TRAINING MODELS . We use BiT ResNets pre-trained on two large upstream datasets with hierarchical label spaces : JFT-300M ( Sun et al. , 2017 ) and ImageNet-21k ( Deng et al. , 2009 ) . We consider two types of pretrained models . Generalists are trained on the entire upstream dataset . In particular , we consider 15 JFT ResNet-50 generalists that were pre-trained with different random initalisations . Experts are generated by splitting the hierarchical label spaces into sub-trees and training independent models on the examples in each sub-tree . We pre-train 244 experts from JFT and 50 from ImageNet21k , following the protocol of ( Puigcerver et al. , 2020 ) ( see Appendix A.1 ) . For low-data downstream tasks , this is by far the most expensive stage of the process . It is however only incurred once , and its cost is amortized as new downstream tasks are served , since any downstream task can reuse them .
Paper proposed an ensemble learning approach for the low-data regime. Paper uses various sources of diversity - pre-training, fine-tuning and combined to create ensembles. It then uses nearest-neighbor accuracy to rank pre-trained models, fine-tune the best ones with a small hyper-parameter sweep, and greedily construct an ensemble to minimize validation cross-entropy. Paper claims to achieve state-of-the art performance with much lower inference budget.
SP:9a4c3ea3b70f57c94a649f12b8c85c35e6b3b189
Deep Ensembles for Low-Data Transfer Learning
1 INTRODUCTION . There are many ways to construct models with minimal data . It has been shown that fine-tuning pre-trained deep models is a compellingly simple and performant approach ( Dhillon et al. , 2020 ; Kolesnikov et al. , 2019 ) , and this is the paradigm our work operates in . It is common to use networks pre-trained on ImageNet ( Deng et al. , 2009 ) , but recent works show considerable improvements by careful , task-specific pre-trained model selection ( Ngiam et al. , 2018 ; Puigcerver et al. , 2020 ) . Ensembling multiple models is a powerful idea that often leads to better predictive performance . Its secret relies on combining different predictions . The source of diversity for deep networks has been studied ( Fort et al. , 2019 ; Wenzel et al. , 2020 ) , though not thoroughly in the low-data regime . Two of the most common approaches involve training independent models from scratch with ( a ) different random initialisations , ( b ) different random subsets of the training data . Neither of these are directly applicable downstream with minimal data , as we require a pre-trained initialisation to train competitive models1 , and data scarcity makes further data fragmentation impractical . We study some ways of encouraging model diversity in a supervised transfer-learning setup , but fundamentally argue that the nature of pre-training is itself an easily accessible and valuable form of diversity . Previous works consider the construction of ensembles from a set of candidate models ( Caruana et al. , 2004 ) . Services such as Tensorflow Hub ( Google , 2018 ) and PyTorch Hub ( FAIR , 2019 ) contain hundreds of pre-trained models for computer vision ; these could all be fine-tuned on a new task to generate candidates . Factoring in the cost of hyperparameter search , this may be prohibitively expensive . We would like to know how suited a pre-trained model is for our given task before training it . This need has given rise to cheap proxy metrics which assess this suitability ( Puigcerver et al. , 2020 ) . We use such metrics - leave-one-out nearest-neighbour ( kNN ) accuracy , in particular - as a way of selecting a subset of pre-trained models , suitable for creating diverse ensembles of task-specific experts . We show that our approach is capable of quickly narrowing large pools ( up to 2,000 ) of candidate pre-trained models down to manageable ( 15 models ) task-specific sets , yielding a practical algorithm in the common context of the availability of many pre-trained models . 1For an illustration of the importance of using pre-trained models in the low-data regime see Appendix C.1 . We first experiment with sources of downstream diversity ( induced only by hyperparameterisation , augmentation or random data ordering ) , giving significant performance boosts over single models . Using our algorithm on different pools of candidate pre-trained models , we show that various forms of upstream diversity produce ensembles that are more accurate and robust to domain shift than this . Figure 1 illustrates the different approaches studied in our work . Ultimately , this new form of diversity improves on the Visual Task Adaptation Benchmark ( Zhai et al. , 2019 ) SOTA by 1.8 % . The contributions of this paper can be summarized as follows : • We study ensembling in the context of transfer learning in the low data regime & propose a number of ways to induce advantageous ensemble diversity which best leverage pre-trained models . • We show that diversity from upstream pre-training achieves better accuracy than that from the downstream fine-tuning stage ( +1.2 absolute points on average across the 19 downstream classification VTAB tasks ) , and that it is more robust to distribution shift ( +2.2 absolute average accuracy increase on distribution shifted ImageNet variants ) . • We show that they also surpass the accuracy of large SOTA models ( 76.2 % vs. 77.6 % ) at a much lower inference cost , and achieve equal performance with less than a sixth of the FLOPS . • We extend the work from Puigcerver et al . ( 2020 ) and demonstrate the efficacy of kNN accuracy as a cheap proxy metric for selecting a subset of candidate pre-trained models . 2 CREATING ENSEMBLES FROM PRE-TRAINED MODELS . We first formally introduce the technical problem we address in this paper . Next we discuss baseline approaches which use a single pre-trained model , and then we present our method that exploits using multiple pre-trained models as a source of diversity . 2.1 THE LEARNING SETUP : UPSTREAM , MODEL SELECTION , DOWNSTREAM . Transfer learning studies how models trained in one context boost learning in a different one . The most common approach pre-trains a single model on a large dataset such as ImageNet , to then tune the model weights to a downstream task . Despite algorithmic simplicity , this idea has been very successful . In a downstream low-data scenario , it is more difficult for a one-size-fits-all approach to triumph as specializing the initial representation becomes harder . As in Puigcerver et al . ( 2020 ) , we explore the scenario where a range of pre-trained models is available , and we can look at the target data to make a decision on which models to fine-tune . However , we generalize and improve it by simultaneously selected several models for fine-tuning , since downstream tasks may benefit from combining expert representations aimed at capturing different aspects of the learning task : for instance , on a natural scenery dataset one could merge different models that focus on animals , plants , food , or buildings . Fine-tuning all pre-trained models to pick the best one is a sensible strategy , but rarely feasible . To keep the algorithms practical , we identify two compute budgets that should be controlled for : The fine-tuning budget , i.e . the total number of models we can fine-tune on a downstream task ; and the inference budget , the maximum size of the final model . 2.2 BASELINES : DIVERSITY FROM DOWNSTREAM TRAINING . The baselines we propose leverage transfer learning by requiring a pre-trained model - this is crucial , see Appendix C.1 . We use a strong generalist model ( BiT-ResNet 50s from Kolesnikov et al . ( 2019 ) , trained on all upstream data ) and consider three methods to create a model set for ensemble selection . Random Seeds . Fine-tuning a generalist model multiple times with fixed hyperparameters will yield different classifiers , analagous to the DeepEnsembles of Lakshminarayanan et al . ( 2017 ) . Note , here we can only take advantage of randomised data ordering/augmentation , which Fort et al . ( 2019 ) showed , though useful , was not as beneficial as diversity from random initalisation . HyperEnsembles . Hyperparameter diversity was recently shown to further improve DeepEnsembles ( Wenzel et al. , 2020 ) . We define a hyperparameter search space , randomly sample as many configurations as we have fine-tuning budget , and fine-tune the generalist on downstream data with each of those configurations . Further details on training are given in Appendix A.2 . AugEnsembles . We generate a set of models by fine-tuning the generalist on each task with randomly sampled families of augmentation ( but fixed hyperparameters ) . Details are in Appendix A.3 . 2.3 OUR METHOD : DIVERSITY FROM UPSTREAM PRE-TRAINING . Fort et al . ( 2019 ) explain the strong performance of classical ensembling approaches – independently training randomly initialised deep networks – by showing that each constituent model explores a different mode in the function space . For transfer learning , Neyshabur et al . ( 2020 ) show that with pre-trained weights , fine-tuned models stay in a local ‘ basin ’ in the loss landscape . Combining both gives a compelling reasoning for the use of multiple pre-trained networks for transfer with ensembles , as we propose here . Instead of diversity from downstream fine-tuning , we show that in the low data regime , better ensembles can be created using diversity from pre-training . We consider three sources of upstream diversity . First , we consider generalists that were pre-trained with different random seeds on the same architecture and data . Second , we consider experts , specialist models which were pre-trained on different subsets of the large upstream dataset . Lastly , we exploit diversity in scale – pre-trained models with architectures of different sizes . Given a pool of candidate models containing such diversity , we propose the following algorithm ( Figure 1 ) : 1 . Pre-trained model selection . Fine-tuning all experts on the new task would be prohibitively expensive . Following Puigcerver et al . ( 2020 ) , we rank all the models by their kNN leave-one-out accuracy as a proxy for final fine-tuned accuracy , instead keeping the K best models ( rather than 1 ) . 2 . Fine-tuning . We add a fully connected layer to each model ’ s final representation , and then train the whole model by minimising categorical cross-entropy via SGD . Given a pool of K pre-trained models from stage 1 , we tune each with 4 learning rate schedules , yielding a total of L = 4K models for the step 3 ( Usually K = 15 and L = 60 ) . See Appendix A.1.1 for more details . 3 . Ensemble construction . This is shared among all presented ensembles . We use the greedy algorithm introduced by Caruana et al . ( 2004 ) . At each step , we greedily pick the next model which minimises cross-entropy on the validation set when it is ensembled with already chosen models . These steps are independently applied to each task ; each step makes use of the downstream dataset , so each dataset gets a tailored set of pre-trained models to create the ensemble pool and therefore very different final ensembles result . We also considered a greedy ensembling algorithm in kNN space which aims to sequentially pick complementary models which will likely ensemble well together ( Appendix C.6 ) , but picking top-K was generally better . 2.3.1 COMBINED APPROACHES . The diversity induced by different upstream models and distinct downstream hyperparameters should be complementary . Given a fine-tuning budget of L , we can set the number of pre-trained models K in advance , providing each of them with a random hyperparameter sweep of size L/K . However , for some tasks it may be more beneficial to have fewer different pre-trained models and a wider sweep , or vice versa . We aim to dynamically set this balance per-dataset using a heuristic based on the kNN accuracies ; namely , we keep all pre-trained models within some threshold percentage τ % of the top kNN accuracy , up to a maximum of K = 15 . Ideally , this would adaptively discard experts poorly suited to a given task , whose inclusion would likely harm ensemble performance . The saved compute budget is then used to squeeze more performance from available experts by testing more hyperparameters , and hopefully leading to greater useful diversity . We arbitrarily set τ = 15 % for our experiments , but this choice could likely be improved upon . Appendix C.5 shows how the number of models picked varies per task , and the gains with respect to having a fixed K . 2.3.2 PRE-TRAINING MODELS . We use BiT ResNets pre-trained on two large upstream datasets with hierarchical label spaces : JFT-300M ( Sun et al. , 2017 ) and ImageNet-21k ( Deng et al. , 2009 ) . We consider two types of pretrained models . Generalists are trained on the entire upstream dataset . In particular , we consider 15 JFT ResNet-50 generalists that were pre-trained with different random initalisations . Experts are generated by splitting the hierarchical label spaces into sub-trees and training independent models on the examples in each sub-tree . We pre-train 244 experts from JFT and 50 from ImageNet21k , following the protocol of ( Puigcerver et al. , 2020 ) ( see Appendix A.1 ) . For low-data downstream tasks , this is by far the most expensive stage of the process . It is however only incurred once , and its cost is amortized as new downstream tasks are served , since any downstream task can reuse them .
[Summary] This paper presents different ways of creating ensembles from pre-trained models. Specifically, authors first utilize nearest-neighbor accuracy to to rank pre-trained models, then fine-tune the best ones with a small hyperparameter sweep, and finally greedily construct an ensemble to minimize validation cross-entropy. Experiments on the Visual Task Adaptation Benchmark show the efficacy of the approach in selecting few models within a computational budget.
SP:9a4c3ea3b70f57c94a649f12b8c85c35e6b3b189
Transferable Recognition-Aware Image Processing
1 INTRODUCTION Unlike in image recognition where a neural network maps an image to a semantic label , a neural network used for image processing maps an input image to an output image with some desired properties . Examples include image super-resolution ( Dong et al. , 2014 ) , denoising ( Xie et al. , 2012 ) , deblurring ( Eigen et al. , 2013 ) , colorization ( Zhang et al. , 2016 ) and style transfer ( Gatys et al. , 2015 ) . The goal of such systems is to produce images of high perceptual quality to a human observer . For example , in image denoising , we aim to remove noise in the signal that is not useful to an observer and restore the image to its original “ clean ” form . Metrics like PSNR and SSIM ( Wang et al. , 2004 ) are often used ( Dong et al. , 2014 ; Tong et al. , 2017 ) to approximate human-perceived similarity between the processed images with the original images , and direct human assessment on the fidelity of the output is often considered the “ gold-standard ” assessment ( Ledig et al. , 2017 ; Zhang et al. , 2018b ) . Therefore , many techniques ( Johnson et al. , 2016 ; Ledig et al. , 2017 ; Isola et al. , 2017 ) have been proposed for making the output images look perceptually pleasing to human . However , image processing outputs may not be accurately recognized by image recognition systems . As shown in Fig . 1 , the output image of an denoising model could easily be recognized by a human as a bird , but a recognition model classifies it as a kite . One could specifically train a recognition model only on these output images produced by the denoising model to achieve better performance on such images , or could leverage some domain adaptation approaches to adapt the recognition model to this domain , but the performance on natural images can be harmed . This retraining/adaptation scheme might also be impractical considering the significant overhead induced by catering to various image processing tasks and models . With the fast-growing size of image data , many images are often “ viewed ” and analyzed more by machines than by humans . Nowadays , any image uploaded to the Internet is likely to be analyzed by certain vision systems . For example , Facebook uses a system called Rosetta to extract texts from over 1 billion user-uploaded images every day ( Maria , 2018 ) . It is of great importance that the processed images be recognizable by not only humans , but also by machines . In other words , recognition systems ( e.g. , image classifier or object detector ) , should be able to accurately explain the underlying semantic meaning of the image content . In this way , we make them potentially easier to search , recommended to more interested audience , and so on , as these procedures are mostly executed by machines based on their understanding of the images . Therefore , we argue that image processing systems should also aim at better machine recognizability . We call this problem “ Recognition-Aware Image Processing ” . It is also important that the enhanced recognizability is not specific to any concrete neural networkbased recognition model , i.e. , the improvement on recognition performance is only achieved when the output images are evaluated on that particular model . Instead , the improvement should ideally be transferable when evaluated on different models , to support its usage without access to possible future recognition systems , since we may not decide what model will be used for recognizing the processed image , for example if we upload it to the Internet or share it on social media . We may not know what network architectures ( e.g . ResNet or VGG ) will be used for inference , what object categories the downstream model recognizes ( e.g . animals or scenes ) , or even what task will be performed on the processed image ( e.g . classification or detection ) . Without these specifications , it might be hard to enhance image ’ s machine semantics . In this work , we propose simple and highly effective approaches to make image processing outputs more accurately recognized by downstream recognition systems , transferable among different recognition architectures , categories and tasks . The approaches we investigate add a recognition loss optimized jointly with the image processing loss . The recognition loss is computed using a fixed recognition model that is pretrained on natural images , and can be done in an unsupervised manner , e.g. , without semantic labels of the image . It can be optimized either directly by the original image processing network , or through an intermediate transforming network . We conduct extensive experiments , on multiple image enhancement/restoration ( super-resolution , denoising , and JPEG-deblocking ) and recognition ( classification and detection ) tasks , and demonstrate that our approaches can substantially boost the recognition accuracy on the downstream systems , with minimal or no loss in the image processing quality measured by conventional metrics . Also , the accuracy improvement transfers favorably among different recognition model architectures , object categories , and recognition tasks , which renders our simple solution effective even when we do not have access to the downstream recognition models . Our contributions can be summarized as follows : • We propose to study the problem of enhancing the machine interpretability of image processing outputs , a desired property considering the amount of images analyzed by machines nowadays . • We propose simple and effective methods towards this goal , suitable for different use cases , e.g. , without ground truth semantic labels . Extensive experiments are conducted on multiple image processing and recognition tasks , demonstrating the wide applicability of the proposed methods . • We show that using our simple approaches , the recognition accuracy improvement could transfer among recognition architectures , categories and tasks , a desirable behavior making the proposed methods applicable without access to the downstream recognition model . 2 RELATED WORK . Image processing/enhancement problems such as super-resolution and denoising have a long history ( Tsai , 1984 ; Park et al. , 2003 ; Rudin et al. , 1992 ; Candès et al. , 2006 ) . Since the initial success of deep neural networks on these problems ( Dong et al. , 2014 ; Xie et al. , 2012 ; Wang et al. , 2016b ) , a large body of works try to investigate better model architecture design and training techniques ( Dong et al. , 2016 ; Kim et al. , 2016b ; Shi et al. , 2016 ; Kim et al. , 2016a ; Mao et al. , 2016 ; Lai et al. , 2017 ; Tai et al. , 2017a ; Tong et al. , 2017 ; Tai et al. , 2017b ; Lim et al. , 2017 ; Zhang et al. , 2018d ; Ahn et al. , 2018 ; Lefkimmiatis , 2018 ; Chen et al. , 2018 ; Haris et al. , 2018b ) , mostly on the image superresolution task . These works focus on generating high visual quality images under conventional metrics or human evaluation , without considering recognition performance on the output . There are also a number of works that relate image recognition with processing . Some works ( Zhang et al. , 2016 ; Larsson et al. , 2016 ; Zhang et al. , 2018c ; Sajjadi et al. , 2017 ) use image classification accuracy as an evaluation metric for image colorization/super-resolution , but without optimizing for it during training . Wang et al . ( 2016a ) incorporates super-resolution and domain adaptation techniques for better recognition on very low resolution images . Bai et al . ( 2018 ) train a superresolution and refinement network simultaneously to better detect faces in the wild . Zhang et al . ( 2018a ) train networks for face hallucination and recognition jointly to achieve better recover the face identity from low-resolution images . Liu et al . ( 2018 ) considers 3D face reconstruction and trains the recognition model jointly with the reconstructor . Sharma et al . ( 2018 ) trains a classification model together with an enhancement module . Our problem setting is different from these works , in that we assume we do not have the control on the recognition model , as it might be on the cloud or decided in the future , thus we advocate adapting the image processing model only . This also ensures the recognition model is not harmed on natural images . Haris et al . ( 2018a ) investigate how super-resolution could help object detection in low-resolution images . VidalMata et al . ( 2019 ) and Banerjee et al . ( 2019 ) also aims to enhance machine accuracy on poor-conditioned images but mostly focus on better image processing techniques without using recognition models . Wang et al . ( 2019 ) propose a method to make denoised images more accurately segmented , also presenting some interesting findings in transferability . Most existing works only consider one image processing task or image domain , and develop specific techniques , while our simpler approach is task-agnostic and potentially more widely applicable . Our work is also related but different from those which aims for robustness of the recognition model ( Hendrycks & Dietterich , 2019 ; Li et al. , 2019 ; Shankar et al. , 2018 ) , since we focus on the training of the processing models and assume the recognition model is given . 3 METHOD . In this section we first introduce the problem setting of “ recognition-aware ” image processing , and then we develop various approaches to address it , each suited for different use cases . 3.1 PROBLEM SETTING . In a typical image processing problem , given a set of training input images { Ikin } and corresponding target images { Iktarget } ( k = 1 , · · ·N ) , we aim to train a neural network that maps an input image to its corresponding target . For example , in image denoising , Ikin is a noisy image and I k target is the corresponding clean image . Denoting this mapping network as P ( for processing ) , parameterized by WP , during training our optimization objective is : min WP Lproc = 1 N N∑ k=1 lproc ( P ( Ikin ) , Iktarget ) , ( 1 ) where P ( Ikin ) is simply the output of the processing model Iout , and lproc is the loss function for each sample . The pixel-wise mean-squared-error ( MSE , or L2 ) loss is one of the most popular choices . During evaluation , the performance is typically measured by average similarity ( e.g. , PSNR , SSIM ) between Iktarget and I k out = P ( Ikin ) , or through human assessment . In our problem setting of recognition-aware processing , we are interested in a recognition task , with a trained recognition model R ( R for recognition ) , parameterized by WR . We assume each input/target image pair Ikin/I k target is associated with a ground truth semantic label S k for the recognition task . Our goal is to train a image processing model P such that the recognition performance on the output images { Ikout = P ( Ikin ) } is high , when evaluated using R with the semantic labels { Sk } . In practice , the recognition model R might not be available ( e.g. , on the cloud ) , in which case we could resort to other models if the performance improvement transfers among models .
This paper proposes a setting called "recognition-aware image processing." The key idea is to make the images output by image processing methods still be readily recognized by image recognition methods. Realizing this will help to better meet the requirement from both human observers and machines. Formally, this is formulated as a combined optimization in which the losses from image processing and recognition tasks are jointly considered. This framework is further extended to unsupervised case and the case of intermediate transformer to make it more flexible. The transferability issue is discussed and it is observed that the model trained by the proposed method can generally help even when other recognition models or tasks are used. Experimental study is conducted to demonstrate the performance of the proposed method.
SP:f17ad6d00a23e46ebe9175e1eeea7d3eef7f8c84
Transferable Recognition-Aware Image Processing
1 INTRODUCTION Unlike in image recognition where a neural network maps an image to a semantic label , a neural network used for image processing maps an input image to an output image with some desired properties . Examples include image super-resolution ( Dong et al. , 2014 ) , denoising ( Xie et al. , 2012 ) , deblurring ( Eigen et al. , 2013 ) , colorization ( Zhang et al. , 2016 ) and style transfer ( Gatys et al. , 2015 ) . The goal of such systems is to produce images of high perceptual quality to a human observer . For example , in image denoising , we aim to remove noise in the signal that is not useful to an observer and restore the image to its original “ clean ” form . Metrics like PSNR and SSIM ( Wang et al. , 2004 ) are often used ( Dong et al. , 2014 ; Tong et al. , 2017 ) to approximate human-perceived similarity between the processed images with the original images , and direct human assessment on the fidelity of the output is often considered the “ gold-standard ” assessment ( Ledig et al. , 2017 ; Zhang et al. , 2018b ) . Therefore , many techniques ( Johnson et al. , 2016 ; Ledig et al. , 2017 ; Isola et al. , 2017 ) have been proposed for making the output images look perceptually pleasing to human . However , image processing outputs may not be accurately recognized by image recognition systems . As shown in Fig . 1 , the output image of an denoising model could easily be recognized by a human as a bird , but a recognition model classifies it as a kite . One could specifically train a recognition model only on these output images produced by the denoising model to achieve better performance on such images , or could leverage some domain adaptation approaches to adapt the recognition model to this domain , but the performance on natural images can be harmed . This retraining/adaptation scheme might also be impractical considering the significant overhead induced by catering to various image processing tasks and models . With the fast-growing size of image data , many images are often “ viewed ” and analyzed more by machines than by humans . Nowadays , any image uploaded to the Internet is likely to be analyzed by certain vision systems . For example , Facebook uses a system called Rosetta to extract texts from over 1 billion user-uploaded images every day ( Maria , 2018 ) . It is of great importance that the processed images be recognizable by not only humans , but also by machines . In other words , recognition systems ( e.g. , image classifier or object detector ) , should be able to accurately explain the underlying semantic meaning of the image content . In this way , we make them potentially easier to search , recommended to more interested audience , and so on , as these procedures are mostly executed by machines based on their understanding of the images . Therefore , we argue that image processing systems should also aim at better machine recognizability . We call this problem “ Recognition-Aware Image Processing ” . It is also important that the enhanced recognizability is not specific to any concrete neural networkbased recognition model , i.e. , the improvement on recognition performance is only achieved when the output images are evaluated on that particular model . Instead , the improvement should ideally be transferable when evaluated on different models , to support its usage without access to possible future recognition systems , since we may not decide what model will be used for recognizing the processed image , for example if we upload it to the Internet or share it on social media . We may not know what network architectures ( e.g . ResNet or VGG ) will be used for inference , what object categories the downstream model recognizes ( e.g . animals or scenes ) , or even what task will be performed on the processed image ( e.g . classification or detection ) . Without these specifications , it might be hard to enhance image ’ s machine semantics . In this work , we propose simple and highly effective approaches to make image processing outputs more accurately recognized by downstream recognition systems , transferable among different recognition architectures , categories and tasks . The approaches we investigate add a recognition loss optimized jointly with the image processing loss . The recognition loss is computed using a fixed recognition model that is pretrained on natural images , and can be done in an unsupervised manner , e.g. , without semantic labels of the image . It can be optimized either directly by the original image processing network , or through an intermediate transforming network . We conduct extensive experiments , on multiple image enhancement/restoration ( super-resolution , denoising , and JPEG-deblocking ) and recognition ( classification and detection ) tasks , and demonstrate that our approaches can substantially boost the recognition accuracy on the downstream systems , with minimal or no loss in the image processing quality measured by conventional metrics . Also , the accuracy improvement transfers favorably among different recognition model architectures , object categories , and recognition tasks , which renders our simple solution effective even when we do not have access to the downstream recognition models . Our contributions can be summarized as follows : • We propose to study the problem of enhancing the machine interpretability of image processing outputs , a desired property considering the amount of images analyzed by machines nowadays . • We propose simple and effective methods towards this goal , suitable for different use cases , e.g. , without ground truth semantic labels . Extensive experiments are conducted on multiple image processing and recognition tasks , demonstrating the wide applicability of the proposed methods . • We show that using our simple approaches , the recognition accuracy improvement could transfer among recognition architectures , categories and tasks , a desirable behavior making the proposed methods applicable without access to the downstream recognition model . 2 RELATED WORK . Image processing/enhancement problems such as super-resolution and denoising have a long history ( Tsai , 1984 ; Park et al. , 2003 ; Rudin et al. , 1992 ; Candès et al. , 2006 ) . Since the initial success of deep neural networks on these problems ( Dong et al. , 2014 ; Xie et al. , 2012 ; Wang et al. , 2016b ) , a large body of works try to investigate better model architecture design and training techniques ( Dong et al. , 2016 ; Kim et al. , 2016b ; Shi et al. , 2016 ; Kim et al. , 2016a ; Mao et al. , 2016 ; Lai et al. , 2017 ; Tai et al. , 2017a ; Tong et al. , 2017 ; Tai et al. , 2017b ; Lim et al. , 2017 ; Zhang et al. , 2018d ; Ahn et al. , 2018 ; Lefkimmiatis , 2018 ; Chen et al. , 2018 ; Haris et al. , 2018b ) , mostly on the image superresolution task . These works focus on generating high visual quality images under conventional metrics or human evaluation , without considering recognition performance on the output . There are also a number of works that relate image recognition with processing . Some works ( Zhang et al. , 2016 ; Larsson et al. , 2016 ; Zhang et al. , 2018c ; Sajjadi et al. , 2017 ) use image classification accuracy as an evaluation metric for image colorization/super-resolution , but without optimizing for it during training . Wang et al . ( 2016a ) incorporates super-resolution and domain adaptation techniques for better recognition on very low resolution images . Bai et al . ( 2018 ) train a superresolution and refinement network simultaneously to better detect faces in the wild . Zhang et al . ( 2018a ) train networks for face hallucination and recognition jointly to achieve better recover the face identity from low-resolution images . Liu et al . ( 2018 ) considers 3D face reconstruction and trains the recognition model jointly with the reconstructor . Sharma et al . ( 2018 ) trains a classification model together with an enhancement module . Our problem setting is different from these works , in that we assume we do not have the control on the recognition model , as it might be on the cloud or decided in the future , thus we advocate adapting the image processing model only . This also ensures the recognition model is not harmed on natural images . Haris et al . ( 2018a ) investigate how super-resolution could help object detection in low-resolution images . VidalMata et al . ( 2019 ) and Banerjee et al . ( 2019 ) also aims to enhance machine accuracy on poor-conditioned images but mostly focus on better image processing techniques without using recognition models . Wang et al . ( 2019 ) propose a method to make denoised images more accurately segmented , also presenting some interesting findings in transferability . Most existing works only consider one image processing task or image domain , and develop specific techniques , while our simpler approach is task-agnostic and potentially more widely applicable . Our work is also related but different from those which aims for robustness of the recognition model ( Hendrycks & Dietterich , 2019 ; Li et al. , 2019 ; Shankar et al. , 2018 ) , since we focus on the training of the processing models and assume the recognition model is given . 3 METHOD . In this section we first introduce the problem setting of “ recognition-aware ” image processing , and then we develop various approaches to address it , each suited for different use cases . 3.1 PROBLEM SETTING . In a typical image processing problem , given a set of training input images { Ikin } and corresponding target images { Iktarget } ( k = 1 , · · ·N ) , we aim to train a neural network that maps an input image to its corresponding target . For example , in image denoising , Ikin is a noisy image and I k target is the corresponding clean image . Denoting this mapping network as P ( for processing ) , parameterized by WP , during training our optimization objective is : min WP Lproc = 1 N N∑ k=1 lproc ( P ( Ikin ) , Iktarget ) , ( 1 ) where P ( Ikin ) is simply the output of the processing model Iout , and lproc is the loss function for each sample . The pixel-wise mean-squared-error ( MSE , or L2 ) loss is one of the most popular choices . During evaluation , the performance is typically measured by average similarity ( e.g. , PSNR , SSIM ) between Iktarget and I k out = P ( Ikin ) , or through human assessment . In our problem setting of recognition-aware processing , we are interested in a recognition task , with a trained recognition model R ( R for recognition ) , parameterized by WR . We assume each input/target image pair Ikin/I k target is associated with a ground truth semantic label S k for the recognition task . Our goal is to train a image processing model P such that the recognition performance on the output images { Ikout = P ( Ikin ) } is high , when evaluated using R with the semantic labels { Sk } . In practice , the recognition model R might not be available ( e.g. , on the cloud ) , in which case we could resort to other models if the performance improvement transfers among models .
The paper proposed a learnable image processing methods that improve machine interpretability of processed image. The paper mainly claimed that improvement of machine recognition is transferrable when evaluated on models of different architectures, recognized categories, tasks and training datasets. Additionally, the paper also try to explain this transferability phenomenon by demonstrating the similarities of different models’ decision boundaries.
SP:f17ad6d00a23e46ebe9175e1eeea7d3eef7f8c84
Least Probable Disagreement Region for Active Learning
1 INTRODUCTION . Active learning ( Cohn et al. , 1996 ) is a subfield of machine learning to attain data efficiency with fewer labeled training data when it is allowed to choose the training data from which to learn . For many real-world learning problems , large collections of unlabeled samples is assumed available , and based on a certain query strategy , the label of the most informative data is iteratively queried to an oracle to be used in retraining the model ( Bouneffouf et al. , 2014 ; Roy & McCallum , 2001 ; Sener & Savarese , 2017b ; Settles et al. , 2008 ; Sinha et al. , 2019 ; Sener & Savarese , 2017a ; Pinsler et al. , 2019 ; Shi & Yu , 2019 ; Gudovskiy et al. , 2020 ) . Active learning attempts to achieve high accuracy using as few labeled samples as possible ( Settles , 2009 ) . Of the possible query strategies , uncertainty-based sampling ( Culotta & McCallum , 2005 ; Scheffer et al. , 2001 ; Mussmann & Liang , 2018 ) , which enhances the current model by labeling unlabeled samples that are difficult for the model to predict , is a simple strategy commonly used in pool-based active learning ( Lewis & Gale , 1994 ) . Nevertheless , many existing uncertainty-based algorithms have their own limitations . Entropy ( Shannon , 1948 ) based uncertainty sampling can query unlabeled samples near the decision boundary for binary classification , but it does not perform well in multiclass classification as entropy does not equate well with the distance to a complex decision boundary ( Joshi et al. , 2009 ) . Another approach based on MC-dropout sampling ( Gal et al. , 2017 ) which uses a mutual information based BALD ( Houlsby et al. , 2011 ) as an uncertainty measure identifies unlabeled samples that are individually informative . This approach , however , is not necessarily informative when it is jointly considered with other samples for label acquisition . To address this problem , BatchBALD ( Kirsch et al. , 2019 ) is introduced . However , BatchBALD computes , theoretically , all possible joint mutual information of batch , and is infeasible for large query size . The ensemble method ( Beluch et al. , 2018 ) , one of the query by committee ( QBC ) algorithm ( Seung et al. , 1992 ) , has been shown to perform well in many cases . The fundamental premise behind the QBC is minimizing the version space ( Mitchell , 1982 ) , which is the set of hypotheses that are consistent with labeled samples . However , the ensemble method requires high computation load because all networks that make up the ensemble must be trained . This paper defines a theoretical distance referred to as the least probable disagreement region ( LPDR ) from sample to the estimated decision boundary , and in each step of active learning , labels of unlabeled samples nearest to the decision boundary in terms of LPDR are obtained to be used for retraining the classifier to improve accuracy of the estimated decision boundary . It is generally understood that labels to samples near the decision boundary are the most informative as the samples are uncertain . Indeed in Balcan et al . ( 2007 ) , selecting unlabeled samples with the smallest margin to the linear decision boundary and thereby minimal certainty attains exponential improvement over random sampling in terms of sample complexity . In deep learning , it is difficult to identify samples nearest to the decision boundary as sample distance to decision boundary is difficult to evaluate . An adversarial approach ( Ducoffe & Precioso , 2018 ) to approximate the sample distance to decision boundary has been studied but this method does not show preservation of the order of the sample distance and requires considerable computation in obtaining the distance . 2 DISTANCE : LEAST PROBABLE DISAGREEMENT REGION ( LPDR ) . This paper proposes an algorithm for selecting unlabeled data that are close to the decision boundary which can not be explicitly defined in many of cases . Let X , Y , H and D be the instance space , the label space , the set of hypotheses h : x → y and the joint distribution over ( x , y ) ∈ X × Y . The distance between two hypotheses ĥ and h is defined as the probability of the disagreement region for ĥ and h. This distance was originally defined in Hanneke et al . ( 2014 ) and Hsu ( 2010 ) : ρ ( ĥ , h ) : = PD [ ĥ ( X ) 6= h ( X ) ] . ( 1 ) This paper defines the sample distance d of x to the hypothesis ĥ ∈ H based on ρ as the least probable disagreement region ( LPDR ) that contains x : d ( x , ĥ ) : = inf h∈H ( x , ĥ ) ρ ( ĥ , h ) ( 2 ) whereH ( x , ĥ ) = { h ∈ H : ĥ ( x ) 6= h ( x ) } . Figure 1 shows an example of LPDR . Let ’ s define H = { hθ : hθ ( x ) = I [ x > θ ] } on input x sampled from uniform distribution D = U [ 0 , 1 ] where I [ · ] is an indicator function . Suppose x = x0 and ĥ = ha ∈ H when a < x0 . Here , H ( x0 , ha ) consists of all hypotheses whose prediction on x0 is in disagreement with ha ( x0 ) = 1 , i.e. , H ( x0 , ha ) = { hb ∈ H : hb ( x0 ) = 0 } = { hb ∈ H : b > x0 } . Then , the LPDR between x0 and ha , d ( x0 , ha ) = x0 − a as the infimum of the distance between ha and hb ∈ H ( x0 , ha ) is ρ ( ha , hx0 ) = x0 − a . Here , the sample distribution D is unknown , and H ( x , ĥ ) may be uncountably infinite . Therefore , a systematic and empirical method for evaluating the distance is required . One might the procedure below : Sample hypotheses sets H′ = { h′ : ρ ( ĥ , h′ ) ≤ ρ′ } in terms of ρ′ , and perform grid search to determine the smallest ρ′ such that there exists h′ ∈ H′ satisfying ĥ ( x ) 6= h′ ( x ) for a given x . Sampling the hypotheses within the ball can be performed by sampling the corresponding parameters with the assumption that the expected hypothesis distance is monotonically increasing for the expected distance between the corresponding parameters ( see Assumption 1 ) . This scheme is based on performing grid search on ρ′ and is therefore computationally inefficient . However , unlabeled samples can be ordered according to d without grid search with the assumption that there exists aH′ such that variation ratio V ( x ) = 1− f ( x ) m /|H′| and d ( x , ĥ ) have strong negative correlation where f ( x ) m = maxc ∑ h′∈H′ I [ h′ ( x ) = c ] ( see Assumption 2 ) . Assumption 1 . The expected distance between ĥ and randomly sampled h is monotonically increasing in the expected distance between the corresponding ŵ and w , i.e. , E [ ‖ŵ − w1‖ | ŵ ] ≤ E [ ‖ŵ − w2‖ | ŵ ] implies that E [ ρ ( ĥ , h1 ) | ĥ ] ≤ E [ ρ ( ĥ , h2 ) | ĥ ] where ŵ , w1 and w2 are the parameters pertaining to ĥ , h1 and h2 respectively . Assumption 2 . There exists a hypothesis set H′ sampled around ĥ having the property that large variation ratio for a given sample data implies small sample distance to ĥ with high probability , i.e. , there existsH′ such that V ( x1 ) ≥ V ( x2 ) implies that d ( x1 , ĥ ) ≤ d ( x2 , ĥ ) with high probability . 3 EMPIRICAL STUDIES OF LPDR . 3.1 HYPOTHESES AND PARAMETERS IN DEEP NETWORKS : ASSUMPTION 1 . The distance between two hypotheses can be approximated by vectors of the predicted labels on random samples by the hypotheses : ρ ( ĥ , h ) ≈ ρe ( ĥ , h ) = 1 m m∑ i=1 I [ ĥ ( x ( i ) ) 6= h ( x ( i ) ) ] ( 3 ) where x ( i ) is the ith sample for i ∈ [ m ] . The h is sampled by sampling model parameter w ∼ N ( ŵ , Iσ2 ) where ŵ is the model parameter of ĥ , and the expectation of distances between w and ŵ depends on σ . The ρe is obtained by the average of 100 times for a fixed σ . The left-hand side of Figure 2 shows the relationship between ρe and σ on various datasets and deep networks . The ρe increases almost monotonically as σ increases . This implies that the order is preserved between the σ and ρe . Furthermore , the ρe is almost linearly proportional to log ( σ ) in the ascension of the graph , i.e. , σ ∝ eβρe for some β > 0 . The right-hand side of Figure 2 shows V with respect to σ for each unlabeled sample on MNIST . The sample distance to the decision boundary can be expressed as σ at which the variation ratio is not zero for the first time ( white arrow ) , where the indices of unlabeled samples in y-axis are ordered by LPDR . The variation ratio increases as the σ increases , and it is expected that the data point with short distance has the large variation ratio compared to the data point with long distance on a certain range of σ . 3.2 LPDR VS VARIATION RATIO : ASSUMPTION 2 . The left-hand side of Figure 3 shows Spearman ’ s rank correlation coefficient ( Spearman , 1904 ) between LPDR and the variation ratio with respect to σ . The correlation is calculated using only unlabeled samples whose variation ratio is not 0 . The strong rank correlation is verified when the σ has the appropriate value . Too larger value of σ generates hypotheses too far away from ĥ , which is not helpful to measure the distance . The right-hand side of Figure 3 shows an example of σ ( log ( σ ) = −5.0 ) which makes LPDR and the variation ratio have a strong negative correlation on MNIST , that is , the data point with larger variation is closer to the decision boundary . Results for various datasets and networks are presented in Appendix C. The time complexity is discussed to validate the efficiency of using variation ratio . Let m , N and nσ be the unlabeled sample size , |H′| and the number of grid for σ respectively . Ordering unlabeled samples in terms of LPDR by grid search with respect to σ requires the time complexity of m × N × nσ ( see the right-hand side of Figure 2 ) . However , using variation ratio for ordering unlabeled samples reduces the time complexity to m×N . In the case of nσ = cN for some c > 0 , then the time complexity can be reduced from O ( mN2 ) to O ( mN ) .
The paper defines a new measure of distance between a hypothesis $h$ and a point $x$, which is the probability mass of the smallest (by probability mass) disagreement region (induced by the other $h' \in \mathcal{H}$) containing $x$. In general this is intractable so the authors offer two assumptions about the relationship between this measure and more tractable quantities (one being the distance between the model parameters of those hypotheses, and the other being what the authors call the 'variation ratio'). The reasonability of these assumptions is then assessed, and the algorithm is tested on a variety of dataset and against several reasonable competitors.
SP:213a295549ebc49eda533baf77de2e0aed81cbb1
Least Probable Disagreement Region for Active Learning
1 INTRODUCTION . Active learning ( Cohn et al. , 1996 ) is a subfield of machine learning to attain data efficiency with fewer labeled training data when it is allowed to choose the training data from which to learn . For many real-world learning problems , large collections of unlabeled samples is assumed available , and based on a certain query strategy , the label of the most informative data is iteratively queried to an oracle to be used in retraining the model ( Bouneffouf et al. , 2014 ; Roy & McCallum , 2001 ; Sener & Savarese , 2017b ; Settles et al. , 2008 ; Sinha et al. , 2019 ; Sener & Savarese , 2017a ; Pinsler et al. , 2019 ; Shi & Yu , 2019 ; Gudovskiy et al. , 2020 ) . Active learning attempts to achieve high accuracy using as few labeled samples as possible ( Settles , 2009 ) . Of the possible query strategies , uncertainty-based sampling ( Culotta & McCallum , 2005 ; Scheffer et al. , 2001 ; Mussmann & Liang , 2018 ) , which enhances the current model by labeling unlabeled samples that are difficult for the model to predict , is a simple strategy commonly used in pool-based active learning ( Lewis & Gale , 1994 ) . Nevertheless , many existing uncertainty-based algorithms have their own limitations . Entropy ( Shannon , 1948 ) based uncertainty sampling can query unlabeled samples near the decision boundary for binary classification , but it does not perform well in multiclass classification as entropy does not equate well with the distance to a complex decision boundary ( Joshi et al. , 2009 ) . Another approach based on MC-dropout sampling ( Gal et al. , 2017 ) which uses a mutual information based BALD ( Houlsby et al. , 2011 ) as an uncertainty measure identifies unlabeled samples that are individually informative . This approach , however , is not necessarily informative when it is jointly considered with other samples for label acquisition . To address this problem , BatchBALD ( Kirsch et al. , 2019 ) is introduced . However , BatchBALD computes , theoretically , all possible joint mutual information of batch , and is infeasible for large query size . The ensemble method ( Beluch et al. , 2018 ) , one of the query by committee ( QBC ) algorithm ( Seung et al. , 1992 ) , has been shown to perform well in many cases . The fundamental premise behind the QBC is minimizing the version space ( Mitchell , 1982 ) , which is the set of hypotheses that are consistent with labeled samples . However , the ensemble method requires high computation load because all networks that make up the ensemble must be trained . This paper defines a theoretical distance referred to as the least probable disagreement region ( LPDR ) from sample to the estimated decision boundary , and in each step of active learning , labels of unlabeled samples nearest to the decision boundary in terms of LPDR are obtained to be used for retraining the classifier to improve accuracy of the estimated decision boundary . It is generally understood that labels to samples near the decision boundary are the most informative as the samples are uncertain . Indeed in Balcan et al . ( 2007 ) , selecting unlabeled samples with the smallest margin to the linear decision boundary and thereby minimal certainty attains exponential improvement over random sampling in terms of sample complexity . In deep learning , it is difficult to identify samples nearest to the decision boundary as sample distance to decision boundary is difficult to evaluate . An adversarial approach ( Ducoffe & Precioso , 2018 ) to approximate the sample distance to decision boundary has been studied but this method does not show preservation of the order of the sample distance and requires considerable computation in obtaining the distance . 2 DISTANCE : LEAST PROBABLE DISAGREEMENT REGION ( LPDR ) . This paper proposes an algorithm for selecting unlabeled data that are close to the decision boundary which can not be explicitly defined in many of cases . Let X , Y , H and D be the instance space , the label space , the set of hypotheses h : x → y and the joint distribution over ( x , y ) ∈ X × Y . The distance between two hypotheses ĥ and h is defined as the probability of the disagreement region for ĥ and h. This distance was originally defined in Hanneke et al . ( 2014 ) and Hsu ( 2010 ) : ρ ( ĥ , h ) : = PD [ ĥ ( X ) 6= h ( X ) ] . ( 1 ) This paper defines the sample distance d of x to the hypothesis ĥ ∈ H based on ρ as the least probable disagreement region ( LPDR ) that contains x : d ( x , ĥ ) : = inf h∈H ( x , ĥ ) ρ ( ĥ , h ) ( 2 ) whereH ( x , ĥ ) = { h ∈ H : ĥ ( x ) 6= h ( x ) } . Figure 1 shows an example of LPDR . Let ’ s define H = { hθ : hθ ( x ) = I [ x > θ ] } on input x sampled from uniform distribution D = U [ 0 , 1 ] where I [ · ] is an indicator function . Suppose x = x0 and ĥ = ha ∈ H when a < x0 . Here , H ( x0 , ha ) consists of all hypotheses whose prediction on x0 is in disagreement with ha ( x0 ) = 1 , i.e. , H ( x0 , ha ) = { hb ∈ H : hb ( x0 ) = 0 } = { hb ∈ H : b > x0 } . Then , the LPDR between x0 and ha , d ( x0 , ha ) = x0 − a as the infimum of the distance between ha and hb ∈ H ( x0 , ha ) is ρ ( ha , hx0 ) = x0 − a . Here , the sample distribution D is unknown , and H ( x , ĥ ) may be uncountably infinite . Therefore , a systematic and empirical method for evaluating the distance is required . One might the procedure below : Sample hypotheses sets H′ = { h′ : ρ ( ĥ , h′ ) ≤ ρ′ } in terms of ρ′ , and perform grid search to determine the smallest ρ′ such that there exists h′ ∈ H′ satisfying ĥ ( x ) 6= h′ ( x ) for a given x . Sampling the hypotheses within the ball can be performed by sampling the corresponding parameters with the assumption that the expected hypothesis distance is monotonically increasing for the expected distance between the corresponding parameters ( see Assumption 1 ) . This scheme is based on performing grid search on ρ′ and is therefore computationally inefficient . However , unlabeled samples can be ordered according to d without grid search with the assumption that there exists aH′ such that variation ratio V ( x ) = 1− f ( x ) m /|H′| and d ( x , ĥ ) have strong negative correlation where f ( x ) m = maxc ∑ h′∈H′ I [ h′ ( x ) = c ] ( see Assumption 2 ) . Assumption 1 . The expected distance between ĥ and randomly sampled h is monotonically increasing in the expected distance between the corresponding ŵ and w , i.e. , E [ ‖ŵ − w1‖ | ŵ ] ≤ E [ ‖ŵ − w2‖ | ŵ ] implies that E [ ρ ( ĥ , h1 ) | ĥ ] ≤ E [ ρ ( ĥ , h2 ) | ĥ ] where ŵ , w1 and w2 are the parameters pertaining to ĥ , h1 and h2 respectively . Assumption 2 . There exists a hypothesis set H′ sampled around ĥ having the property that large variation ratio for a given sample data implies small sample distance to ĥ with high probability , i.e. , there existsH′ such that V ( x1 ) ≥ V ( x2 ) implies that d ( x1 , ĥ ) ≤ d ( x2 , ĥ ) with high probability . 3 EMPIRICAL STUDIES OF LPDR . 3.1 HYPOTHESES AND PARAMETERS IN DEEP NETWORKS : ASSUMPTION 1 . The distance between two hypotheses can be approximated by vectors of the predicted labels on random samples by the hypotheses : ρ ( ĥ , h ) ≈ ρe ( ĥ , h ) = 1 m m∑ i=1 I [ ĥ ( x ( i ) ) 6= h ( x ( i ) ) ] ( 3 ) where x ( i ) is the ith sample for i ∈ [ m ] . The h is sampled by sampling model parameter w ∼ N ( ŵ , Iσ2 ) where ŵ is the model parameter of ĥ , and the expectation of distances between w and ŵ depends on σ . The ρe is obtained by the average of 100 times for a fixed σ . The left-hand side of Figure 2 shows the relationship between ρe and σ on various datasets and deep networks . The ρe increases almost monotonically as σ increases . This implies that the order is preserved between the σ and ρe . Furthermore , the ρe is almost linearly proportional to log ( σ ) in the ascension of the graph , i.e. , σ ∝ eβρe for some β > 0 . The right-hand side of Figure 2 shows V with respect to σ for each unlabeled sample on MNIST . The sample distance to the decision boundary can be expressed as σ at which the variation ratio is not zero for the first time ( white arrow ) , where the indices of unlabeled samples in y-axis are ordered by LPDR . The variation ratio increases as the σ increases , and it is expected that the data point with short distance has the large variation ratio compared to the data point with long distance on a certain range of σ . 3.2 LPDR VS VARIATION RATIO : ASSUMPTION 2 . The left-hand side of Figure 3 shows Spearman ’ s rank correlation coefficient ( Spearman , 1904 ) between LPDR and the variation ratio with respect to σ . The correlation is calculated using only unlabeled samples whose variation ratio is not 0 . The strong rank correlation is verified when the σ has the appropriate value . Too larger value of σ generates hypotheses too far away from ĥ , which is not helpful to measure the distance . The right-hand side of Figure 3 shows an example of σ ( log ( σ ) = −5.0 ) which makes LPDR and the variation ratio have a strong negative correlation on MNIST , that is , the data point with larger variation is closer to the decision boundary . Results for various datasets and networks are presented in Appendix C. The time complexity is discussed to validate the efficiency of using variation ratio . Let m , N and nσ be the unlabeled sample size , |H′| and the number of grid for σ respectively . Ordering unlabeled samples in terms of LPDR by grid search with respect to σ requires the time complexity of m × N × nσ ( see the right-hand side of Figure 2 ) . However , using variation ratio for ordering unlabeled samples reduces the time complexity to m×N . In the case of nσ = cN for some c > 0 , then the time complexity can be reduced from O ( mN2 ) to O ( mN ) .
This paper is motivated by the idea that unlabelled samples near the estimated decision boundary show to be very informative/useful in an active learning setting. However, measuring the distance between an instance and the decision boundary is a non-trivial task in numerous machine learning algorithms, especially in deep learning. The paper proposes a (theoretical) sample distance to the decision boundary that relies on the least probable disagreement region (LPDR) that still contains the sample. The paper makes two assumptions to evaluate the proposed distance empirically: (1) closeness of the parameters of two hypotheses implies closeness of these hypotheses as defined by the probability of the disagreement region and (2) the variation ratio of labels obtained by evaluating a set of hypotheses sampled around the decision boundary is a proxy for the proposed distance. Considering these assumptions, hypotheses are sampled around a given decision boundary by adding gaussian noise to the parameters of the fitted model. Both assumptions are validated empirically on different datasets and varying levels of variance of the noise term to show the effect on the variation ratio and distance respectively. Consequently, an iterative active learning algorithm is proposed which adapts the variance of the noise term in order to select the predefined number of samples. Extensive experimental results indicate that LPDR outperforms other uncertainty based active learning algorithms on various datasets or is at least on par with them.
SP:213a295549ebc49eda533baf77de2e0aed81cbb1
Contrastive Divergence Learning is a Time Reversal Adversarial Game
1 INTRODUCTION . Unnormalized probability models have drawn significant attention over the years . These models arise , for example , in energy based models , where the normalization constant is intractable to compute , and are thus relevant to numerous settings . Particularly , they have been extensively used in the context of restricted Boltzmann machines ( Smolensky , 1986 ; Hinton , 2002 ) , deep belief networks ( Hinton et al. , 2006 ; Salakhutdinov & Hinton , 2009 ) , Markov random fields ( Carreira-Perpinan & Hinton , 2005 ; Hinton & Salakhutdinov , 2006 ) , and recently also with deep neural networks ( Xie et al. , 2016 ; Song & Ermon , 2019 ; Du & Mordatch , 2019 ; Grathwohl et al. , 2019 ; Nijkamp et al. , 2019 ) . Fitting an unnormalized density model to a dataset is challenging due to the missing normalization constant of the distribution . A naive approach is to employ approximate maximum likelihood estimation ( MLE ) . This approach relies on the fact that the likelihood ’ s gradient can be approximated using samples from the model , generated using Markov Chain Monte Carlo ( MCMC ) techniques . However , a good approximation requires using very long chains and is thus impractical . This difficulty motivated the development of a plethora of more practical approaches , like score matching ( Hyvärinen , 2005 ) , noise contrastive estimation ( NCE ) ( Gutmann & Hyvärinen , 2010 ) , and conditional NCE ( CNCE ) ( Ceylan & Gutmann , 2018 ) , which replace the log-likelihood loss with objectives that do not require the computation of the normalization constant or its gradient . Perhaps the most popular method for learning unnormalized models is contrastive divergence ( CD ) ( Hinton , 2002 ) . CD ’ s advantage over MLE stems from its use of short Markov chains initialized at the data samples . CD has been successfully used in a wide range of domains , including modeling images ( Hinton et al. , 2006 ) , speech ( Mohamed & Hinton , 2010 ) , documents ( Hinton & Salakhutdinov , 2009 ) , and movie ratings ( Salakhutdinov et al. , 2007 ) , and is continuing to attract significant research attention ( Liu & Wang , 2017 ; Gao et al. , 2018 ; Qiu et al. , 2019 ) . Despite CD ’ s popularity and empirical success , there still remain open questions regarding its theoretical properties . The primary source of difficulty is an unjustified approximation used to derive its objective ’ s gradient , which biases its update steps ( Carreira-Perpinan & Hinton , 2005 ; Bengio & Delalleau , 2009 ) . The difficulty is exacerbated by the fact that CD ’ s update steps can not be expressed as the gradients of any fixed objective ( Tieleman , 2007 ; Sutskever & Tieleman , 2010 ) . In this paper , we present an alternative derivation of CD , which relies on completely different principles and requires no approximations . Specifically , we show that CD ’ s update steps are the gradients of an adversarial game in which a discriminator attempts to classify whether a Markov chain generated from the model is presented to it in its original or a time-reversed order ( see Fig . 1 ) . Thus , our derivation sheds new light on CD ’ s success : Similarly to modern generative adversarial methods ( Goodfellow et al. , 2014 ) , CD ’ s discrimination task becomes more challenging as the model approaches the true distribution . This keeps the update steps effective throughout the entire training process and prevents early saturation as often happens in non-adaptive methods like NCE and CNCE . In fact , we derive CD as a natural extension of the CNCE method , replacing the fixed distribution of the contrastive examples with an adversarial adaptive distribution . CD requires that the underlying MCMC be exact , which is not the case for popular methods like Langevin dynamics . This commonly requires using Metropolis-Hastings ( MH ) rejection , which ignores some of the generated samples . Interestingly , our derivation reveals an alternative correction method for inexact chains , which does not require rejection . 2 BACKGROUND . 2.1 THE CLASSICAL DERIVATION OF CD . Assume we have an unnormalized distribution model pθ . Given a dataset of samples { xi } independently drawn from some unknown distribution p , CD attempts to determine the parameters θ with which pθ best explains the dataset . Rather than using the log-likelihood loss , CD ’ s objective involves distributions of samples along finite Markov chains initialized at { xi } . When based on chains of length k , the algorithm is usually referred to as CD-k . Concretely , let qθ ( x′|x ) denote the transition rule of a Markov chain with stationary distribution pθ , and let rmθ denote the distribution of samples after m steps of the chain . As the Markov chain is initialized from the dataset distribution and converges to pθ , we have that r0θ = p and r ∞ θ = pθ . The CD algorithm then attempts to minimize the loss ` CD-k = DKL ( r 0 θ ||r∞θ ) −DKL ( rkθ ||r∞θ ) = DKL ( p||pθ ) −DKL ( rkθ ||pθ ) , ( 1 ) where DKL is the Kullback-Leibler divergence . Under mild conditions on qθ ( Cover & Halliwell , 1994 ) this loss is guaranteed to be positive , and it vanishes when pθ = p ( in which case rkθ = pθ ) . To allow the minimization of ( 1 ) using gradient-based methods , one can write ∇θ ` CD-k =EX̃∼rkθ [ ∇θ log pθ ( X̃ ) ] − EX∼p [ ∇θ log pθ ( X ) ] + dDKL ( r k θ ||pθ ) drkθ ∇θrkθ . ( 2 ) Here , the first two terms can be approximated using two batches of samples , one drawn from p and one from rkθ . The third term is the derivative of the loss with respect only to the θ that appears in r k θ , ignoring the dependence of pθ on θ . This is the original notation from ( Hinton , 2002 ) ; an alternative way to write this term would be ∇θ̃DKL ( rkθ̃ ||pθ ) . This term turns out to be intractable and in the original derivation , it is argued to be small and thus neglected , leading to the approximation ∇θ ` CD-k ≈ 1 n ∑ i ( ∇θ log pθ ( x̃i ) −∇θ log pθ ( xi ) ) ( 3 ) Here { xi } is a batch of n samples from the dataset and { x̃i } are n samples generated by applying k MCMC steps to each of the samples in that batch . The intuition behind the resulting algorithm ( summarized in App . A ) is therefore simple . In each gradient step θ ← θ− η∇θ ` CD-k , the log-likelihood of samples from the dataset is increased on the expense of the log-likelihood of the contrastive samples { x̃i } , which are closer to the current learned distribution pθ . Despite the simple intuition , it has been shown that without the third term , CD ’ s update rule ( 2 ) generally can not be the gradient of any fixed objective ( Tieleman , 2007 ; Sutskever & Tieleman , 2010 ) except for some very specific cases . For example , Hyvärinen ( 2007 ) has shown that when the Markov chain is based on Langevin dynamics with a step size that approaches zero , the update rule of CD-1 coincides with that of score-matching Hyvärinen ( 2005 ) . Similarly , the probability flow method of Sohl-Dickstein et al . ( 2011 ) has been shown to be equivalent to CD with a very unique Markov chain . Here , we show that regardless of the selection of the Markov chain , the update rule is in fact the exact gradient of a particular adversarial objective , which adapts to the current learned model in each step . 2.2 CONDITIONAL NOISE CONTRASTIVE ESTIMATION . Our derivation views CD as an extension of the CNCE method , which itself is an extension of NCE . We therefore start by briefly reviewing those two methods . In NCE , the unsupervised density learning problem is transformed into a supervised one . This is done by training a discriminator Dθ ( x ) to distinguish between samples drawn from p and samples drawn from some preselected contrastive distribution pref . Specifically , let the random variable Y denote the label of the class from which the variable X has been drawn , so that X| ( Y = 1 ) ∼ p and X| ( Y = 0 ) ∼ pref . Then it is well known that the discriminator minimizing the binary cross-entropy ( BCE ) loss is given by Dopt ( x ) = P ( Y = 1|X = x ) = p ( x ) p ( x ) + pref ( x ) . ( 4 ) Therefore , letting our parametric discriminator have the form Dθ ( x ) = pθ ( x ) pθ ( x ) + pref ( x ) , ( 5 ) and training it with the BCE loss , should in theory lead to Dθ ( x ) = Dopt ( x ) and thus to pθ ( x ) = p ( x ) . In practice , however , the convergence of NCE highly depends on the selection of pref . If it significantly deviates from p , then the two distributions can be easily discriminated even when the learned distribution pθ is still very far from p. At this point , the optimization essentially stops updating the model , which can result in a very inaccurate estimate for p. In the next section we provide a precise mathematical explanation for this behavior . The CNCE method attempts to alleviate this problem by drawing the contrastive samples based on the dataset samples . Specifically , each dataset sample x is paired with a contrastive sample x̃ that is drawn conditioned on x from some predetermined conditional distribution q ( x̃|x ) ( e.g . N ( x , σ2I ) ) . The pair is then concatenated in a random order , and a discriminator is trained to predict the correct order . This is illustrated in Fig . 2a . Specifically , here the two classes are of pairs ( A , B ) corresponding to ( A , B ) = ( X , X̃ ) for Y = 1 , and ( A , B ) = ( X̃ , X ) for Y = 0 , and the discriminator minimizing the BCE loss is given by Dopt ( a , b ) = P ( Y = 1|A = a , B = b ) = q ( b|a ) p ( a ) q ( b|a ) p ( a ) + q ( a|b ) p ( b ) . ( 6 ) Therefore , constructing a parametric discriminator of the form Dθ ( a , b ) = q ( b|a ) pθ ( a ) q ( b|a ) pθ ( a ) + q ( a|b ) pθ ( b ) = ( 1 + q ( a|b ) pθ ( b ) q ( b|a ) pθ ( a ) ) −1 , ( 7 ) and training it with the BCE loss , should lead to pθ ∝ p. Note that here Dθ is indifferent to a scaling of pθ , which is thus determined only up to an arbitrary multiplicative constant . CNCE improves upon NCE , as it allows working with contrastive samples whose distribution is closer to p. However , it does not completely eliminate the problem , especially when p exhibits different scales of variation in different directions . This is the case , for example , with natural images , which are known to lie close to a low-dimensional manifold . Indeed if the conditional distribution q ( ·|· ) is chosen to have a small variance , then CNCE fails to capture the global structure of p. And if q ( ·|· ) is taken to have a large variance , then CNCE fails to capture the intricate features of p ( see Fig . 3 ) . The latter case can be easily understood in the context of images ( see Fig . 2a ) . Here , the discriminator can easily distinguish which of its pair of input images is the noisy one , without having learned an accurate model for the distribution of natural images ( e.g. , simply by comparing their smoothness ) . When this point is reached , the optimization essentially stops . In the next section we show that CD is in fact an adaptive version of CNCE , in which the contrastive distribution is constantly updated in order to keep the discrimination task hard . This explains why CD is less prone to early saturation than NCE and CNCE .
This paper presents a way to view contrastive divergence (CD) learning as an adversarial learning procedure where a discriminator is tasked with classifying whether or not a Markov chain, generated from the model, has been time-reversed. Beginning with the classic derivation of CD and its approximate gradient, noting relevant issues regarding this approximation, the authors present a way to view CD as an extension of the conditional noise contrastive estimation (CNCE) method where the contrastive distribution is continually updated to keep the discrimination task difficult. Specifically, when the contrastive distribution is chosen such that the detailed balance property is satisfied, then the CNCE loss becomes exactly proportional the CD-1 update with the derivation further extended to CD-k. Practical concerns regarding lack of detailed balance are mitigated through the use of Metropolis-Hastings rejection or an adaptive weighting that arises when deriving the gradient of their time-reversal classification loss. A toy example providing empirical support for correcting the lack of detailed balance is included.
SP:14fa0894cc0b4dd4bdb51c089cf5511c89de8b4f
Contrastive Divergence Learning is a Time Reversal Adversarial Game
1 INTRODUCTION . Unnormalized probability models have drawn significant attention over the years . These models arise , for example , in energy based models , where the normalization constant is intractable to compute , and are thus relevant to numerous settings . Particularly , they have been extensively used in the context of restricted Boltzmann machines ( Smolensky , 1986 ; Hinton , 2002 ) , deep belief networks ( Hinton et al. , 2006 ; Salakhutdinov & Hinton , 2009 ) , Markov random fields ( Carreira-Perpinan & Hinton , 2005 ; Hinton & Salakhutdinov , 2006 ) , and recently also with deep neural networks ( Xie et al. , 2016 ; Song & Ermon , 2019 ; Du & Mordatch , 2019 ; Grathwohl et al. , 2019 ; Nijkamp et al. , 2019 ) . Fitting an unnormalized density model to a dataset is challenging due to the missing normalization constant of the distribution . A naive approach is to employ approximate maximum likelihood estimation ( MLE ) . This approach relies on the fact that the likelihood ’ s gradient can be approximated using samples from the model , generated using Markov Chain Monte Carlo ( MCMC ) techniques . However , a good approximation requires using very long chains and is thus impractical . This difficulty motivated the development of a plethora of more practical approaches , like score matching ( Hyvärinen , 2005 ) , noise contrastive estimation ( NCE ) ( Gutmann & Hyvärinen , 2010 ) , and conditional NCE ( CNCE ) ( Ceylan & Gutmann , 2018 ) , which replace the log-likelihood loss with objectives that do not require the computation of the normalization constant or its gradient . Perhaps the most popular method for learning unnormalized models is contrastive divergence ( CD ) ( Hinton , 2002 ) . CD ’ s advantage over MLE stems from its use of short Markov chains initialized at the data samples . CD has been successfully used in a wide range of domains , including modeling images ( Hinton et al. , 2006 ) , speech ( Mohamed & Hinton , 2010 ) , documents ( Hinton & Salakhutdinov , 2009 ) , and movie ratings ( Salakhutdinov et al. , 2007 ) , and is continuing to attract significant research attention ( Liu & Wang , 2017 ; Gao et al. , 2018 ; Qiu et al. , 2019 ) . Despite CD ’ s popularity and empirical success , there still remain open questions regarding its theoretical properties . The primary source of difficulty is an unjustified approximation used to derive its objective ’ s gradient , which biases its update steps ( Carreira-Perpinan & Hinton , 2005 ; Bengio & Delalleau , 2009 ) . The difficulty is exacerbated by the fact that CD ’ s update steps can not be expressed as the gradients of any fixed objective ( Tieleman , 2007 ; Sutskever & Tieleman , 2010 ) . In this paper , we present an alternative derivation of CD , which relies on completely different principles and requires no approximations . Specifically , we show that CD ’ s update steps are the gradients of an adversarial game in which a discriminator attempts to classify whether a Markov chain generated from the model is presented to it in its original or a time-reversed order ( see Fig . 1 ) . Thus , our derivation sheds new light on CD ’ s success : Similarly to modern generative adversarial methods ( Goodfellow et al. , 2014 ) , CD ’ s discrimination task becomes more challenging as the model approaches the true distribution . This keeps the update steps effective throughout the entire training process and prevents early saturation as often happens in non-adaptive methods like NCE and CNCE . In fact , we derive CD as a natural extension of the CNCE method , replacing the fixed distribution of the contrastive examples with an adversarial adaptive distribution . CD requires that the underlying MCMC be exact , which is not the case for popular methods like Langevin dynamics . This commonly requires using Metropolis-Hastings ( MH ) rejection , which ignores some of the generated samples . Interestingly , our derivation reveals an alternative correction method for inexact chains , which does not require rejection . 2 BACKGROUND . 2.1 THE CLASSICAL DERIVATION OF CD . Assume we have an unnormalized distribution model pθ . Given a dataset of samples { xi } independently drawn from some unknown distribution p , CD attempts to determine the parameters θ with which pθ best explains the dataset . Rather than using the log-likelihood loss , CD ’ s objective involves distributions of samples along finite Markov chains initialized at { xi } . When based on chains of length k , the algorithm is usually referred to as CD-k . Concretely , let qθ ( x′|x ) denote the transition rule of a Markov chain with stationary distribution pθ , and let rmθ denote the distribution of samples after m steps of the chain . As the Markov chain is initialized from the dataset distribution and converges to pθ , we have that r0θ = p and r ∞ θ = pθ . The CD algorithm then attempts to minimize the loss ` CD-k = DKL ( r 0 θ ||r∞θ ) −DKL ( rkθ ||r∞θ ) = DKL ( p||pθ ) −DKL ( rkθ ||pθ ) , ( 1 ) where DKL is the Kullback-Leibler divergence . Under mild conditions on qθ ( Cover & Halliwell , 1994 ) this loss is guaranteed to be positive , and it vanishes when pθ = p ( in which case rkθ = pθ ) . To allow the minimization of ( 1 ) using gradient-based methods , one can write ∇θ ` CD-k =EX̃∼rkθ [ ∇θ log pθ ( X̃ ) ] − EX∼p [ ∇θ log pθ ( X ) ] + dDKL ( r k θ ||pθ ) drkθ ∇θrkθ . ( 2 ) Here , the first two terms can be approximated using two batches of samples , one drawn from p and one from rkθ . The third term is the derivative of the loss with respect only to the θ that appears in r k θ , ignoring the dependence of pθ on θ . This is the original notation from ( Hinton , 2002 ) ; an alternative way to write this term would be ∇θ̃DKL ( rkθ̃ ||pθ ) . This term turns out to be intractable and in the original derivation , it is argued to be small and thus neglected , leading to the approximation ∇θ ` CD-k ≈ 1 n ∑ i ( ∇θ log pθ ( x̃i ) −∇θ log pθ ( xi ) ) ( 3 ) Here { xi } is a batch of n samples from the dataset and { x̃i } are n samples generated by applying k MCMC steps to each of the samples in that batch . The intuition behind the resulting algorithm ( summarized in App . A ) is therefore simple . In each gradient step θ ← θ− η∇θ ` CD-k , the log-likelihood of samples from the dataset is increased on the expense of the log-likelihood of the contrastive samples { x̃i } , which are closer to the current learned distribution pθ . Despite the simple intuition , it has been shown that without the third term , CD ’ s update rule ( 2 ) generally can not be the gradient of any fixed objective ( Tieleman , 2007 ; Sutskever & Tieleman , 2010 ) except for some very specific cases . For example , Hyvärinen ( 2007 ) has shown that when the Markov chain is based on Langevin dynamics with a step size that approaches zero , the update rule of CD-1 coincides with that of score-matching Hyvärinen ( 2005 ) . Similarly , the probability flow method of Sohl-Dickstein et al . ( 2011 ) has been shown to be equivalent to CD with a very unique Markov chain . Here , we show that regardless of the selection of the Markov chain , the update rule is in fact the exact gradient of a particular adversarial objective , which adapts to the current learned model in each step . 2.2 CONDITIONAL NOISE CONTRASTIVE ESTIMATION . Our derivation views CD as an extension of the CNCE method , which itself is an extension of NCE . We therefore start by briefly reviewing those two methods . In NCE , the unsupervised density learning problem is transformed into a supervised one . This is done by training a discriminator Dθ ( x ) to distinguish between samples drawn from p and samples drawn from some preselected contrastive distribution pref . Specifically , let the random variable Y denote the label of the class from which the variable X has been drawn , so that X| ( Y = 1 ) ∼ p and X| ( Y = 0 ) ∼ pref . Then it is well known that the discriminator minimizing the binary cross-entropy ( BCE ) loss is given by Dopt ( x ) = P ( Y = 1|X = x ) = p ( x ) p ( x ) + pref ( x ) . ( 4 ) Therefore , letting our parametric discriminator have the form Dθ ( x ) = pθ ( x ) pθ ( x ) + pref ( x ) , ( 5 ) and training it with the BCE loss , should in theory lead to Dθ ( x ) = Dopt ( x ) and thus to pθ ( x ) = p ( x ) . In practice , however , the convergence of NCE highly depends on the selection of pref . If it significantly deviates from p , then the two distributions can be easily discriminated even when the learned distribution pθ is still very far from p. At this point , the optimization essentially stops updating the model , which can result in a very inaccurate estimate for p. In the next section we provide a precise mathematical explanation for this behavior . The CNCE method attempts to alleviate this problem by drawing the contrastive samples based on the dataset samples . Specifically , each dataset sample x is paired with a contrastive sample x̃ that is drawn conditioned on x from some predetermined conditional distribution q ( x̃|x ) ( e.g . N ( x , σ2I ) ) . The pair is then concatenated in a random order , and a discriminator is trained to predict the correct order . This is illustrated in Fig . 2a . Specifically , here the two classes are of pairs ( A , B ) corresponding to ( A , B ) = ( X , X̃ ) for Y = 1 , and ( A , B ) = ( X̃ , X ) for Y = 0 , and the discriminator minimizing the BCE loss is given by Dopt ( a , b ) = P ( Y = 1|A = a , B = b ) = q ( b|a ) p ( a ) q ( b|a ) p ( a ) + q ( a|b ) p ( b ) . ( 6 ) Therefore , constructing a parametric discriminator of the form Dθ ( a , b ) = q ( b|a ) pθ ( a ) q ( b|a ) pθ ( a ) + q ( a|b ) pθ ( b ) = ( 1 + q ( a|b ) pθ ( b ) q ( b|a ) pθ ( a ) ) −1 , ( 7 ) and training it with the BCE loss , should lead to pθ ∝ p. Note that here Dθ is indifferent to a scaling of pθ , which is thus determined only up to an arbitrary multiplicative constant . CNCE improves upon NCE , as it allows working with contrastive samples whose distribution is closer to p. However , it does not completely eliminate the problem , especially when p exhibits different scales of variation in different directions . This is the case , for example , with natural images , which are known to lie close to a low-dimensional manifold . Indeed if the conditional distribution q ( ·|· ) is chosen to have a small variance , then CNCE fails to capture the global structure of p. And if q ( ·|· ) is taken to have a large variance , then CNCE fails to capture the intricate features of p ( see Fig . 3 ) . The latter case can be easily understood in the context of images ( see Fig . 2a ) . Here , the discriminator can easily distinguish which of its pair of input images is the noisy one , without having learned an accurate model for the distribution of natural images ( e.g. , simply by comparing their smoothness ) . When this point is reached , the optimization essentially stops . In the next section we show that CD is in fact an adaptive version of CNCE , in which the contrastive distribution is constantly updated in order to keep the discrimination task hard . This explains why CD is less prone to early saturation than NCE and CNCE .
To implement the contrastive divergence (CD) algorithm in practice, an intractable term is typically omitted from the gradient. This leads to an approximation. This work shows that the resulting algorithm can in fact be viewed as an exact algorithm targeting a different, adversarial objective. The derivation in this paper also shows how Markov chains which are not reversible w.r.t. the posterior distribution of interest can be employed within the algorithm. Effectively, this assigns an importance weight to each sample which akin to the acceptance ratio which would be needed for a Metropolis--Hastings type correction.
SP:14fa0894cc0b4dd4bdb51c089cf5511c89de8b4f
Conditional Networks
1 INTRODUCTION . Deep learning has achieved great success in many core artificial intelligence ( AI ) tasks ( Hinton et al. , 2012 ; Krizhevsky et al. , 2012 ; Brown et al. , 2020 ) over the past decade . This is often attributed to better computational resources ( Brock et al. , 2018 ) and large-scale datasets ( Deng et al. , 2009 ) . Collecting and annotating datasets which represent a sufficient diversity of real-world test scenarios for every task or domain is extremely expensive and time-consuming . Hence , sufficient training data may not always be available . Due to many factors of variation ( e.g. , weather , season , daytime , illumination , view angle , sensor , and image quality ) , there is often a distributional change or domain shift that can degrade performance in real-world applications ( Shimodaira , 2000 ; Wang & Schneider , 2014 ; Chung et al. , 2018 ) . Applications in remote sensing , medical imaging , and Earth observation commonly suffer from distributional shifts resulting from atmospheric changes , seasonality , weather , use of different scanning sensors , different calibration and other variations which translate to unexpected behavior at test time ( Zhu et al. , 2017 ; Robinson et al. , 2019 ; Ortiz et al. , 2018 ) . In this work , we present a novel neural network architecture to increase robustness to distributional changes ( See Figure 1 ) . Our framework combines conditional computation ( Dumoulin et al. , 2018 ; 2016 ; De Vries et al. , 2017 ; Perez et al. , 2018 ) with a task specific neural architecture for better domain shift generalization . One key feature of this architecture is the ability to exploit extra information , often available but seldom used by current models , through a conditioning network . This results in models with better generalization , better performance in both independent and identically distributed ( i.i.d . ) and non- i.i.d . settings , and in some cases faster convergence . We demonstrate these methodological innovations on an aerial building segmentation task , where test images are from different geographic areas than the ones seen during training ( Maggiori et al. , 2017 ) and on the task of Tumor Infiltrating Lymphocytes ( TIL ) classification ( Saltz et al. , 2018 ) . We summarize our main contributions as follows : • We propose a novel architecture to effectively incorporate conditioning information , such as metadata . • We show empirically that our conditional network improves performance in the task of semantic segmentation and image classification . • We study how conditional networks improve generalization in the presence of distributional shift . 2 BACKGROUND AND RELATED WORK . Self-supervised learning . Self-supervised learning extracts and uses available relevant context and embedded metadata as supervisory signals . It is a representation learning approach that exploits a variety of labels that come with the data for free . To leverage large amounts of unlabeled data , it is possible to set the learning objectives such that supervision is generated from the data itself . The selfsupervised task , also known as pretext task , guides us to a supervised loss function ( Gidaris et al. , 2018 ; Oord et al. , 2018 ; He et al. , 2019 ; Chen et al. , 2020 ) . However , in self-supervised learning we usually do not emphasize performance on this auxiliary task . Rather we focus on the learned intermediate representation with the expectation that this representation can carry good semantic or structural meanings and can be beneficial to a variety of practical downstream tasks . Conditional networks can be seen as a self-supervision approach in which the pretext task is jointly learned with the downstream task . Our proposed modulation of a network architecture based on an auxiliary network ’ s intermediate representation can also be seen as an instance of knowledge transfer ( Hinton et al. , 2015 ; Urban et al. , 2016 ; Buciluǎ et al. , 2006 ) . Because the auxiliary network has an additional task signal – metadata prediction – information about this task can be transferred to the main task network . Conditional Computation . Ioffe and Szegedy designed Batch Normalization ( BN ) as a technique to accelerate the training of deep neural networks ( Ioffe & Szegedy , 2015 ) . BN normalizes a given mini-batch B = { Fn , . , . , . } Nn=1 of N feature maps Fn , . , . , . as described by the following Equation : BN ( Fn , c , h , w|γc , βc ) = γc Fn , c , h , w − EB [ F. , c , . , . ] √ VarB [ F. , c , . , . ] + + βc , ( 1 ) where c , h and w are indexing the channel , height and width axis , respectively , γc and βc are trainable scale and shift parameters , introduced to keep the representational power of the original network , and is a constant factor for numerical stability . For convolutional layers the mean and variance are computed over both the batch and spatial dimensions , implying that each location in the feature map is normalized in the same way . De Vries et al . ( 2017 ) ; Perez et al . ( 2018 ) introduced Conditional Batch Normalization ( CBN ) as a method for language-vision tasks . Instead of setting γc and βc in Equation 1 directly , CBN defines them as learned functions βn , c = βc ( qn ) and γn , c = γc ( qn ) of a conditioning input qn . Note that this results in a different scale and shift for each sample in a mini-batch . Scale ( γn , c ) and shift ( βn , c ) parameters for each convolutional feature are generated and applied to each feature via an affine transformation . Feature-wise transformations frequently have enough capacity to model complex phenomena in various settings ( Dumoulin et al. , 2018 ) . For instance , they have been successfully applied to neural style transfer ( Dumoulin et al. , 2016 ) and visual question answering ( Perez et al. , 2018 ) . This kind of conditional computation scheme is not tied to the type of normalization used . Wu & He ( 2018 ) recently proposed Group Normalization ( GN ) . GN divides feature maps into groups and normalizes the features within each group . GN only uses the layer dimension , hence its computation is independent of batch size . Ortiz et al . ( 2020 ) proposed Local Context Normalization ( LCN ) to encourage local contrast enhancement by normalizing features based on a spatial window around it and the filters in its group . Recently , Michalski et al . ( 2019 ) showed that Conditional Group Normalization ( CGN ) offer performance similar to CBN . In this work , we show results using CBN and CGN . Conditional normalization methods have been applied to tasks related to generalization , such as few-shot learning ( Jiang et al. , 2018 ; Tseng et al. , 2020 ) and domain adaption ( Su et al. , 2020 ) . Su et al . propose to use conditional normalization and an adversarial loss for domain adaption in object detection . In contrast to this work , we propose a method for implicit conditioning on an auxiliary task to leverage available metadata . 3 FORMULATION AND NETWORK ARCHITECTURE . 3.1 PROBLEM ABSTRACTION . We first establish notation . Let x be an image input , associated with a ground-truth target y for the main task ( e.g . a segmentation mask ) . Let available extra annotation for x be denoted by t. The main network is trained to predict y given x and contextual information from an auxiliary network . The auxiliary network learns to predict t , also given x . Features z of an intermediate layer of the auxiliary network are used to transform the main task network ’ s layers using conditional normalization parameterized by a learned function of z . The motivation for this method of implicit conditioning is the following : 1 . Since t ’ s are only used as training targets , auxiliary annotation is not required at test time . 2 . During training , the auxiliary network learns ( via backpropagation ) to visually capture in- formation predictive of t. At test time , the auxiliary network reasons about the unavailable t in terms of visual patterns that correlate with auxiliary annotations of training data . Note that this allows the distribution of auxiliary information at test time to differ from the training data ( see for example our experiments on out-of-distribution generalization in remote sensing in Section 4.1 ) . While the first statement is true for any multi-task architecture , the second statement describes the flexibility of the proposed method in leveraging auxiliary information of varying degrees of relevance . Obviously , the modulation will help most , if the auxiliary information is maximally relevant for the main task . Since the mapping from z to the modulation parameters is trained with the main task ’ s training signal , the network can learn to discard components of z that are not useful for the main task . It is also possible for the network to learn a constant identity transformation of the main network ’ s features in case no correlation is found . This reduces the potential of negative transfer learning between unrelated tasks common in multi-task learning ( Ruder , 2017 ) . To provide an example of how this method can help to exploit inexpensive metadata . Consider the task of segmenting satellite imagery of different regions on the globe . We can use the prediction of geographic coordinates , which are often logged by default when building satellite imagery datasets , as the auxiliary task . In this case , the auxiliary network may learn to capture visual characteristics that are distinctive for each region in the training set , such as a predominance for smaller buildings . This would provide a useful inductive bias for the segmentation network , even for regions with very different coordinates . By using feature modulation to integrate this contextual information , we hypothesize that the main network can learn more general purpose features , which can be attended to based on the context . 3.2 NETWORK ARCHITECTURE . Our proposed architecture modification transforms any standard neural network with normalization layers into one that incorporates conditioning information t. In each convolutional block of the neural network we substitute the normalization layer by it ’ s conditional counterpart . We refer to this family of networks as Conditional Networks . Figure 3 shows this extension applied to the popular U-Net Ronneberger et al . ( 2015 ) architecture . U-Net is an encoder-decoder network architecture with skip connections . Figure 3 shows the auxiliary network on the left modulating the modified U-Net on the right . The conditioning network is a convolutional architecture ( LeCun et al. , 1998 ) followed by a fully-connected layer that predicts metadata tn as a function of the input image xn . The pre-activation features before the output layer are used as z ( xn ) . The functions βn , c ( z ( xn ) ) and γn , c ( z ( xn ) ) mapping z ( xn ) to the scale and shift parameters are implemented with a multi- layer perceptron ( MLP ) . Using the latent representations instead of directly using tn allows us to leverage combinations of features that were useful in localizing images from previously seen data , potentially improving generalization . Because all its parts are differentiable , conditional networks can be trained end-to-end using gradient-based optimization . Our full objective is described in Equation 2 , where α is a hyperparameter balancing the main and auxiliary losses . Lmain task represents a standard main task loss . Lmain task depends on the task , such as Jaccard , cross-entropy , and dice for semantic segmentation . Lconditioning ensures the conditioning networks correctly predicts tn . Lcond . net = Lmain task + α · Lconditioning ( 2 )
This submission proposes an approach to modulate activations of general convolutional neural networks by means of an auxiliary network trained on additional metadata to a dataset. The specific goal is to improve out-of-distribution (OOD) generalisation. This *conditional network* approach is illustrated for two standard convolutional neural network (CNN) architectures, U-Net and VGG, on two benchmark datasets suitable for OOD detection, the Inria Aerial Image Labeling Dataset and the Tumor Infiltrating Lymphocytes classification dataset. The conditional network approach yields favourable results compared to competing segmentation as well as classification networks and exhibits a reduction of the generalisation gap compared to the baseline methods.
SP:beaf78b9053a49c23e984589327f48513f1d4277
Conditional Networks
1 INTRODUCTION . Deep learning has achieved great success in many core artificial intelligence ( AI ) tasks ( Hinton et al. , 2012 ; Krizhevsky et al. , 2012 ; Brown et al. , 2020 ) over the past decade . This is often attributed to better computational resources ( Brock et al. , 2018 ) and large-scale datasets ( Deng et al. , 2009 ) . Collecting and annotating datasets which represent a sufficient diversity of real-world test scenarios for every task or domain is extremely expensive and time-consuming . Hence , sufficient training data may not always be available . Due to many factors of variation ( e.g. , weather , season , daytime , illumination , view angle , sensor , and image quality ) , there is often a distributional change or domain shift that can degrade performance in real-world applications ( Shimodaira , 2000 ; Wang & Schneider , 2014 ; Chung et al. , 2018 ) . Applications in remote sensing , medical imaging , and Earth observation commonly suffer from distributional shifts resulting from atmospheric changes , seasonality , weather , use of different scanning sensors , different calibration and other variations which translate to unexpected behavior at test time ( Zhu et al. , 2017 ; Robinson et al. , 2019 ; Ortiz et al. , 2018 ) . In this work , we present a novel neural network architecture to increase robustness to distributional changes ( See Figure 1 ) . Our framework combines conditional computation ( Dumoulin et al. , 2018 ; 2016 ; De Vries et al. , 2017 ; Perez et al. , 2018 ) with a task specific neural architecture for better domain shift generalization . One key feature of this architecture is the ability to exploit extra information , often available but seldom used by current models , through a conditioning network . This results in models with better generalization , better performance in both independent and identically distributed ( i.i.d . ) and non- i.i.d . settings , and in some cases faster convergence . We demonstrate these methodological innovations on an aerial building segmentation task , where test images are from different geographic areas than the ones seen during training ( Maggiori et al. , 2017 ) and on the task of Tumor Infiltrating Lymphocytes ( TIL ) classification ( Saltz et al. , 2018 ) . We summarize our main contributions as follows : • We propose a novel architecture to effectively incorporate conditioning information , such as metadata . • We show empirically that our conditional network improves performance in the task of semantic segmentation and image classification . • We study how conditional networks improve generalization in the presence of distributional shift . 2 BACKGROUND AND RELATED WORK . Self-supervised learning . Self-supervised learning extracts and uses available relevant context and embedded metadata as supervisory signals . It is a representation learning approach that exploits a variety of labels that come with the data for free . To leverage large amounts of unlabeled data , it is possible to set the learning objectives such that supervision is generated from the data itself . The selfsupervised task , also known as pretext task , guides us to a supervised loss function ( Gidaris et al. , 2018 ; Oord et al. , 2018 ; He et al. , 2019 ; Chen et al. , 2020 ) . However , in self-supervised learning we usually do not emphasize performance on this auxiliary task . Rather we focus on the learned intermediate representation with the expectation that this representation can carry good semantic or structural meanings and can be beneficial to a variety of practical downstream tasks . Conditional networks can be seen as a self-supervision approach in which the pretext task is jointly learned with the downstream task . Our proposed modulation of a network architecture based on an auxiliary network ’ s intermediate representation can also be seen as an instance of knowledge transfer ( Hinton et al. , 2015 ; Urban et al. , 2016 ; Buciluǎ et al. , 2006 ) . Because the auxiliary network has an additional task signal – metadata prediction – information about this task can be transferred to the main task network . Conditional Computation . Ioffe and Szegedy designed Batch Normalization ( BN ) as a technique to accelerate the training of deep neural networks ( Ioffe & Szegedy , 2015 ) . BN normalizes a given mini-batch B = { Fn , . , . , . } Nn=1 of N feature maps Fn , . , . , . as described by the following Equation : BN ( Fn , c , h , w|γc , βc ) = γc Fn , c , h , w − EB [ F. , c , . , . ] √ VarB [ F. , c , . , . ] + + βc , ( 1 ) where c , h and w are indexing the channel , height and width axis , respectively , γc and βc are trainable scale and shift parameters , introduced to keep the representational power of the original network , and is a constant factor for numerical stability . For convolutional layers the mean and variance are computed over both the batch and spatial dimensions , implying that each location in the feature map is normalized in the same way . De Vries et al . ( 2017 ) ; Perez et al . ( 2018 ) introduced Conditional Batch Normalization ( CBN ) as a method for language-vision tasks . Instead of setting γc and βc in Equation 1 directly , CBN defines them as learned functions βn , c = βc ( qn ) and γn , c = γc ( qn ) of a conditioning input qn . Note that this results in a different scale and shift for each sample in a mini-batch . Scale ( γn , c ) and shift ( βn , c ) parameters for each convolutional feature are generated and applied to each feature via an affine transformation . Feature-wise transformations frequently have enough capacity to model complex phenomena in various settings ( Dumoulin et al. , 2018 ) . For instance , they have been successfully applied to neural style transfer ( Dumoulin et al. , 2016 ) and visual question answering ( Perez et al. , 2018 ) . This kind of conditional computation scheme is not tied to the type of normalization used . Wu & He ( 2018 ) recently proposed Group Normalization ( GN ) . GN divides feature maps into groups and normalizes the features within each group . GN only uses the layer dimension , hence its computation is independent of batch size . Ortiz et al . ( 2020 ) proposed Local Context Normalization ( LCN ) to encourage local contrast enhancement by normalizing features based on a spatial window around it and the filters in its group . Recently , Michalski et al . ( 2019 ) showed that Conditional Group Normalization ( CGN ) offer performance similar to CBN . In this work , we show results using CBN and CGN . Conditional normalization methods have been applied to tasks related to generalization , such as few-shot learning ( Jiang et al. , 2018 ; Tseng et al. , 2020 ) and domain adaption ( Su et al. , 2020 ) . Su et al . propose to use conditional normalization and an adversarial loss for domain adaption in object detection . In contrast to this work , we propose a method for implicit conditioning on an auxiliary task to leverage available metadata . 3 FORMULATION AND NETWORK ARCHITECTURE . 3.1 PROBLEM ABSTRACTION . We first establish notation . Let x be an image input , associated with a ground-truth target y for the main task ( e.g . a segmentation mask ) . Let available extra annotation for x be denoted by t. The main network is trained to predict y given x and contextual information from an auxiliary network . The auxiliary network learns to predict t , also given x . Features z of an intermediate layer of the auxiliary network are used to transform the main task network ’ s layers using conditional normalization parameterized by a learned function of z . The motivation for this method of implicit conditioning is the following : 1 . Since t ’ s are only used as training targets , auxiliary annotation is not required at test time . 2 . During training , the auxiliary network learns ( via backpropagation ) to visually capture in- formation predictive of t. At test time , the auxiliary network reasons about the unavailable t in terms of visual patterns that correlate with auxiliary annotations of training data . Note that this allows the distribution of auxiliary information at test time to differ from the training data ( see for example our experiments on out-of-distribution generalization in remote sensing in Section 4.1 ) . While the first statement is true for any multi-task architecture , the second statement describes the flexibility of the proposed method in leveraging auxiliary information of varying degrees of relevance . Obviously , the modulation will help most , if the auxiliary information is maximally relevant for the main task . Since the mapping from z to the modulation parameters is trained with the main task ’ s training signal , the network can learn to discard components of z that are not useful for the main task . It is also possible for the network to learn a constant identity transformation of the main network ’ s features in case no correlation is found . This reduces the potential of negative transfer learning between unrelated tasks common in multi-task learning ( Ruder , 2017 ) . To provide an example of how this method can help to exploit inexpensive metadata . Consider the task of segmenting satellite imagery of different regions on the globe . We can use the prediction of geographic coordinates , which are often logged by default when building satellite imagery datasets , as the auxiliary task . In this case , the auxiliary network may learn to capture visual characteristics that are distinctive for each region in the training set , such as a predominance for smaller buildings . This would provide a useful inductive bias for the segmentation network , even for regions with very different coordinates . By using feature modulation to integrate this contextual information , we hypothesize that the main network can learn more general purpose features , which can be attended to based on the context . 3.2 NETWORK ARCHITECTURE . Our proposed architecture modification transforms any standard neural network with normalization layers into one that incorporates conditioning information t. In each convolutional block of the neural network we substitute the normalization layer by it ’ s conditional counterpart . We refer to this family of networks as Conditional Networks . Figure 3 shows this extension applied to the popular U-Net Ronneberger et al . ( 2015 ) architecture . U-Net is an encoder-decoder network architecture with skip connections . Figure 3 shows the auxiliary network on the left modulating the modified U-Net on the right . The conditioning network is a convolutional architecture ( LeCun et al. , 1998 ) followed by a fully-connected layer that predicts metadata tn as a function of the input image xn . The pre-activation features before the output layer are used as z ( xn ) . The functions βn , c ( z ( xn ) ) and γn , c ( z ( xn ) ) mapping z ( xn ) to the scale and shift parameters are implemented with a multi- layer perceptron ( MLP ) . Using the latent representations instead of directly using tn allows us to leverage combinations of features that were useful in localizing images from previously seen data , potentially improving generalization . Because all its parts are differentiable , conditional networks can be trained end-to-end using gradient-based optimization . Our full objective is described in Equation 2 , where α is a hyperparameter balancing the main and auxiliary losses . Lmain task represents a standard main task loss . Lmain task depends on the task , such as Jaccard , cross-entropy , and dice for semantic segmentation . Lconditioning ensures the conditioning networks correctly predicts tn . Lcond . net = Lmain task + α · Lconditioning ( 2 )
This paper aims to tackle the out-of-distribution generalization problem where a model needs to generalize to new distributions at test time. The authors propose to utilize some extra information like the additional annotations as the conditional input and output the affine transformation parameters for the batch normalization stage. This extra information helps the backbone network get a more general representation from the training set thus the model is robust to the distribution shift when testing. Experiments are conducted on the Aerial Image Labeling and the Tumor-Infiltrating Lymphocytes datasets which correspond to the image segmentation and classification task respectively.
SP:beaf78b9053a49c23e984589327f48513f1d4277
Sself: Robust Federated Learning against Stragglers and Adversaries
1 INTRODUCTION . Large volumes of data collected at various edge devices ( i.e. , smart phones ) are valuable resources in training machine learning models with a good accuracy . Federated learning ( McMahan et al. , 2017 ; Li et al. , 2019a ; b ; Konečnỳ et al. , 2016 ) is a promising direction for large-scale learning , which enables training of a shared global model with less privacy concerns . However , current federated learning systems suffer from two major issues . First is the devices called stragglers that are considerably slower than the average , and the second is the adversaries that enforce various adversarial attacks . Regarding the first issue , waiting for all the stragglers at each global round can significantly slow down the overall training process in a synchronous setup . To address this , an asynchronous federated learning scheme was proposed in ( Xie et al. , 2019a ) where the global model is updated every time the server receives a local model from each device , in the order of arrivals ; the global model is updated asynchronously based on the device ’ s staleness t− τ , the difference between the current round t and the previous round τ at which the device received the global model from the server . However , among the received results at each global round , a significant portion of the results with large staleness does not help the global model in a meaningful way , potentially making the scheme ineffective . Moreover , since the model update is performed one-by-one asynchronously , the scheme in ( Xie et al. , 2019a ) would be vulnerable to various adversarial attacks ; any attempt to combine this type of asynchronous scheme with existing adversary-resilient ideas would not likely be fruitful . There are different forms of adversarial attacks that significantly degrade the performance of current federated learning systems . First , in untargeted attacks , an attacker can poison the updated model at the devices before it is sent to the server ( model update poisoning ) ( Blanchard et al. , 2017 ; Lamport et al. , 2019 ) or can poison the datasets of each device ( data poisoning ) ( Biggio et al. , 2012 ; Liu et al. , 2017 ) , which degrades the accuracy of the model . In targeted attacks ( or backdoor attacks ) ( Chen et al. , 2017a ; Bagdasaryan et al. , 2018 ; Sun et al. , 2019 ) , the adversaries cause the model to misclassify the targeted subtasks only , while not degrading the overall test accuracy . To resolve these issues , a robust federated averaging ( RFA ) scheme was recently proposed in ( Pillutla et al. , 2019 ) which utilizes the geometric median of the received results for aggregation . However , RFA tends to lose performance rapidly as the portion of adversaries exceeds a certain threshold . In this sense , RFA is not an ideal candidate to be combined with known straggler-mitigating strategies ( e.g. , ignoring stragglers ) where a relatively small number of devices are utilized for global aggregation ; the attack ratio can be very high , significantly degrading the performance . To our knowledge , there are currently no existing methods or known combinations of ideas that can effectively handle both stragglers and adversaries at the same time , an issue that is becoming increasingly important in practical scenarios . Contributions . In this paper , we propose Sself , semi-synchronous entropy and loss based filtering/averaging , a robust federated learning strategy which can tackle both stragglers and adversaries simultaneously . In the proposed idea , the straggler effects are mitigated by semi-synchronous global aggregation at the server , and in each aggregation step , the impact of adversaries are countered by a new aggregation method utilizing public data collected at the server . The details of our key ideas are as follows . Targeting the straggler issue , our strategy is to perform periodic global aggregation while allowing the results sent from stragglers to be aggregated in later rounds . The key strategy is a judicious mix of both synchronous and asynchronous approaches . At each round , as a first step , we aggregate the results that come from the same initial models ( i.e. , same staleness ) , as in the synchronous scheme . Then , we take the weighted sum of these aggregated results with different staleness , i.e. , coming from different initial models , as in the asynchronous approach . Regarding the adversarial attacks , robust aggregation is realized via entropy-based filtering and loss-weighted averaging . This can be employed at the first step of our semi-synchronous strategy described above , enabling protection against model/data poisoning and backdoor attacks . To this end , our key idea is to utilize public IID ( independent , identically distributed ) data collected at the server . We can imagine a practical scenario where the server has some global data uniformly distributed over classes , as in the setup of ( Zhao et al. , 2018 ) . This is generally a reasonable setup since data centers mostly have some collected data ( although they can be only a few ) of the learning task . For example , different types of medical data are often open to public in various countries . Based on the public data , the server computes entropy and loss of each received model . We use the entropy of each model to filter out the devices whose models are poisoned . In addition , by taking the loss-weighted averaging of the survived models , we can protect the system against local data poisoning and backdoor attacks . We derive a theoretical bound for Sself to ensure acceptable convergence behavior . Experimental results on different datasets show that Sself outperforms various combinations of straggler/adversary defense methods with only a small portion of public data at the server . Related works . The authors of ( Li et al. , 2019c ; Wu et al. , 2019 ; Xie et al. , 2019a ) have recently tackled the straggler issue in a federated learning setup . The basic idea is to allow the devices and the server to update the models asynchronously . Especially in ( Xie et al. , 2019a ) , the authors proposed an asynchronous scheme where the global model is updated every time the server receives a local model of each device . However , a fair portion of the received models with large staleness does not help the global model in meaningful ways , potentially slowing down the convergence speed . A more critical issue here is that robust methods designed to handle adversarial attacks , such as RFA ( Pillutla et al. , 2019 ) , Multi-Krum ( Blanchard et al. , 2017 ) or the presently proposed entropy/loss based idea , are hard to be implemented in conjunction with this asynchronous scheme . To combat adversaries , various aggregation methods have been proposed in a distributed learning setup with IID data across nodes ( Yin et al. , 2018a ; b ; Chen et al. , 2017b ; Blanchard et al. , 2017 ; Xie et al. , 2018 ) . The authors of ( Chen et al. , 2017b ) suggests a geometric median based aggregation rule of the received models or the gradients . In ( Yin et al. , 2018a ) , a trimmed mean approach is proposed which removes a fraction of largest and smallest values of each element among the received results . In Multi-Krum ( Blanchard et al. , 2017 ) , among N workers in the system , the server tolerates f Byzantine workers under the assumption of 2f + 2 < N . Targeting federated learning with non-IID data , the recently introduced RFA method of ( Pillutla et al. , 2019 ) utilizes the geometric median of models sent from devices , similar to ( Chen et al. , 2017b ) . However , as mentioned above , these methods are ineffective when combined with a straggler-mitigation scheme , potentially degrading the performance of learning . Compared to Multi-Krum and RFA , our entropy/loss based scheme can tolerate adversaries even with a high attack ratio , showing remarkable advantages , especially when combined with straggler-mitigation schemes . Finally , we note that the authors of ( Xie et al. , 2019c ) considered both stragglers and adversaries but in a distributed learning setup with IID data across the nodes . Compared to these works , we target non-IID data distribution setup in a federated learning scenario . 2 PROPOSED FEDERATED LEARNING WITH SSELF . We consider the following federated optimization problem : w∗ = argmin w F ( w ) = argmin w N∑ k=1 mk m Fk ( w ) , ( 1 ) whereN is the number of devices , mk is the number of data samples in device k , andm = ∑N k=1mk is the total number of data samples of all N devices in the system . By letting xk , j be the jth data sample in device k , the local loss function of device k , Fk ( w ) , is written as Fk ( w ) = 1 mk ∑mk j=1 ` ( w ; xk , j ) . In the following , we provide solutions aiming to solve the above problem under the existence of stragglers ( subsection 2.1 ) and adversaries ( subsection 2.2 ) , and finally propose Sself handling both issues ( subsection 2.3 ) . 2.1 SEMI-SYNCHRONOUS SCHEME AGAINST STRAGGLERS . In the t-th global round , the server sends the current model wt to K devices in St ( |St| = K ≤ N ) , which is a set of indices randomly selected from N devices in the system . We let C = K/N be the ratio of devices that participate at each global round . Each device in St performs E local updates with its own data and sends the updated model back to the server . In conventional federated averaging ( FedAvg ) , the server waits until the results of allK devices in St arrive and then performs aggregation to obtain wt+1 = ∑ k∈St mk∑ k∈St mk wt ( k ) , where wt ( k ) is the model after E local updates at device k starting from wt . However , due to the effect of stragglers , waiting for all K devices at the server can significantly slow down the overall training process . In resolving this issue , our idea assumes periodic global aggregation at the server . At each global round t , the server transmits the current model/round ( wt , t ) to the devices in St . Instead of waiting for all devices in St , the server aggregates the models that arrive until a fixed time deadline Td to obtain wt+1 , and moves on to the next global round t+ 1 . Hence , model aggregation is performed periodically with every Td . A key feature here is that we do not ignore the results sent from stragglers ( not arrived by the deadline Td ) . These results are utilized at the next global aggregation step , or even later , depending on the delay or staleness . Let U ( t ) i be the set of devices 1 ) that are selected from the server at global round t , i.e. , U ( t ) i ⊆ St and 2 ) that successfully sent their results to the server at global round i for i ≥ t. Then , we can write St = ∪∞i=tU ( t ) i , where U ( t ) i ∩ U ( t ) j = ∅ for i 6= j . Here , U ( t ) ∞ can be viewed as the devices that are selected at round t but failed to successfully send their results back to the server . According to these notations , the devices whose training results arrive at the server during global round t belong to one of the following t+ 1 sets : U ( 0 ) t , U ( 1 ) t , ... , U ( t ) t . Note that the result sent from device k ∈ U ( i ) t is the model after E local updates starting from wi , and we denote this model by wi ( k ) . At each round t , we first perform FedAvg as v ( i ) t+1 = ∑ k∈U ( i ) t mk∑ k∈U ( i ) t mk wi ( k ) ( 2 ) for all i = 0 , 1 , ... , t , where v ( i ) t+1 is the aggregated result of locally updated models ( starting from wi ) received at round t with staleness t− i+ 1 . Then from v ( 0 ) t+1 , v ( 1 ) t+1 , ... , v ( t ) t+1 , we take the weighted averaging of results with different staleness to obtain ∑t i=0 αt ( i ) v ( i ) t+1 . Here , αt ( i ) ∝ ∑ k∈U ( i ) t mk ( t−i+1 ) c is a normalized coefficient that is proportional to the number of data samples in U ( i ) t and inversely proportional to ( t− i+ 1 ) c , for a given hyperparameter c ≥ 0 . Hence , we have a larger weight for v ( i ) t+1 with a smaller t− i+ 1 ( staleness ) . This is to give more weights to more recent results . Based on the weighted sum ∑t i=0 αt ( i ) v ( i ) t+1 , we finally obtain wt+1 as wt+1 = ( 1− γ ) wt + γ t∑ i=0 αt ( i ) v ( i ) t+1 , ( 3 ) where γ combines the aggregated result with the latest global model wt . Now we move on to the next round t + 1 , where the server selects St+1 and sends ( wt+1 , t+ 1 ) to these devices . Here , if the server knows the set of active devices ( which are still performing computation ) , St+1 can be 𝒰 𝒰 Received at global round t-1 Received at global round t … constructed to be disjoint with the active devices . If not , the server randomly chooses St+1 among all devices in the system and the selected active devices can ignore the current request of the server . The left-hand side of Fig . 1 describes our semi-synchronous scheme . The key characteristics of our scheme can be summarized as follows . First , by periodic global aggregation at the server , our scheme is not delayed by the effect of stragglers . Secondly , our scheme fully utilizes the results s nt from stragglers in the future global rounds ; we first perform federated averaging for the devices with same staleness ( as in the synchronous scheme ) , and then take the weighted sum of these averaged results with different staleness ( as in the asynchronous scheme ) .
This paper considers federated learning with straggling and adversarial devices. To tackle stragglers, the paper proposes semi-synchronous averaging wherein models with the same staleness are first averaged together, and then a weighted average of the results with different stateless is computed. To mitigate adversaries, the paper proposes to first perform entropy-based filtering to remove suspected outliers, and then compute loss-weighted average. The server is assumed to have some public data, which is used for entropy-based filtering. Together, the proposed algorithm is called semi-synchronous entropy and loss based filtering (Sself).
SP:03a7c25f464f8e293bf300d897342f5f82a51f28
Sself: Robust Federated Learning against Stragglers and Adversaries
1 INTRODUCTION . Large volumes of data collected at various edge devices ( i.e. , smart phones ) are valuable resources in training machine learning models with a good accuracy . Federated learning ( McMahan et al. , 2017 ; Li et al. , 2019a ; b ; Konečnỳ et al. , 2016 ) is a promising direction for large-scale learning , which enables training of a shared global model with less privacy concerns . However , current federated learning systems suffer from two major issues . First is the devices called stragglers that are considerably slower than the average , and the second is the adversaries that enforce various adversarial attacks . Regarding the first issue , waiting for all the stragglers at each global round can significantly slow down the overall training process in a synchronous setup . To address this , an asynchronous federated learning scheme was proposed in ( Xie et al. , 2019a ) where the global model is updated every time the server receives a local model from each device , in the order of arrivals ; the global model is updated asynchronously based on the device ’ s staleness t− τ , the difference between the current round t and the previous round τ at which the device received the global model from the server . However , among the received results at each global round , a significant portion of the results with large staleness does not help the global model in a meaningful way , potentially making the scheme ineffective . Moreover , since the model update is performed one-by-one asynchronously , the scheme in ( Xie et al. , 2019a ) would be vulnerable to various adversarial attacks ; any attempt to combine this type of asynchronous scheme with existing adversary-resilient ideas would not likely be fruitful . There are different forms of adversarial attacks that significantly degrade the performance of current federated learning systems . First , in untargeted attacks , an attacker can poison the updated model at the devices before it is sent to the server ( model update poisoning ) ( Blanchard et al. , 2017 ; Lamport et al. , 2019 ) or can poison the datasets of each device ( data poisoning ) ( Biggio et al. , 2012 ; Liu et al. , 2017 ) , which degrades the accuracy of the model . In targeted attacks ( or backdoor attacks ) ( Chen et al. , 2017a ; Bagdasaryan et al. , 2018 ; Sun et al. , 2019 ) , the adversaries cause the model to misclassify the targeted subtasks only , while not degrading the overall test accuracy . To resolve these issues , a robust federated averaging ( RFA ) scheme was recently proposed in ( Pillutla et al. , 2019 ) which utilizes the geometric median of the received results for aggregation . However , RFA tends to lose performance rapidly as the portion of adversaries exceeds a certain threshold . In this sense , RFA is not an ideal candidate to be combined with known straggler-mitigating strategies ( e.g. , ignoring stragglers ) where a relatively small number of devices are utilized for global aggregation ; the attack ratio can be very high , significantly degrading the performance . To our knowledge , there are currently no existing methods or known combinations of ideas that can effectively handle both stragglers and adversaries at the same time , an issue that is becoming increasingly important in practical scenarios . Contributions . In this paper , we propose Sself , semi-synchronous entropy and loss based filtering/averaging , a robust federated learning strategy which can tackle both stragglers and adversaries simultaneously . In the proposed idea , the straggler effects are mitigated by semi-synchronous global aggregation at the server , and in each aggregation step , the impact of adversaries are countered by a new aggregation method utilizing public data collected at the server . The details of our key ideas are as follows . Targeting the straggler issue , our strategy is to perform periodic global aggregation while allowing the results sent from stragglers to be aggregated in later rounds . The key strategy is a judicious mix of both synchronous and asynchronous approaches . At each round , as a first step , we aggregate the results that come from the same initial models ( i.e. , same staleness ) , as in the synchronous scheme . Then , we take the weighted sum of these aggregated results with different staleness , i.e. , coming from different initial models , as in the asynchronous approach . Regarding the adversarial attacks , robust aggregation is realized via entropy-based filtering and loss-weighted averaging . This can be employed at the first step of our semi-synchronous strategy described above , enabling protection against model/data poisoning and backdoor attacks . To this end , our key idea is to utilize public IID ( independent , identically distributed ) data collected at the server . We can imagine a practical scenario where the server has some global data uniformly distributed over classes , as in the setup of ( Zhao et al. , 2018 ) . This is generally a reasonable setup since data centers mostly have some collected data ( although they can be only a few ) of the learning task . For example , different types of medical data are often open to public in various countries . Based on the public data , the server computes entropy and loss of each received model . We use the entropy of each model to filter out the devices whose models are poisoned . In addition , by taking the loss-weighted averaging of the survived models , we can protect the system against local data poisoning and backdoor attacks . We derive a theoretical bound for Sself to ensure acceptable convergence behavior . Experimental results on different datasets show that Sself outperforms various combinations of straggler/adversary defense methods with only a small portion of public data at the server . Related works . The authors of ( Li et al. , 2019c ; Wu et al. , 2019 ; Xie et al. , 2019a ) have recently tackled the straggler issue in a federated learning setup . The basic idea is to allow the devices and the server to update the models asynchronously . Especially in ( Xie et al. , 2019a ) , the authors proposed an asynchronous scheme where the global model is updated every time the server receives a local model of each device . However , a fair portion of the received models with large staleness does not help the global model in meaningful ways , potentially slowing down the convergence speed . A more critical issue here is that robust methods designed to handle adversarial attacks , such as RFA ( Pillutla et al. , 2019 ) , Multi-Krum ( Blanchard et al. , 2017 ) or the presently proposed entropy/loss based idea , are hard to be implemented in conjunction with this asynchronous scheme . To combat adversaries , various aggregation methods have been proposed in a distributed learning setup with IID data across nodes ( Yin et al. , 2018a ; b ; Chen et al. , 2017b ; Blanchard et al. , 2017 ; Xie et al. , 2018 ) . The authors of ( Chen et al. , 2017b ) suggests a geometric median based aggregation rule of the received models or the gradients . In ( Yin et al. , 2018a ) , a trimmed mean approach is proposed which removes a fraction of largest and smallest values of each element among the received results . In Multi-Krum ( Blanchard et al. , 2017 ) , among N workers in the system , the server tolerates f Byzantine workers under the assumption of 2f + 2 < N . Targeting federated learning with non-IID data , the recently introduced RFA method of ( Pillutla et al. , 2019 ) utilizes the geometric median of models sent from devices , similar to ( Chen et al. , 2017b ) . However , as mentioned above , these methods are ineffective when combined with a straggler-mitigation scheme , potentially degrading the performance of learning . Compared to Multi-Krum and RFA , our entropy/loss based scheme can tolerate adversaries even with a high attack ratio , showing remarkable advantages , especially when combined with straggler-mitigation schemes . Finally , we note that the authors of ( Xie et al. , 2019c ) considered both stragglers and adversaries but in a distributed learning setup with IID data across the nodes . Compared to these works , we target non-IID data distribution setup in a federated learning scenario . 2 PROPOSED FEDERATED LEARNING WITH SSELF . We consider the following federated optimization problem : w∗ = argmin w F ( w ) = argmin w N∑ k=1 mk m Fk ( w ) , ( 1 ) whereN is the number of devices , mk is the number of data samples in device k , andm = ∑N k=1mk is the total number of data samples of all N devices in the system . By letting xk , j be the jth data sample in device k , the local loss function of device k , Fk ( w ) , is written as Fk ( w ) = 1 mk ∑mk j=1 ` ( w ; xk , j ) . In the following , we provide solutions aiming to solve the above problem under the existence of stragglers ( subsection 2.1 ) and adversaries ( subsection 2.2 ) , and finally propose Sself handling both issues ( subsection 2.3 ) . 2.1 SEMI-SYNCHRONOUS SCHEME AGAINST STRAGGLERS . In the t-th global round , the server sends the current model wt to K devices in St ( |St| = K ≤ N ) , which is a set of indices randomly selected from N devices in the system . We let C = K/N be the ratio of devices that participate at each global round . Each device in St performs E local updates with its own data and sends the updated model back to the server . In conventional federated averaging ( FedAvg ) , the server waits until the results of allK devices in St arrive and then performs aggregation to obtain wt+1 = ∑ k∈St mk∑ k∈St mk wt ( k ) , where wt ( k ) is the model after E local updates at device k starting from wt . However , due to the effect of stragglers , waiting for all K devices at the server can significantly slow down the overall training process . In resolving this issue , our idea assumes periodic global aggregation at the server . At each global round t , the server transmits the current model/round ( wt , t ) to the devices in St . Instead of waiting for all devices in St , the server aggregates the models that arrive until a fixed time deadline Td to obtain wt+1 , and moves on to the next global round t+ 1 . Hence , model aggregation is performed periodically with every Td . A key feature here is that we do not ignore the results sent from stragglers ( not arrived by the deadline Td ) . These results are utilized at the next global aggregation step , or even later , depending on the delay or staleness . Let U ( t ) i be the set of devices 1 ) that are selected from the server at global round t , i.e. , U ( t ) i ⊆ St and 2 ) that successfully sent their results to the server at global round i for i ≥ t. Then , we can write St = ∪∞i=tU ( t ) i , where U ( t ) i ∩ U ( t ) j = ∅ for i 6= j . Here , U ( t ) ∞ can be viewed as the devices that are selected at round t but failed to successfully send their results back to the server . According to these notations , the devices whose training results arrive at the server during global round t belong to one of the following t+ 1 sets : U ( 0 ) t , U ( 1 ) t , ... , U ( t ) t . Note that the result sent from device k ∈ U ( i ) t is the model after E local updates starting from wi , and we denote this model by wi ( k ) . At each round t , we first perform FedAvg as v ( i ) t+1 = ∑ k∈U ( i ) t mk∑ k∈U ( i ) t mk wi ( k ) ( 2 ) for all i = 0 , 1 , ... , t , where v ( i ) t+1 is the aggregated result of locally updated models ( starting from wi ) received at round t with staleness t− i+ 1 . Then from v ( 0 ) t+1 , v ( 1 ) t+1 , ... , v ( t ) t+1 , we take the weighted averaging of results with different staleness to obtain ∑t i=0 αt ( i ) v ( i ) t+1 . Here , αt ( i ) ∝ ∑ k∈U ( i ) t mk ( t−i+1 ) c is a normalized coefficient that is proportional to the number of data samples in U ( i ) t and inversely proportional to ( t− i+ 1 ) c , for a given hyperparameter c ≥ 0 . Hence , we have a larger weight for v ( i ) t+1 with a smaller t− i+ 1 ( staleness ) . This is to give more weights to more recent results . Based on the weighted sum ∑t i=0 αt ( i ) v ( i ) t+1 , we finally obtain wt+1 as wt+1 = ( 1− γ ) wt + γ t∑ i=0 αt ( i ) v ( i ) t+1 , ( 3 ) where γ combines the aggregated result with the latest global model wt . Now we move on to the next round t + 1 , where the server selects St+1 and sends ( wt+1 , t+ 1 ) to these devices . Here , if the server knows the set of active devices ( which are still performing computation ) , St+1 can be 𝒰 𝒰 Received at global round t-1 Received at global round t … constructed to be disjoint with the active devices . If not , the server randomly chooses St+1 among all devices in the system and the selected active devices can ignore the current request of the server . The left-hand side of Fig . 1 describes our semi-synchronous scheme . The key characteristics of our scheme can be summarized as follows . First , by periodic global aggregation at the server , our scheme is not delayed by the effect of stragglers . Secondly , our scheme fully utilizes the results s nt from stragglers in the future global rounds ; we first perform federated averaging for the devices with same staleness ( as in the synchronous scheme ) , and then take the weighted sum of these averaged results with different staleness ( as in the asynchronous scheme ) .
The paper claims to propose the first algorithm that can handle adversarial machines and stragglers simultaneously in the federated learning setting. To handle stragglers, the paper takes a semi-synchronous approach by taking a weighted sum of gradients depending on staleness. To handle adversarial machines, the algorithm uses an entropy based filtering and a loss based averaging strategy. Note that to handle the adversaries, the algorithm needs a public dataset at the server, using which it can evaluate the entropy and loss scores of each gradient.
SP:03a7c25f464f8e293bf300d897342f5f82a51f28
Run Away From your Teacher: a New Self-Supervised Approach Solving the Puzzle of BYOL
1 INTRODUCTION . Recently the performance gap between self-supervised learning and supervised learning has been narrowed thanks to the development of contrastive learning ( Chen et al. , 2020b ; a ; Tian et al. , 2019 ; Chen et al. , 2020b ; Sohn , 2016 ; Zhuang et al. , 2019 ; He et al. , 2020 ; Oord et al. , 2018 ; Hadsell et al. , 2006 ) . Contrastive learning distinguishes positive pairs of data from the negative . It has been shown that when the representation space is l2-normalized , i.e . a hypersphere , optimizing the contrastive loss is approximately equivalent to optimizing the alignment of positive pairs and the uniformity of the representation distribution at the same time ( Wang & Isola , 2020 ) . This equivalence conforms to our intuitive understanding . One can easily imagine a failed method when we only optimize either of the properties : aligning the positive pairs without uniformity constraint causes representation collapse , mapping different data all to the same point ; scattering the data uniformly in the representation space without aligning similar ones yields no more meaningful representation than random . The proposal of Bootstrap Your Own Latent ( BYOL ) fiercely challenges our consensus that negative samples are necessary to contrastive methods ( Grill et al. , 2020 ) . BYOL trains the model ( online network ) to predict its Mean Teacher ( moving average of the online , refer to Appendix B.2 ) on two augmented views of the same data ( Tarvainen & Valpola , 2017 ) . There is no explicit constraint on uniformity in BYOL , while the expected collapse never happens , what ’ s more , it reaches the SOTA performance on the downstream tasks . Although BYOL has been empirically proven to be an effective self-supervised learning approach , the mechanism that keeps it from collapse remains unrevealed . Without disclosing this mystery , it would be disturbing for us to adapt BYOL to other problems , let alone further improve it . Therefore solving the puzzle of BYOL is an urgent task . In this paper , we explain how BYOL works through another interpretable learning framework which leverages the MT in the exact opposite way . Based on a series of theoretical derivation and empirical approximation , we build a new self-supervised learning framework , Run Away From your Teacher ( RAFT ) , which optimizes two objectives at the same time : ( i ) minimize the representation distance between two samples from a positive pair and ( ii ) maximize the representation distance between the online and its MT . The second objective of RAFT incorporates the MT in a way exactly opposite to BYOL , and it explicitly prevents the representation collapse by encouraging the online to be different from its history ( Figure 2a ) . Moreover , we empirically show that the second objective of RAFT is a more effective and consistent regularizer for the first objective , which makes RAFT more favorable than BYOL . Finally , we solve the puzzle of BYOL by theoretically proving that BYOL is a special form of RAFT when certain conditions and approximation hold . This proof explains why collapse does not happen in BYOL , and also makes the performance of BYOL′ an approximate guarantee of the effectiveness of RAFT . The main body of the paper is organized in the same order of how we explore the properties of BYOL and establish RAFT based on them ( refer to Appendix A for more details ) . In section 3 , we investigate the phenomenon that BYOL fails to work when the predictor is removed . In section 4 , we establish two meaningful objectives out of BYOL by upper bounding . Based on that , we propose RAFT due to its stronger regularization effect and its accordance with our knowledge . In section 5 , we prove that , as a representation learning framework , BYOL is a special form of RAFT under certain achievable conditions . In summary , our contributions are listed as follows : • We present a new self-supervised learning framework RAFT that minimizes the alignment and maximizes the distance between the online network and its MT . The motivation of RAFT conforms to our understanding of balancing alignment and uniformity of the representation space , and thus could be easily extended and adapted to future problems . • We equate two seemingly opposite ways of incorporating MT in contrastive methods under certain conditions . By doing so , we unravel the puzzle of how BYOL avoids representation collapse . 2 BACKGROUND AND RELATED WORK . 2.1 TWO METRICS OPTIMIZED IN CONTRASTIVE LEARNING . Optimizing contrastive learning objective has been empirically proven to have positive correlations with the downstream task performance ( Chen et al. , 2020b ; a ; Tian et al. , 2019 ; Chen et al. , 2020b ; Sohn , 2016 ; Zhuang et al. , 2019 ; He et al. , 2020 ; Oord et al. , 2018 ) . Wang & Isola ( 2020 ) puts the contrastive learning under the context of hypersphere and formally showcases that optimizing the contrastive loss ( for preliminary of contrastive learning , refer to Appendix B.1 ) is equivalent to optimizing two metrics of the encoder network when the size of negative samplesK is sufficiently large : the alignment of the two augmented views of the same data and the uniformity of the representation population . We introduce the alignment objective and uniformity objective as follows . Definition 2.1 ( Alignment loss ) The alignment loss Lalign ( f , Ppos ) of the function f over positivepair distribution Ppos is defined as : Lalign ( f ; Ppos ) , E ( x1 , x2 ) ∼Ppos [ ‖f ( x1 ) − f ( x2 ) ‖22 ] , ( 1 ) where the positive pair ( x1 , x2 ) are two augmented views of the same input data x ∼ X , i.e . ( x1 , x2 ) = ( t1 ( x ) , t2 ( x ) ) and t1 ∼ T1 , t2 ∼ T2 are two augmentations . For the sake of simplicity , we omit Ppos and use Lalign ( f ) in the following content . Definition 2.2 ( Uniformity loss ) The loss of uniformity Luniform ( f ; X ) of the encoder function f over data distribution X is defined as Luniform ( f ; X ) , logE ( x , y ) ∼X 2 [ e−t‖f ( x ) −f ( y ) ‖ 2 2 ] , ( 2 ) where t > 0 is a fixed parameter and is empirically set to t = 2 . To note here , the vectors in the representation space are automatically l2-normalized , i.e . f ( x ) , f ( x ) /‖f ( x ) ‖2 , as we limit the representation space to a hypersphere following Wang & Isola ( 2020 ) and Grill et al . ( 2020 ) and the representation vectors in the following context are also automatically l2-normalized , unless specified otherwise . Wang & Isola ( 2020 ) has empirically demonstrated that the balance of the alignment loss and the uniformity loss is necessary when learning representations through contrastive method . The rationale behind it is straightforward : Lalign provides the motive power that concentrates the similar data , and Luniform prevents it from mapping all the data to the same meaningless point . 2.2 BYOL : BIZARRE ALTERNATIVE OF CONTRASTIVE . A recently proposed self-supervised representation learning algorithm BYOL hugely challenges the common understanding , that the alignment should be balanced by negative samples during the contrastive learning . It establishes two networks , online and target , approaching to each other during training . The online is trained to predict the target ’ s representations and the target is the Exponential Moving Average ( EMA ) of the parameters of the online . The loss of BYOL at every iteration could be written as LBYOL , E ( x , t1 , t2 ) ∼ ( X , T1 , T2 ) [ ∥∥qw ( fθ ( t1 ( x ) ) ) − fξ ( t2 ( x ) ) ∥∥22 ] , ( 3 ) where two vectors in representation space are automatically l2-normalized . fθ is the online encoder network parameterized by θ and qw is the predictor network parameterized by w. x ∼ X is the input sampled from the data distribution X , and t1 ( x ) , t2 ( x ) are two augmented views of x where t1 ∼ T1 , t2 ∼ T2 are two data augmentations . The target network fξ is of the same architecture as fθ and is updated by EMA with τ controlling to what degree the target network preserves its history ξ ← τξ + ( 1− τ ) θ . ( 4 ) From the scheme of BYOL training , it seems like there is no constraint on the uniformity , and thus most frequently asked question about BYOL is how it prevents the representation collapse . Theoretically , we would expect that when the final convergence of the online and target is reached , LBYOL degenerates to Lalign and therefore causes representation collapse , while this speculation never happens in reality . Despite the perfect SOTA performance of BYOL , there is one inconsistency not to be neglected : it fails with representation collapse when the predictor is removed , which means qw ( x ) = x for any given x . This inconsistent behavior of BYOL weakens its reliability and further poses questions on future adaptation of the algorithm . The motivation of understanding and even solving this inconsistency is the start point of this paper . 3 ON-AND-OFF BYOL : FAILURE WITHOUT PREDICTOR . We start by presenting a dissatisfactory property of BYOL : its success heavily relies on the existence of the predictor qw . The experimental setup of this paper is listed in Appendix C. The performance of BYOL original model , whose predictor qw is a two-layer MLP with batch normalization , evaluated on the linear evaluation protocol ( Kolesnikov et al. , 2019 ; Kornblith et al. , 2019 ; Chen et al. , 2020a ; He et al. , 2020 ; Grill et al. , 2020 ) reaches 68.08 ± 0.84 % . When the predictor is removed , the performance degenerates to 20.92±1.29 % , which is even lower than the random baseline ’ s 42.74± 0.41 % . We examine the speculation that the performance drop is caused by the representation collapse both visually ( refer to Appendix F.1 ) and numerically . Inspired by Wang & Isola ( 2020 ) , we use Luniform ( fθ ; X ) to evaluate to what degree the representations are spread on the hypersphere and Lalign ( qw ◦ fθ ) to evaluate how the similar samples are aligned in the representation space . The results in Table 1 show that with the predictor , BYOL optimizes the uniformity of the representation distribution . On the contrary , when taken away the predictor , the alignment of two augmented views is overly optimized and the uniformity of the representation deteriorates ( Figure 4 ) , therefore we conclude the predictor is essential to the collapse prevention in BYOL . One reasonable follow-up explanation on the efficacy of the predictor may consider its specially designed architecture or some good properties brought by the weight initialization , which makes it hard to understand the mechanism behind it . Fortunately , after replacing the current predictor , two-layer MLP with batch normalization ( Ioffe & Szegedy , 2015 ) , with different network architectures and weight initializations , we find that there is no significant change either on linear evaluation protocol or on the model behavior during training ( Table 1 , for detailed training trajectory , refer to Figure 4 ) . We first replace the complex structure with linear mapping qw ( · ) = W ( · ) . This replacement provides a naive solution to representation collapse : W = I , while it never converges to this apparent collapse . Surprisingly enough when we go harsher on this linear predictor by initializing W with the apparent collapse solution I , the model itself seems to have a self-recovering mechanism even though it starts off at a poor position : the loss quickly approaches to 0 and the uniformity deteriorates for 10-20 epochs and suddenly it deflects from the collapse and keeps on the right track . We conduct a theoretical proof that a randomly initialized linear predictor prevents the ( more strict form of ) representation collapse by creating infinite non-trivial solutions when the convergence is achieved ( refer to Appendix I ) , while we fail to correlate the consistently optimized uniformity with the presence of the predictor , which indicates that a deeper rationale needs to be found .
the paper aims to explain the success of BYOL, a recently proposed contrastive method that mysteriously avoids the trivial constant solution without requiring negative samples. The paper proposes a new loss named RAFT. Compared to BYOL, RAFT is more general since it subsumes a variation of BYOL as its special case, and contains a cross-model term to be maximized which regularizes the alignment loss and encourages the online encoder to "run away" from the mean teacher.
SP:a27d66876fcdc3f3871485445e09041a8927b147
Run Away From your Teacher: a New Self-Supervised Approach Solving the Puzzle of BYOL
1 INTRODUCTION . Recently the performance gap between self-supervised learning and supervised learning has been narrowed thanks to the development of contrastive learning ( Chen et al. , 2020b ; a ; Tian et al. , 2019 ; Chen et al. , 2020b ; Sohn , 2016 ; Zhuang et al. , 2019 ; He et al. , 2020 ; Oord et al. , 2018 ; Hadsell et al. , 2006 ) . Contrastive learning distinguishes positive pairs of data from the negative . It has been shown that when the representation space is l2-normalized , i.e . a hypersphere , optimizing the contrastive loss is approximately equivalent to optimizing the alignment of positive pairs and the uniformity of the representation distribution at the same time ( Wang & Isola , 2020 ) . This equivalence conforms to our intuitive understanding . One can easily imagine a failed method when we only optimize either of the properties : aligning the positive pairs without uniformity constraint causes representation collapse , mapping different data all to the same point ; scattering the data uniformly in the representation space without aligning similar ones yields no more meaningful representation than random . The proposal of Bootstrap Your Own Latent ( BYOL ) fiercely challenges our consensus that negative samples are necessary to contrastive methods ( Grill et al. , 2020 ) . BYOL trains the model ( online network ) to predict its Mean Teacher ( moving average of the online , refer to Appendix B.2 ) on two augmented views of the same data ( Tarvainen & Valpola , 2017 ) . There is no explicit constraint on uniformity in BYOL , while the expected collapse never happens , what ’ s more , it reaches the SOTA performance on the downstream tasks . Although BYOL has been empirically proven to be an effective self-supervised learning approach , the mechanism that keeps it from collapse remains unrevealed . Without disclosing this mystery , it would be disturbing for us to adapt BYOL to other problems , let alone further improve it . Therefore solving the puzzle of BYOL is an urgent task . In this paper , we explain how BYOL works through another interpretable learning framework which leverages the MT in the exact opposite way . Based on a series of theoretical derivation and empirical approximation , we build a new self-supervised learning framework , Run Away From your Teacher ( RAFT ) , which optimizes two objectives at the same time : ( i ) minimize the representation distance between two samples from a positive pair and ( ii ) maximize the representation distance between the online and its MT . The second objective of RAFT incorporates the MT in a way exactly opposite to BYOL , and it explicitly prevents the representation collapse by encouraging the online to be different from its history ( Figure 2a ) . Moreover , we empirically show that the second objective of RAFT is a more effective and consistent regularizer for the first objective , which makes RAFT more favorable than BYOL . Finally , we solve the puzzle of BYOL by theoretically proving that BYOL is a special form of RAFT when certain conditions and approximation hold . This proof explains why collapse does not happen in BYOL , and also makes the performance of BYOL′ an approximate guarantee of the effectiveness of RAFT . The main body of the paper is organized in the same order of how we explore the properties of BYOL and establish RAFT based on them ( refer to Appendix A for more details ) . In section 3 , we investigate the phenomenon that BYOL fails to work when the predictor is removed . In section 4 , we establish two meaningful objectives out of BYOL by upper bounding . Based on that , we propose RAFT due to its stronger regularization effect and its accordance with our knowledge . In section 5 , we prove that , as a representation learning framework , BYOL is a special form of RAFT under certain achievable conditions . In summary , our contributions are listed as follows : • We present a new self-supervised learning framework RAFT that minimizes the alignment and maximizes the distance between the online network and its MT . The motivation of RAFT conforms to our understanding of balancing alignment and uniformity of the representation space , and thus could be easily extended and adapted to future problems . • We equate two seemingly opposite ways of incorporating MT in contrastive methods under certain conditions . By doing so , we unravel the puzzle of how BYOL avoids representation collapse . 2 BACKGROUND AND RELATED WORK . 2.1 TWO METRICS OPTIMIZED IN CONTRASTIVE LEARNING . Optimizing contrastive learning objective has been empirically proven to have positive correlations with the downstream task performance ( Chen et al. , 2020b ; a ; Tian et al. , 2019 ; Chen et al. , 2020b ; Sohn , 2016 ; Zhuang et al. , 2019 ; He et al. , 2020 ; Oord et al. , 2018 ) . Wang & Isola ( 2020 ) puts the contrastive learning under the context of hypersphere and formally showcases that optimizing the contrastive loss ( for preliminary of contrastive learning , refer to Appendix B.1 ) is equivalent to optimizing two metrics of the encoder network when the size of negative samplesK is sufficiently large : the alignment of the two augmented views of the same data and the uniformity of the representation population . We introduce the alignment objective and uniformity objective as follows . Definition 2.1 ( Alignment loss ) The alignment loss Lalign ( f , Ppos ) of the function f over positivepair distribution Ppos is defined as : Lalign ( f ; Ppos ) , E ( x1 , x2 ) ∼Ppos [ ‖f ( x1 ) − f ( x2 ) ‖22 ] , ( 1 ) where the positive pair ( x1 , x2 ) are two augmented views of the same input data x ∼ X , i.e . ( x1 , x2 ) = ( t1 ( x ) , t2 ( x ) ) and t1 ∼ T1 , t2 ∼ T2 are two augmentations . For the sake of simplicity , we omit Ppos and use Lalign ( f ) in the following content . Definition 2.2 ( Uniformity loss ) The loss of uniformity Luniform ( f ; X ) of the encoder function f over data distribution X is defined as Luniform ( f ; X ) , logE ( x , y ) ∼X 2 [ e−t‖f ( x ) −f ( y ) ‖ 2 2 ] , ( 2 ) where t > 0 is a fixed parameter and is empirically set to t = 2 . To note here , the vectors in the representation space are automatically l2-normalized , i.e . f ( x ) , f ( x ) /‖f ( x ) ‖2 , as we limit the representation space to a hypersphere following Wang & Isola ( 2020 ) and Grill et al . ( 2020 ) and the representation vectors in the following context are also automatically l2-normalized , unless specified otherwise . Wang & Isola ( 2020 ) has empirically demonstrated that the balance of the alignment loss and the uniformity loss is necessary when learning representations through contrastive method . The rationale behind it is straightforward : Lalign provides the motive power that concentrates the similar data , and Luniform prevents it from mapping all the data to the same meaningless point . 2.2 BYOL : BIZARRE ALTERNATIVE OF CONTRASTIVE . A recently proposed self-supervised representation learning algorithm BYOL hugely challenges the common understanding , that the alignment should be balanced by negative samples during the contrastive learning . It establishes two networks , online and target , approaching to each other during training . The online is trained to predict the target ’ s representations and the target is the Exponential Moving Average ( EMA ) of the parameters of the online . The loss of BYOL at every iteration could be written as LBYOL , E ( x , t1 , t2 ) ∼ ( X , T1 , T2 ) [ ∥∥qw ( fθ ( t1 ( x ) ) ) − fξ ( t2 ( x ) ) ∥∥22 ] , ( 3 ) where two vectors in representation space are automatically l2-normalized . fθ is the online encoder network parameterized by θ and qw is the predictor network parameterized by w. x ∼ X is the input sampled from the data distribution X , and t1 ( x ) , t2 ( x ) are two augmented views of x where t1 ∼ T1 , t2 ∼ T2 are two data augmentations . The target network fξ is of the same architecture as fθ and is updated by EMA with τ controlling to what degree the target network preserves its history ξ ← τξ + ( 1− τ ) θ . ( 4 ) From the scheme of BYOL training , it seems like there is no constraint on the uniformity , and thus most frequently asked question about BYOL is how it prevents the representation collapse . Theoretically , we would expect that when the final convergence of the online and target is reached , LBYOL degenerates to Lalign and therefore causes representation collapse , while this speculation never happens in reality . Despite the perfect SOTA performance of BYOL , there is one inconsistency not to be neglected : it fails with representation collapse when the predictor is removed , which means qw ( x ) = x for any given x . This inconsistent behavior of BYOL weakens its reliability and further poses questions on future adaptation of the algorithm . The motivation of understanding and even solving this inconsistency is the start point of this paper . 3 ON-AND-OFF BYOL : FAILURE WITHOUT PREDICTOR . We start by presenting a dissatisfactory property of BYOL : its success heavily relies on the existence of the predictor qw . The experimental setup of this paper is listed in Appendix C. The performance of BYOL original model , whose predictor qw is a two-layer MLP with batch normalization , evaluated on the linear evaluation protocol ( Kolesnikov et al. , 2019 ; Kornblith et al. , 2019 ; Chen et al. , 2020a ; He et al. , 2020 ; Grill et al. , 2020 ) reaches 68.08 ± 0.84 % . When the predictor is removed , the performance degenerates to 20.92±1.29 % , which is even lower than the random baseline ’ s 42.74± 0.41 % . We examine the speculation that the performance drop is caused by the representation collapse both visually ( refer to Appendix F.1 ) and numerically . Inspired by Wang & Isola ( 2020 ) , we use Luniform ( fθ ; X ) to evaluate to what degree the representations are spread on the hypersphere and Lalign ( qw ◦ fθ ) to evaluate how the similar samples are aligned in the representation space . The results in Table 1 show that with the predictor , BYOL optimizes the uniformity of the representation distribution . On the contrary , when taken away the predictor , the alignment of two augmented views is overly optimized and the uniformity of the representation deteriorates ( Figure 4 ) , therefore we conclude the predictor is essential to the collapse prevention in BYOL . One reasonable follow-up explanation on the efficacy of the predictor may consider its specially designed architecture or some good properties brought by the weight initialization , which makes it hard to understand the mechanism behind it . Fortunately , after replacing the current predictor , two-layer MLP with batch normalization ( Ioffe & Szegedy , 2015 ) , with different network architectures and weight initializations , we find that there is no significant change either on linear evaluation protocol or on the model behavior during training ( Table 1 , for detailed training trajectory , refer to Figure 4 ) . We first replace the complex structure with linear mapping qw ( · ) = W ( · ) . This replacement provides a naive solution to representation collapse : W = I , while it never converges to this apparent collapse . Surprisingly enough when we go harsher on this linear predictor by initializing W with the apparent collapse solution I , the model itself seems to have a self-recovering mechanism even though it starts off at a poor position : the loss quickly approaches to 0 and the uniformity deteriorates for 10-20 epochs and suddenly it deflects from the collapse and keeps on the right track . We conduct a theoretical proof that a randomly initialized linear predictor prevents the ( more strict form of ) representation collapse by creating infinite non-trivial solutions when the convergence is achieved ( refer to Appendix I ) , while we fail to correlate the consistently optimized uniformity with the presence of the predictor , which indicates that a deeper rationale needs to be found .
The paper provides a new perspective on the BYOL self-supervised learning method. First, the paper introduces an upper-bound objective, BYOL', that is easier to analyze than BYOL because it is composed of two well understood losses: an alignment loss and cross-model loss. Further, it shows empirically that optimizing BYOL' is similar to optimizing BYOL. Second, the paper introduces the RAFT method which maximizes the alignment loss instead of minimizing it. The paper proves that under some assumptions, such as a linear predictor function, optimizing BYOL' is equivalent to RAFT. Based on this analysis, the paper explains why the predictor function is essential for BYOL and why it is hard to achieve convergence.
SP:a27d66876fcdc3f3871485445e09041a8927b147
With False Friends Like These, Who Can Have Self-Knowledge?
1 INTRODUCTION . Deep neural networks ( DNNs ) have achieved breakthroughs in a variety of challenging problems such as image understanding ( Krizhevsky et al. , 2012 ) , speech recognition ( Graves et al. , 2013 ) , and automatic game playing ( Mnih et al. , 2015 ) . Despite these remarkable successes , their pervasive failures in adversarial settings , the phenomenon of adversarial examples ( Biggio et al. , 2013 ; Szegedy et al. , 2014 ) , have attracted significant attention in recent years ( Athalye et al. , 2018 ; Carlini et al. , 2019 ; Tramer et al. , 2020 ) . Such small perturbations on inputs crafted by adversaries are capable of causing well-trained models to make big mistakes , which indicates that there is still a large gap between machine and human perception , thus posing potential security concerns for practical machine learning ( ML ) applications ( Kurakin et al. , 2016 ; Qin et al. , 2019 ; Wu et al. , 2020b ) . An adversarial example is “ an input to a ML model that is intentionally designed by an attacker to fool the model into producing an incorrect output ” ( Goodfellow & Papernot , 2017 ) . Following the definition of adversarial examples on classification problems ( Goodfellow et al. , 2015 ; Papernot et al. , 2016 ; Elsayed et al. , 2018 ; Carlini et al. , 2019 ; Zhang et al. , 2019 ; Wang et al. , 2020b ; Zhang et al. , 2020 ; Tramèr et al. , 2020 ) , given a DNN classifier f and a correctly classified example x with class label y ( i.e. , f ( x ) = y ) , an adversarial example xadv is generated by perturbing x such that f ( xadv ) 6= y and xadv ∈ B ( x ) . The neighborhood B ( x ) denotes the set of points within a fixed distance > 0 of x , as measured by some metric ( e.g. , the lp distance ) , so that xadv is visually the “ same ” for human observers . Then , an imperfection of the classifier is highlighted by Gadv = Acc ( D ) −Acc ( A ) , the performance gap between the accuracy ( denoted by Acc ( · ) ) evaluated on clean set sampled from data distribution D and adversarially perturbed set A . An adversary could construct such a perturbed setA that looks no different from D but can severely degrade the performance of even state-of-the-art DNN models . From direct attacks in the digital space ( Goodfellow et al. , 2015 ; Carlini & Wagner , 2017 ) to robust attacks in the physical world ( Kurakin et al. , 2016 ; Xu et al. , 2020 ) , from toy classification problems ( Chen et al. , 2020 ; Dobriban et al. , 2020 ) to complicated perception tasks ( Zhang & Wang , 2019 ; Wang et al. , 2020a ) , from the high dimensional nature of the input space ( Goodfellow et al. , 2015 ; Gilmer et al. , 2018 ) to the framework of ( non ) -robust features ( Jetley et al. , 2018 ; Ilyas et al. , 2019 ) , many efforts have been devoted to understanding and mitigating the risk raised by adversarial examples , thus closing the gap Gadv . Previous works mainly concern the adversarial risk on correctly classified examples . However , they typically neglect a risk on misclassified examples themselves which will be formalized in this work . In this paper , we first investigate an intriguing , yet far overlooked phenomenon , where given a DNN classifier f and a misclassified example x with class label y ( i.e. , f ( x ) 6= y ) , we can easily perturb x to xhyp such that f ( xhyp ) = y and xhyp ∈ B ( x ) . Such an example xhyp looks harmless , but actually can be maliciously utilized by a false friend to fool a model to be self-satisfied . Thus we name them hypocritical examples ( see Figure 1 for a comparison with adversarial examples ) . Adversarial examples and hypocritical examples are two sides of the same coin . On the one side , a well-performed but sensitive model becomes unreliable in the existence of adversaries . On the other side , a poorly performed but sensitive model behaves well with the help of friends . With false friends like these , a naturally trained suboptimal model could have state-of-the-art performance , and even worse , a randomly initialized model could behave like a well-trained one ( see Section 2.1 ) . It is natural then to wonder : Why should we care about hypocritical examples ? Here we give two main reasons : 1 . This is of scientific interest . Hypocritical examples are the opposite of adversarial examples . While adversarial examples are hard test data to a model , hypocritical examples aim to make it easy to do correct classification . Hypocritical examples warn ML researchers to think carefully about high test accuracy : Does our model truly achieve human-like intelligence , or is it just simply because the test data prefers the model ? 2 . There are practical threats . A variety of nefarious ends may be achievable if the mistakes of ML systems can be covered up by hypocritical attackers . For instance , before allowing autonomous vehicles to drive on public roads , manufacturers must first pass tests in specific environments ( closed or open roads ) to obtain a license ( Administration et al. , 2016 ; Briefs , 2015 ; Lei , 2018 ) . An attacker may add imperceptible perturbations on the test examples ( e.g. , the “ stop sign ” on the road ) stealthily without human notice , to hypocritically help an ML-based autonomous vehicle to pass the tests that might otherwise fail . However , the high performance can not be maintained on public roads without the help of the attacker . Thus , the potential risk is underestimated and traffic accidents might happen unexpectedly when the vehicle driving on public roads . In such a case , if the examples used to evaluate a model are falsified by a false friend , the model will manifest like a perfect one ( on hypocritical examples ) , but it actually may not be well performed even on clean examples , not to mention adversarial examples . Thus a new imperfection of the classifier can be found in Ghyp = Acc ( F ) −Acc ( D ) , the performance gap between the accuracy evaluated on clean set sampled from D and hypocritically perturbed set F . Still , F looks no different from D but can stealthily upgrade the performance . Once a deployer trusts the hypocritical performance carefully designed by a false friend and uses the “ well-performed ” model in real-world applications , potential security concerns appear even in benign environments . Thus we need methods to defend our models from false friends , that is , making our models have self-knowledge . We propose a defense method by improving model robustness against hypocritical perturbations . Specifically , we formalize the hypocritical risk and minimize it via a differentiable surrogate loss ( Section 3 ) . Experimentally , we verify the effectiveness of our proposed attack ( Section 2.1 ) and defense ( Section 4.1 ) . Further , we study the transferability of hypocritical examples across models trained with various methods ( Section 4.2 ) . Finally , we conclude our paper by discussing and summarizing our results ( Section 5 and Section 6 ) . Our main contributions are : • We give a formal definition of hypocritical examples . We demonstrate the unreliability of standard evaluation process in the existence of false friends and show the potential security risk on the deployment of a model with high hypocritical performance . • We formalize the hypocritical risk and analyze its relation with natural risk and adversarial risk . We propose the first defense method specialized for hypocritical examples by minimizing the tradeoff between the natural risk and an upper bound of hypocritical risk . • Extensive experiments verify the effectiveness of our proposed methods . We also examine the transferability of hypocritical examples . We show that the transferability is not always desired by the attackers , which depends on their purpose . 2 FALSE FRIENDS AND ADVERSARIES . Better an open enemy than a false friend ! Only by being aware of the potential risk of the false friend can we prevent it . In this section , we expose a kind of false friends , who are capable of manipulating model performance stealthily during the evaluation process , thus making the evaluation results unreliable . We consider a classification task with data ( x , y ) ∈ Rd × { 1 , . . . , C } from a distribution D. Denote by f : Rd → { 1 , ... , C } the classifier which predicts the class of an input example x : f ( x ) = arg maxk pk ( x ) , where pk ( x ) is the kth component of p ( x ) : Rd → ∆C ( e.g. , the output after softmax activation ) , in which ∆C = { u ∈ RC | 1Tu = 1 , u ≥ 0 } is the probabilistic simplex . Adversarial examples are malicious inputs crafted by an adversary to induce misclassification . We first give the commonly accepted definition of adversarial examples as follows : Definition 1 ( Adversarial Examples ) . Given a classifier f and a correctly classified input ( x , y ) ∼ D ( i.e. , f ( x ) = y ) , an -bounded adversarial example is an input x∗ ∈ Rd such that : f ( x∗ ) 6= y and x∗ ∈ B ( x ) . The assumption underlying this definition is that inputs satisfying x∗ ∈ B ( x ) preserve the label y of the original input x . The reason for the existence of adversarial examples is that a model is overly sensitive to non-semantic changes . Next , we formalize a complementary phenomenon to adversarial examples , called hypocritical examples . Hypocritical examples are malicious inputs crafted by a false friend to stealthily correct the prediction of a model : Definition 2 ( Hypocritical Examples ) . Given a classifier f and a misclassified input ( x , y ) ∼ D ( i.e. , f ( x ) 6= y ) , an -bounded hypocritical example is an input x∗ ∈ Rd such that : f ( x∗ ) = y and x∗ ∈ B ( x ) . The same as adversarial examples , hypocritical examples are bounded to preserve the label of the original input , and are another consequence that arises from excessive sensitivity of a classifier . As a false friend , a hypocritical example can be generated from a misclassified example by maximizing max x′∈B ( x ) 1 ( f ( x′ ) = y ) , ( 1 ) which is equivalent to minimizing min x′∈B ( x ) 1 ( f ( x′ ) 6= y ) , ( 2 ) where 1 ( · ) is the indicator function . Similar to Madry et al . ( 2018 ) ; Wang et al . ( 2020b ) , in practice , we leverage the commonly used cross entropy ( CE ) loss as the surrogate loss of 1 ( f ( x′ ) 6= y ) and minimize it by projected gradient descent ( PGD ) . Note that Equation 2 looks similar to but conceptually differs from the known targeted adversarial attack ( Carlini & Wagner , 2017 ) , which generates a kind of adversarial examples defined on correctly classified clean inputs and targeted to wrong classes . The hypocritical examples here are defined on misclassified inputs and are targeted to their right classes .
1. The premise of the paper is that the adversary can perturb the *test* set so that the model is shown to perform better that it really is capable of. And in Section 7 (Conclusion) the paper claims that it exposes this new risk. However, remember that this risk is already mitigated in practice by keeping the test data *independent* of the model/classifier (e.g., see Kaggle competitions where the test set is hidden). Therefore, the perceived risk is not even present. In the context that the technique has been introduced, it seems like the [malicious] actor would only be fooling him/her self rather than fooling the model/classifier.
SP:0af1989b2e643d013174489704d0a052bad77f95
With False Friends Like These, Who Can Have Self-Knowledge?
1 INTRODUCTION . Deep neural networks ( DNNs ) have achieved breakthroughs in a variety of challenging problems such as image understanding ( Krizhevsky et al. , 2012 ) , speech recognition ( Graves et al. , 2013 ) , and automatic game playing ( Mnih et al. , 2015 ) . Despite these remarkable successes , their pervasive failures in adversarial settings , the phenomenon of adversarial examples ( Biggio et al. , 2013 ; Szegedy et al. , 2014 ) , have attracted significant attention in recent years ( Athalye et al. , 2018 ; Carlini et al. , 2019 ; Tramer et al. , 2020 ) . Such small perturbations on inputs crafted by adversaries are capable of causing well-trained models to make big mistakes , which indicates that there is still a large gap between machine and human perception , thus posing potential security concerns for practical machine learning ( ML ) applications ( Kurakin et al. , 2016 ; Qin et al. , 2019 ; Wu et al. , 2020b ) . An adversarial example is “ an input to a ML model that is intentionally designed by an attacker to fool the model into producing an incorrect output ” ( Goodfellow & Papernot , 2017 ) . Following the definition of adversarial examples on classification problems ( Goodfellow et al. , 2015 ; Papernot et al. , 2016 ; Elsayed et al. , 2018 ; Carlini et al. , 2019 ; Zhang et al. , 2019 ; Wang et al. , 2020b ; Zhang et al. , 2020 ; Tramèr et al. , 2020 ) , given a DNN classifier f and a correctly classified example x with class label y ( i.e. , f ( x ) = y ) , an adversarial example xadv is generated by perturbing x such that f ( xadv ) 6= y and xadv ∈ B ( x ) . The neighborhood B ( x ) denotes the set of points within a fixed distance > 0 of x , as measured by some metric ( e.g. , the lp distance ) , so that xadv is visually the “ same ” for human observers . Then , an imperfection of the classifier is highlighted by Gadv = Acc ( D ) −Acc ( A ) , the performance gap between the accuracy ( denoted by Acc ( · ) ) evaluated on clean set sampled from data distribution D and adversarially perturbed set A . An adversary could construct such a perturbed setA that looks no different from D but can severely degrade the performance of even state-of-the-art DNN models . From direct attacks in the digital space ( Goodfellow et al. , 2015 ; Carlini & Wagner , 2017 ) to robust attacks in the physical world ( Kurakin et al. , 2016 ; Xu et al. , 2020 ) , from toy classification problems ( Chen et al. , 2020 ; Dobriban et al. , 2020 ) to complicated perception tasks ( Zhang & Wang , 2019 ; Wang et al. , 2020a ) , from the high dimensional nature of the input space ( Goodfellow et al. , 2015 ; Gilmer et al. , 2018 ) to the framework of ( non ) -robust features ( Jetley et al. , 2018 ; Ilyas et al. , 2019 ) , many efforts have been devoted to understanding and mitigating the risk raised by adversarial examples , thus closing the gap Gadv . Previous works mainly concern the adversarial risk on correctly classified examples . However , they typically neglect a risk on misclassified examples themselves which will be formalized in this work . In this paper , we first investigate an intriguing , yet far overlooked phenomenon , where given a DNN classifier f and a misclassified example x with class label y ( i.e. , f ( x ) 6= y ) , we can easily perturb x to xhyp such that f ( xhyp ) = y and xhyp ∈ B ( x ) . Such an example xhyp looks harmless , but actually can be maliciously utilized by a false friend to fool a model to be self-satisfied . Thus we name them hypocritical examples ( see Figure 1 for a comparison with adversarial examples ) . Adversarial examples and hypocritical examples are two sides of the same coin . On the one side , a well-performed but sensitive model becomes unreliable in the existence of adversaries . On the other side , a poorly performed but sensitive model behaves well with the help of friends . With false friends like these , a naturally trained suboptimal model could have state-of-the-art performance , and even worse , a randomly initialized model could behave like a well-trained one ( see Section 2.1 ) . It is natural then to wonder : Why should we care about hypocritical examples ? Here we give two main reasons : 1 . This is of scientific interest . Hypocritical examples are the opposite of adversarial examples . While adversarial examples are hard test data to a model , hypocritical examples aim to make it easy to do correct classification . Hypocritical examples warn ML researchers to think carefully about high test accuracy : Does our model truly achieve human-like intelligence , or is it just simply because the test data prefers the model ? 2 . There are practical threats . A variety of nefarious ends may be achievable if the mistakes of ML systems can be covered up by hypocritical attackers . For instance , before allowing autonomous vehicles to drive on public roads , manufacturers must first pass tests in specific environments ( closed or open roads ) to obtain a license ( Administration et al. , 2016 ; Briefs , 2015 ; Lei , 2018 ) . An attacker may add imperceptible perturbations on the test examples ( e.g. , the “ stop sign ” on the road ) stealthily without human notice , to hypocritically help an ML-based autonomous vehicle to pass the tests that might otherwise fail . However , the high performance can not be maintained on public roads without the help of the attacker . Thus , the potential risk is underestimated and traffic accidents might happen unexpectedly when the vehicle driving on public roads . In such a case , if the examples used to evaluate a model are falsified by a false friend , the model will manifest like a perfect one ( on hypocritical examples ) , but it actually may not be well performed even on clean examples , not to mention adversarial examples . Thus a new imperfection of the classifier can be found in Ghyp = Acc ( F ) −Acc ( D ) , the performance gap between the accuracy evaluated on clean set sampled from D and hypocritically perturbed set F . Still , F looks no different from D but can stealthily upgrade the performance . Once a deployer trusts the hypocritical performance carefully designed by a false friend and uses the “ well-performed ” model in real-world applications , potential security concerns appear even in benign environments . Thus we need methods to defend our models from false friends , that is , making our models have self-knowledge . We propose a defense method by improving model robustness against hypocritical perturbations . Specifically , we formalize the hypocritical risk and minimize it via a differentiable surrogate loss ( Section 3 ) . Experimentally , we verify the effectiveness of our proposed attack ( Section 2.1 ) and defense ( Section 4.1 ) . Further , we study the transferability of hypocritical examples across models trained with various methods ( Section 4.2 ) . Finally , we conclude our paper by discussing and summarizing our results ( Section 5 and Section 6 ) . Our main contributions are : • We give a formal definition of hypocritical examples . We demonstrate the unreliability of standard evaluation process in the existence of false friends and show the potential security risk on the deployment of a model with high hypocritical performance . • We formalize the hypocritical risk and analyze its relation with natural risk and adversarial risk . We propose the first defense method specialized for hypocritical examples by minimizing the tradeoff between the natural risk and an upper bound of hypocritical risk . • Extensive experiments verify the effectiveness of our proposed methods . We also examine the transferability of hypocritical examples . We show that the transferability is not always desired by the attackers , which depends on their purpose . 2 FALSE FRIENDS AND ADVERSARIES . Better an open enemy than a false friend ! Only by being aware of the potential risk of the false friend can we prevent it . In this section , we expose a kind of false friends , who are capable of manipulating model performance stealthily during the evaluation process , thus making the evaluation results unreliable . We consider a classification task with data ( x , y ) ∈ Rd × { 1 , . . . , C } from a distribution D. Denote by f : Rd → { 1 , ... , C } the classifier which predicts the class of an input example x : f ( x ) = arg maxk pk ( x ) , where pk ( x ) is the kth component of p ( x ) : Rd → ∆C ( e.g. , the output after softmax activation ) , in which ∆C = { u ∈ RC | 1Tu = 1 , u ≥ 0 } is the probabilistic simplex . Adversarial examples are malicious inputs crafted by an adversary to induce misclassification . We first give the commonly accepted definition of adversarial examples as follows : Definition 1 ( Adversarial Examples ) . Given a classifier f and a correctly classified input ( x , y ) ∼ D ( i.e. , f ( x ) = y ) , an -bounded adversarial example is an input x∗ ∈ Rd such that : f ( x∗ ) 6= y and x∗ ∈ B ( x ) . The assumption underlying this definition is that inputs satisfying x∗ ∈ B ( x ) preserve the label y of the original input x . The reason for the existence of adversarial examples is that a model is overly sensitive to non-semantic changes . Next , we formalize a complementary phenomenon to adversarial examples , called hypocritical examples . Hypocritical examples are malicious inputs crafted by a false friend to stealthily correct the prediction of a model : Definition 2 ( Hypocritical Examples ) . Given a classifier f and a misclassified input ( x , y ) ∼ D ( i.e. , f ( x ) 6= y ) , an -bounded hypocritical example is an input x∗ ∈ Rd such that : f ( x∗ ) = y and x∗ ∈ B ( x ) . The same as adversarial examples , hypocritical examples are bounded to preserve the label of the original input , and are another consequence that arises from excessive sensitivity of a classifier . As a false friend , a hypocritical example can be generated from a misclassified example by maximizing max x′∈B ( x ) 1 ( f ( x′ ) = y ) , ( 1 ) which is equivalent to minimizing min x′∈B ( x ) 1 ( f ( x′ ) 6= y ) , ( 2 ) where 1 ( · ) is the indicator function . Similar to Madry et al . ( 2018 ) ; Wang et al . ( 2020b ) , in practice , we leverage the commonly used cross entropy ( CE ) loss as the surrogate loss of 1 ( f ( x′ ) 6= y ) and minimize it by projected gradient descent ( PGD ) . Note that Equation 2 looks similar to but conceptually differs from the known targeted adversarial attack ( Carlini & Wagner , 2017 ) , which generates a kind of adversarial examples defined on correctly classified clean inputs and targeted to wrong classes . The hypocritical examples here are defined on misclassified inputs and are targeted to their right classes .
This paper presents a new kind of adversarial attacks, named hypocritical attack. It is a reverse version of the original adversarial attack. It tricks a model into classifying data correctly with a perturbation. This can be a problem since it can make people satisfy the model performance, but the model is not robust on the real test dataset. The authors review the adversarial attack and define the new hypocritical examples and risk. The authors also show the simple results why hypocritical attach is a critical issue by a Naive model that is initialized randomly. It shows high performance on the hypocritical examples but low on the clean test data. They also investigate the algorithms that improve model robustness, THRM, and TRADES. Experiments show a trade-off between original classification loss and hypocritical risks, and THRM is a tight upper bound against the TRADES.
SP:0af1989b2e643d013174489704d0a052bad77f95
Systematic Analysis of Cluster Similarity Indices: How to Validate Validation Measures
1 INTRODUCTION . Clustering is an unsupervised machine learning problem , where the task is to group objects that are similar to each other . In network analysis , a related problem is called community detection , where grouping is based on relations between items ( links ) , and the obtained clusters are expected to be densely interconnected . Clustering is used across various applications , including text mining , online advertisement , anomaly detection , and many others ( Allahyari et al. , 2017 ; Xu & Tian , 2015 ) . To measure the quality of a clustering algorithm , one can use either internal or external measures . Internal measures evaluate the consistency of the clustering result with the data being clustered , e.g. , Silhouette , Hubert-Gamma , Dunn , and many other indices . Unfortunately , it is unclear whether optimizing any of these measures would translate into improved quality in practical applications . External ( cluster similarity ) measures compare the candidate partition with a reference one ( obtained , e.g. , by human assessors ) . A comparison with such a gold standard partition , when it is available , is more reliable . There are many tasks where external evaluation is applicable : text clustering ( Amigó et al. , 2009 ) , topic modeling ( Virtanen & Girolami , 2019 ) , Web categorization ( Wibowo & Williams , 2002 ) , face clustering ( Wang et al. , 2019 ) , news aggregation ( see Section 3 ) , and others . Often , when there is no reference partition available , it is possible to let a group of experts annotate a subset of items and compare the algorithms on this subset . Dozens of cluster similarity measures exist and which one should be used is a subject of debate ( Lei et al. , 2017 ) . In this paper , we systematically analyze the problem of choosing the best cluster similarity index . We start with a series of experiments demonstrating the importance of the problem ( Section 3 ) . First , we construct simple examples showing the inconsistency of all pairs of different similarity indices . Then , we demonstrate that such disagreements often occur in practice when well-known clustering algorithms are applied to real datasets . Finally , we illustrate how an improper choice of a similarity index can affect the performance of production systems . So , the question is : how to compare cluster similarity indices and choose the best one for a particular application ? Ideally , we would want to choose an index for which good similarity scores translate to good real-world performance . However , opportunities to experimentally perform such a validation of validation indices are rare , typically expensive , and do not generalize to other applications . In contrast , we suggest a theoretical approach : we formally define properties that are desirable across various applications , discuss their importance , and formally analyze which similarity indices satisfy them ( Section 4 ) . This theoretical framework would allow practitioners to choose the best index based on relevant properties for their applications . In Section 5 , we advocate two indices that are expected to be suitable across various applications . While many ideas discussed in the paper can be applied to all similarity indices , we also provide a more in-depth theoretical characterization of pair-counting ones ( e.g. , Rand and Jaccard ) , which gives an analytical background for further studies of pair-counting indices . We formally prove that among dozens of known indices , only two have all the properties except for being a distance : Correlation Coefficient and Sokal & Sneath ’ s first index ( Lei et al. , 2017 ) . Surprisingly , both indices are rarely used for cluster evaluation . The correlation coefficient has an additional advantage of being easily convertible to a distance measure via the arccosine function . The obtained index has all the properties except constant baseline , which is still satisfied asymptotically . Constant baseline is a particular focus of the current research : this is one of the most important and non-trivial properties . Informally , a sensible index should not prefer one candidate partition over another just because it has too large or too small clusters . To the best of our knowledge , we are the first to develop a rigorous theoretical framework for analyzing this property . In this respect , our work improves over the previous ( mostly empirical ) research on constant baseline of particular indices ( Albatineh et al. , 2006 ; Lei et al. , 2017 ; Strehl , 2002 ; Vinh et al. , 2009 ; 2010 ) , we refer to Appendix A for a detailed comparison to related research . 2 CLUSTER SIMILARITY INDICES . We assume that there is a set of elements V with size n = |V | . A clustering is a partition of V into disjoint subsets . Capital letters A , B , C will be used to name the clusterings , and we will represent them as A = { A1 , . . . , AkA } , where Ai is the set of elements belonging to i-th cluster . If a pair of elements v , w ∈ V lie in the same cluster in A , we refer to them as an intra-cluster pair of A , while inter-cluster pair will be used otherwise . The total number of pairs is denoted by N = ( n 2 ) . The value that an index I assigns to the similarity between partitions A and B will be denoted by I ( A , B ) . Let us now define some of the indices used throughout the paper , while a more comprehensive list , together with formal definitions , is given in Appendix B.1 and B.2 . Pair-counting indices consider clusterings to be similar if they agree on many pairs . Formally , let ~A be the N -dimensional vector indexed by the set of element-pairs , where the entry corresponding to ( v , w ) equals 1 if ( v , w ) is an intra-cluster pair and 0 otherwise . Further , let MAB be the N × 2 matrix that results from concatenating the two ( column- ) vectors ~A and ~B . Each row of MAB is either 11 , 10 , 01 , or 00 . Let the pair-counts N11 , N10 , N01 , N00 denote the number of occurrences for each of these rows in MAB . Definition 1 . A pair-counting index is a similarity index that can be expressed as a function of the pair-counts N11 , N10 , N01 , N00 . Some popular pair-counting indices are Rand and Jaccard : R = N11 +N00 N11 +N10 +N01 +N00 , J = N11 N11 +N10 +N01 . Adjusted Rand ( AR ) is a linear transformation of Rand ensuring that for a random B we have AR ( A , B ) = 0 in expectation . A less widely used index is the Pearson Correlation Coefficient ( CC ) between the binary incidence vectors ~A and ~B.1 Another index , which we discuss further in more details , is the Correlation Distance CD ( A , B ) : = 1π arccosCC ( A , B ) . In Table 4 , we formally define 27 known pair-counting indices and only mention ones of particular interest throughout the main text . Information-theoretic indices consider clusterings similar if they share a lot of information , i.e. , if little information is needed to transform one clustering into the other . Formally , let H ( A ) : = H ( |A1|/n , . . . , |AkA |/n ) be the Shannon entropy of the cluster-label distribution of A . Similarly , the joint entropyH ( A , B ) is defined as the entropy of the distribution with probabilities ( pij ) i∈ [ kA ] , j∈ [ kB ] , where pij = |Ai ∩ Bj |/n . Then , the mutual information of two clusterings can be defined as 1Note that Spearman and Pearson correlation are equal when comparing binary vectors . Kendall rank correlation for binary vectors coincides with the Hubert index , which is linearly equivalent to Rand . M ( A , B ) = H ( A ) + H ( B ) − H ( A , B ) . There are multiple ways of normalizing the mutual information , the most widely used ones are : NMI ( A , B ) = M ( A , B ) ( H ( A ) +H ( B ) ) /2 , NMImax ( A , B ) = M ( A , B ) max { H ( A ) , H ( B ) } . NMI is known to be biased towards smaller clusters , and several modifications try to mitigate this bias : Adjusted Mutual Information ( AMI ) and Standardized Mutual Information ( SMI ) subtract the expected mutual information from M ( A , B ) and normalize the obtained value ( Vinh et al. , 2009 ) , while Fair NMI ( FNMI ) multiplies NMI by a penalty factor e−|kA−kB |/kA ( Amelio & Pizzuti , 2015 ) . 3 MOTIVATING EXPERIMENTS . As discussed in Section 2 , many cluster similarity indices are used by researchers and practitioners . A natural question is : how to choose the best one ? Before trying to answer this question , it is important to understand whether the problem is relevant . Indeed , if the indices are very similar to each other and agree in most practical applications , then one can safely take any index . In this section , we demonstrate that this is not the case , and the proper choice matters . First , we illustrate the inconsistency of all indices . We say that two indices I1 and I2 are inconsistent for a triplet of partitions ( A , B1 , B2 ) if I1 ( A , B1 ) > I1 ( A , B2 ) but I2 ( A , B1 ) < I2 ( A , B2 ) . We took 15 popular cluster similarity measures and constructed just four triplets such that each pair of indices is inconsistent for at least one triplet . One example is shown in Figure 1 : for this simple example , about half of the indices prefer the left candidate , while the others prefer the right one . Other examples can be found in Appendix F.1 . NMI VI AR S & S1 CC NMI – 40.3 15.7 20.1 18.5 VI – 37.6 36.0 37.2 AR – 11.7 8.3 S & S1 – 3.6 CC – tition and B1 , B2 are provided by two algorithms . For a given pair of indices and all such triplets , we look at whether the indices are consistent . Table 1 shows the relative inconsistency for several indices ( the extended table together with a detailed description of the experimental setup and more analysis is given in Appendix F.2 ) . The inconsistency rate is significant : e.g. , popular measures Adjusted Rand and Variation if Information disagree in almost 40 % of the cases , which is huge . Interestingly , the best agreeing indices are S & S and CC , which satisfy most of our properties , as shown in the next section . In contrast , the Variation of Information very often disagrees with other indices . To show that the choice of similarity index may affect the final performance in a real production scenario , we conducted an experiment within a major news aggregator system . The system groups news articles to events and shows the list of most important events to users . For grouping , a clustering algorithm is used , and the quality of this algorithm affects the user experience : merging different clusters may lead to not showing an important event , while too much splitting may cause duplicate events . When comparing several candidate clustering algorithms , it is important to determine which one is the best for the system . Online experiments are expensive and can be used only for the best candidates . Thus , we need a tool for an offline comparison . For this purpose , we manually created a reference partition on a small fraction of news articles . We can use this partition to evaluate the candidates . We performed such an offline comparison for two candidate algorithms and observed that different indices preferred different algorithms . Then , we launched an online user experiment and verified that one of the candidates is better for the system according to user preferences . Hence , it is important to be careful when choosing a similarity index for the offline comparison . See Appendix F.3 for more detailed description of this experiment and quantitative analysis .
This paper aims to answer a very important and difficult question, i.e., given a clustering application what are the desirable qualities (i.e., similarity indices) to have. This work argues that there are so many clustering similarity indices with (sometimes) disagreements among them. The authors run experiments on 16 real-world datasets and 8 well-known clustering algorithms and provide a theoretical solution and a list of desirable properties that can help practitioners make informed decisions. Moreover, the authors also discuss the important pros and cons of the similarity indices in the context of the applications.
SP:916fbf4e8da5fb73f5012ec5711662cd9be2e067
Systematic Analysis of Cluster Similarity Indices: How to Validate Validation Measures
1 INTRODUCTION . Clustering is an unsupervised machine learning problem , where the task is to group objects that are similar to each other . In network analysis , a related problem is called community detection , where grouping is based on relations between items ( links ) , and the obtained clusters are expected to be densely interconnected . Clustering is used across various applications , including text mining , online advertisement , anomaly detection , and many others ( Allahyari et al. , 2017 ; Xu & Tian , 2015 ) . To measure the quality of a clustering algorithm , one can use either internal or external measures . Internal measures evaluate the consistency of the clustering result with the data being clustered , e.g. , Silhouette , Hubert-Gamma , Dunn , and many other indices . Unfortunately , it is unclear whether optimizing any of these measures would translate into improved quality in practical applications . External ( cluster similarity ) measures compare the candidate partition with a reference one ( obtained , e.g. , by human assessors ) . A comparison with such a gold standard partition , when it is available , is more reliable . There are many tasks where external evaluation is applicable : text clustering ( Amigó et al. , 2009 ) , topic modeling ( Virtanen & Girolami , 2019 ) , Web categorization ( Wibowo & Williams , 2002 ) , face clustering ( Wang et al. , 2019 ) , news aggregation ( see Section 3 ) , and others . Often , when there is no reference partition available , it is possible to let a group of experts annotate a subset of items and compare the algorithms on this subset . Dozens of cluster similarity measures exist and which one should be used is a subject of debate ( Lei et al. , 2017 ) . In this paper , we systematically analyze the problem of choosing the best cluster similarity index . We start with a series of experiments demonstrating the importance of the problem ( Section 3 ) . First , we construct simple examples showing the inconsistency of all pairs of different similarity indices . Then , we demonstrate that such disagreements often occur in practice when well-known clustering algorithms are applied to real datasets . Finally , we illustrate how an improper choice of a similarity index can affect the performance of production systems . So , the question is : how to compare cluster similarity indices and choose the best one for a particular application ? Ideally , we would want to choose an index for which good similarity scores translate to good real-world performance . However , opportunities to experimentally perform such a validation of validation indices are rare , typically expensive , and do not generalize to other applications . In contrast , we suggest a theoretical approach : we formally define properties that are desirable across various applications , discuss their importance , and formally analyze which similarity indices satisfy them ( Section 4 ) . This theoretical framework would allow practitioners to choose the best index based on relevant properties for their applications . In Section 5 , we advocate two indices that are expected to be suitable across various applications . While many ideas discussed in the paper can be applied to all similarity indices , we also provide a more in-depth theoretical characterization of pair-counting ones ( e.g. , Rand and Jaccard ) , which gives an analytical background for further studies of pair-counting indices . We formally prove that among dozens of known indices , only two have all the properties except for being a distance : Correlation Coefficient and Sokal & Sneath ’ s first index ( Lei et al. , 2017 ) . Surprisingly , both indices are rarely used for cluster evaluation . The correlation coefficient has an additional advantage of being easily convertible to a distance measure via the arccosine function . The obtained index has all the properties except constant baseline , which is still satisfied asymptotically . Constant baseline is a particular focus of the current research : this is one of the most important and non-trivial properties . Informally , a sensible index should not prefer one candidate partition over another just because it has too large or too small clusters . To the best of our knowledge , we are the first to develop a rigorous theoretical framework for analyzing this property . In this respect , our work improves over the previous ( mostly empirical ) research on constant baseline of particular indices ( Albatineh et al. , 2006 ; Lei et al. , 2017 ; Strehl , 2002 ; Vinh et al. , 2009 ; 2010 ) , we refer to Appendix A for a detailed comparison to related research . 2 CLUSTER SIMILARITY INDICES . We assume that there is a set of elements V with size n = |V | . A clustering is a partition of V into disjoint subsets . Capital letters A , B , C will be used to name the clusterings , and we will represent them as A = { A1 , . . . , AkA } , where Ai is the set of elements belonging to i-th cluster . If a pair of elements v , w ∈ V lie in the same cluster in A , we refer to them as an intra-cluster pair of A , while inter-cluster pair will be used otherwise . The total number of pairs is denoted by N = ( n 2 ) . The value that an index I assigns to the similarity between partitions A and B will be denoted by I ( A , B ) . Let us now define some of the indices used throughout the paper , while a more comprehensive list , together with formal definitions , is given in Appendix B.1 and B.2 . Pair-counting indices consider clusterings to be similar if they agree on many pairs . Formally , let ~A be the N -dimensional vector indexed by the set of element-pairs , where the entry corresponding to ( v , w ) equals 1 if ( v , w ) is an intra-cluster pair and 0 otherwise . Further , let MAB be the N × 2 matrix that results from concatenating the two ( column- ) vectors ~A and ~B . Each row of MAB is either 11 , 10 , 01 , or 00 . Let the pair-counts N11 , N10 , N01 , N00 denote the number of occurrences for each of these rows in MAB . Definition 1 . A pair-counting index is a similarity index that can be expressed as a function of the pair-counts N11 , N10 , N01 , N00 . Some popular pair-counting indices are Rand and Jaccard : R = N11 +N00 N11 +N10 +N01 +N00 , J = N11 N11 +N10 +N01 . Adjusted Rand ( AR ) is a linear transformation of Rand ensuring that for a random B we have AR ( A , B ) = 0 in expectation . A less widely used index is the Pearson Correlation Coefficient ( CC ) between the binary incidence vectors ~A and ~B.1 Another index , which we discuss further in more details , is the Correlation Distance CD ( A , B ) : = 1π arccosCC ( A , B ) . In Table 4 , we formally define 27 known pair-counting indices and only mention ones of particular interest throughout the main text . Information-theoretic indices consider clusterings similar if they share a lot of information , i.e. , if little information is needed to transform one clustering into the other . Formally , let H ( A ) : = H ( |A1|/n , . . . , |AkA |/n ) be the Shannon entropy of the cluster-label distribution of A . Similarly , the joint entropyH ( A , B ) is defined as the entropy of the distribution with probabilities ( pij ) i∈ [ kA ] , j∈ [ kB ] , where pij = |Ai ∩ Bj |/n . Then , the mutual information of two clusterings can be defined as 1Note that Spearman and Pearson correlation are equal when comparing binary vectors . Kendall rank correlation for binary vectors coincides with the Hubert index , which is linearly equivalent to Rand . M ( A , B ) = H ( A ) + H ( B ) − H ( A , B ) . There are multiple ways of normalizing the mutual information , the most widely used ones are : NMI ( A , B ) = M ( A , B ) ( H ( A ) +H ( B ) ) /2 , NMImax ( A , B ) = M ( A , B ) max { H ( A ) , H ( B ) } . NMI is known to be biased towards smaller clusters , and several modifications try to mitigate this bias : Adjusted Mutual Information ( AMI ) and Standardized Mutual Information ( SMI ) subtract the expected mutual information from M ( A , B ) and normalize the obtained value ( Vinh et al. , 2009 ) , while Fair NMI ( FNMI ) multiplies NMI by a penalty factor e−|kA−kB |/kA ( Amelio & Pizzuti , 2015 ) . 3 MOTIVATING EXPERIMENTS . As discussed in Section 2 , many cluster similarity indices are used by researchers and practitioners . A natural question is : how to choose the best one ? Before trying to answer this question , it is important to understand whether the problem is relevant . Indeed , if the indices are very similar to each other and agree in most practical applications , then one can safely take any index . In this section , we demonstrate that this is not the case , and the proper choice matters . First , we illustrate the inconsistency of all indices . We say that two indices I1 and I2 are inconsistent for a triplet of partitions ( A , B1 , B2 ) if I1 ( A , B1 ) > I1 ( A , B2 ) but I2 ( A , B1 ) < I2 ( A , B2 ) . We took 15 popular cluster similarity measures and constructed just four triplets such that each pair of indices is inconsistent for at least one triplet . One example is shown in Figure 1 : for this simple example , about half of the indices prefer the left candidate , while the others prefer the right one . Other examples can be found in Appendix F.1 . NMI VI AR S & S1 CC NMI – 40.3 15.7 20.1 18.5 VI – 37.6 36.0 37.2 AR – 11.7 8.3 S & S1 – 3.6 CC – tition and B1 , B2 are provided by two algorithms . For a given pair of indices and all such triplets , we look at whether the indices are consistent . Table 1 shows the relative inconsistency for several indices ( the extended table together with a detailed description of the experimental setup and more analysis is given in Appendix F.2 ) . The inconsistency rate is significant : e.g. , popular measures Adjusted Rand and Variation if Information disagree in almost 40 % of the cases , which is huge . Interestingly , the best agreeing indices are S & S and CC , which satisfy most of our properties , as shown in the next section . In contrast , the Variation of Information very often disagrees with other indices . To show that the choice of similarity index may affect the final performance in a real production scenario , we conducted an experiment within a major news aggregator system . The system groups news articles to events and shows the list of most important events to users . For grouping , a clustering algorithm is used , and the quality of this algorithm affects the user experience : merging different clusters may lead to not showing an important event , while too much splitting may cause duplicate events . When comparing several candidate clustering algorithms , it is important to determine which one is the best for the system . Online experiments are expensive and can be used only for the best candidates . Thus , we need a tool for an offline comparison . For this purpose , we manually created a reference partition on a small fraction of news articles . We can use this partition to evaluate the candidates . We performed such an offline comparison for two candidate algorithms and observed that different indices preferred different algorithms . Then , we launched an online user experiment and verified that one of the candidates is better for the system according to user preferences . Hence , it is important to be careful when choosing a similarity index for the offline comparison . See Appendix F.3 for more detailed description of this experiment and quantitative analysis .
Cluster Similarity Indices (CSIs) take as input two clusterings A, B and assign a similarity score for the given pair of clusterings. The index calculates a score based on the number of pairs of elements that clustered together on both clustering (N++), those that are not clustered together in non of A,B (N--), those that are clustered together in A but not in B (N+-), and vice versa (N-+). CSIs can be used to evaluate clusterings produced by different algorithms with respect to some reliable reference clustering on a single instance, and choose the one that is the closest to the reference clustering (indicated by the CSIs). The selected clustering algorithm can be then applied to different instances of the same kind where we do not have a reference clustering. 
SP:916fbf4e8da5fb73f5012ec5711662cd9be2e067
Generalization bounds via distillation
1 OVERVIEW AND MAIN RESULTS . Generalization bounds are statistical tools which take as input various measurements of a predictor on training data , and output a performance estimate for unseen data — that is , they estimate how well the predictor generalizes to unseen data . Despite extensive development spanning many decades ( Anthony & Bartlett , 1999 ) , there is growing concern that these bounds are not only disastrously loose ( Dziugaite & Roy , 2017 ) , but worse that they do not correlate with the underlying phenomena ( Jiang et al. , 2019b ) , and even that the basic method of proof is doomed ( Zhang et al. , 2016 ; Nagarajan & Kolter , 2019 ) . As an explicit demonstration of the looseness of these bounds , Figure 1 calculates bounds for a standard ResNet architecture achieving test errors of respectively 0.008 and 0.067 on mnist and cifar10 ; the observed generalization gap is 10−1 , while standard generalization techniques upper bound it with 1015 . Contrary to this dilemma , there is evidence that these networks can often be compressed or distilled into simpler networks , while still preserving their output values and low test error . Meanwhile , these simpler networks exhibit vastly better generalization bounds : again referring to Figure 1 , those same networks from before can be distilled with hardly any change to their outputs , while their bounds reduce by a factor of roughly 1010 . Distillation is widely studied ( Buciluŭ et al. , 2006 ; Hinton et al. , 2015 ) , but usually the original network is discarded and only the final distilled network is preserved . The purpose of this work is to carry the good generalization bounds of the distilled network back to the original network ; in a sense , the explicit simplicity of the distilled network is used as a witness to implicit simplicity of the original network . The main contributions are as follows . • The main theoretical contribution is a generalization bound for the original , undistilled network which scales primarily with the generalization properties of its distillation , assuming that wellbehaved data augmentation is used to measure the distillation distance . An abstract version of this bound is stated in Lemma 1.1 , along with a sufficient data augmentation technique in Lemma 1.2 . A concrete version of the bound , suitable to handle the ResNet architecture in Figure 1 , is described in Theorem 1.3 . Handling sophisticated architectures with only minor proof alterations is another contribution of this work , and is described alongside Theorem 1.3 . This abstract and concrete analysis is sketched in Section 3 , with full proofs deferred to appendices . • Rather than using an assumption on the distillation process ( e.g. , the aforementioned “ wellbehaved data augmentation ” ) , this work also gives a direct uniform convergence analysis , culminating in Theorem 1.4 . This is presented partially as an open problem or cautionary tale , as its proof is vastly more sophisticated than that of Theorem 1.3 , but ultimately results in a much looser analysis . This analysis is sketched in Section 3 , with full proofs deferred to appendices . • While this work is primarily theoretical , it is motivated by Figure 1 and related experiments : Figures 2 to 4 demonstrate that not only does distillation improve generalization upper bounds , but moreover it makes them sufficiently tight to capture intrinsic properties of the predictors , for example removing the usual bad dependence on width in these bounds ( cf . Figure 3 ) . These experiments are detailed in Section 2 . 1.1 AN ABSTRACT BOUND VIA DATA AUGMENTATION . This subsection describes the basic distillation setup and the core abstract bound based on data augmentation , culminating in Lemmas 1.1 and 1.2 ; a concrete bound follows in Section 1.2 . Given a multi-class predictor f : Rd → Rk , distillation finds another predictor g : Rd → Rk which is simpler , but close in distillation distance Φγ , m , meaning the softmax outputs φγ are close on average over a set of points ( zi ) mi=1 : Φγ , m ( f , g ) : = 1 m m∑ i=1 ∥∥φγ ( f ( zi ) ) − φγ ( g ( zi ) ) ∥∥1 , where φγ ( f ( z ) ) ∝ exp ( f ( z ) /γ ) . ( 1.1 ) The quantity γ > 0 is sometimes called a temperature ( Hinton et al. , 2015 ) . Decreasing γ increases sensitivity near the decision boundary ; in this way , it is naturally related to the concept of margins in generalization theory , as detailed in Appendix B. due to these connections , the use of softmax is beneficial in this work , though not completely standard in the literature ( Buciluŭ et al. , 2006 ) . We can now outline Figure 1 and the associated empirical phenomenon which motivates this work . ( Please see Section 2 for further details on these experiments . ) Consider a predictor f which has good test error but bad generalization bounds ; by treating the distillation distance Φγ , m ( f , g ) as an objective function and increasingly regularizing g , we obtain a sequence of predictors ( g0 , . . . , gt ) , where g0 = f , which trade off between distillation distance and predictor complexity . The curves in Figure 1 are produced in exactly this way , and demonstrate that there are predictors nearly identical to the original f which have vastly smaller generalization bounds . Our goal here is to show that this is enough to imply that f in turn must also have good generalization bounds , despite its apparent complexity . To sketch the idea , by a bit of algebra ( cf . Lemma A.2 ) , we can upper bound error probabilities with expected distillation distances and errors : Prx , y [ arg max y′ f ( x ) y′ 6= y ] ≤ 2Ex ∥∥φγ ( f ( x ) ) − φγ ( g ( x ) ) ∥∥1 + 2Ex , y ( 1− φγ ( g ( x ) ) y ) . The next step is to convert these expected errors into quantities over the training set . The last term is already in a form we want : it depends only on g , so we can apply uniform convergence with the low complexity of g. ( Measured over the training set , this term is the distillation error in Figure 1 . ) The expected distillation distance term is problematic , however . Here are two approaches . 1 . We can directly apply uniform convergence ; for instance , this approach was followed by Suzuki et al . ( 2019 ) , and a more direct approach is followed here to prove Theorem 1.4 . Unfortunately , it is unclear how this technique can avoid paying significantly for the high complexity of f . 2 . The idea in this subsection is to somehow trade off computation for the high statistical cost of the complexity of f . Specifically , notice that Φγ , m ( f , g ) only relies upon the marginal distribution of the inputs x , and not their labels . This subsection will pay computation to estimate Φγ , m with extra samples via data augmentation , offsetting the high complexity of f . We can now set up and state our main distillation bound . Suppose we have a training set ( ( xi , yi ) ) ni=1 drawn from some measure µ , with marginal distribution µX on the inputs x . Suppose we also have ( zi ) m i=1 drawn from a data augmentation distribution νn , the subscript referring to the fact that it depends on ( xi ) ni=1 . Our analysis works when ‖dµX/dνn‖∞ , the ratio between the two densities , is finite . If it is large , then one can tighten the bound by sampling more from νn , which is a computational burden ; explicit bounds on this term will be given shortly in Lemma 1.2 . Lemma 1.1 . Let temperature parameter γ > 0 be given , along with sets of multiclass predictors F and G. Then with probability at least 1 − 2δ over an iid draw of data ( ( xi , yi ) ) ni=1 from µ and ( zi ) m i=1 from νn , every f ∈ F and g ∈ G satisfy Pr [ arg max y′ f ( x ) y′ 6= y ] ≤ 2 ∥∥∥∥dµXdνn ∥∥∥∥ ∞ Φγ , m ( f , g ) + 2 n n∑ i=1 ( 1− φγ ( g ( xi ) ) yi ) + Õ ( k3/2 γ ∥∥∥∥dµXdνn ∥∥∥∥ ∞ ( Radm ( F ) + Radm ( G ) ) + √ k γ Radn ( G ) ) + 6 √ ln ( 1/δ ) 2n ( 1 + ∥∥∥∥dµXdνn ∥∥∥∥ ∞ √ n m ) , where Rademacher complexities Radn and Radm are defined in Section 1.4 . A key point is that the Rademacher complexity Radm ( F ) of the complicated functions F has a subscript “ m ” , which explicitly introduces a factor 1/m in the complexity definition ( cf . Section 1.4 ) . As such , sampling more from the data augmentation measure can mitigate this term , and leave the complexity of the distillation class G as the dominant term . Of course , this also requires ‖dµX/dνn‖∞ to be reasonable . As follows is one data augmentation scheme ( and assumption on marginal distribution µX ) which ensures this . Lemma 1.2 . Let ( xi ) ni=1 be a data sample drawn iid from µX , and suppose the corresponding density p is supported on [ 0 , 1 ] d and is Hölder continuous , meaning |p ( x ) − p ( x′ ) | ≤ Cα‖x− x′‖α for some Cα ≥ 0 , α ∈ [ 0 , 1 ] . Define a data augmentation measure νn via the following sampling procedure . • With probability 1/2 , sample z uniformly within [ 0 , 1 ] d. • Otherwise , select a data index i ∈ [ n ] uniformly , and sample z from a Gaussian centered at xi , and having covariance σ2I where σ : = n−1/ ( 2α+d ) . Then with probability at least 1− 1/n over the draw of ( xi ) ni=1 , ∥∥∥∥dµXdνn ∥∥∥∥ ∞ = 4 +O ( √ lnn nα/ ( 2α+d ) ) . Though the idea is not pursued here , there are other ways to control ‖dµX/dνn‖∞ , for instance via an independent sample of unlabeled data ; Lemma 1.1 is agnostic to these choices . 1.2 A CONCRETE BOUND FOR COMPUTATION GRAPHS . This subsection gives an explicit complexity bound which starts from Lemma 1.1 , but bounds ‖dµX/dνn‖∞ via Lemma 1.2 , and also includes an upper bound on Rademacher complexity which can handle the ResNet , as in Figure 1 . A side contribution of this work is the formalism to easily handle these architectures , detailed as follows . Canonical computation graphs are a way to write down feedforward networks which include dense linear layers , convolutional layers , skip connections , and multivariate gates , to name a few , all while allowing the analysis to look roughly like a regular dense network . The construction applies directly to batches : given an input batch X ∈ Rn×d , the output Xi of layer i is defined inductively as XT0 : = X T , XTi : = σi ( [ WiΠiDi|〉Fi ] XTi−1 ) = σi ( [ WiΠiDiX T i−1 FiX T i−1 ] ) , where : σi is a multivariate-to-multivariate ρi-Lipschitz function ( measured over minibatches on either side with Frobenius norm ) ; Fi is a fixed matrix , for instance an identity mapping as in a residual network ’ s skip connection ; Di is a fixed diagonal matrix selecting certain coordinates , for instance the non-skip part in a residual network ; Πi is a Frobenius norm projection of a full minibatch ; Wi is a weight matrix , the trainable parameters ; [ WiΠiDi|〉Fi ] denotes row-wise concatenation of WiΠiDi and Fi . As a simple example of this architecture , a multi-layer skip connection can be modeled by including identity mappings in all relevant fixed matrices Fi , and also including identity mappings in the corresponding coordinates of the multivariate gates σi . As a second example , note how to model convolution layers : each layer outputs a matrix whose rows correspond to examples , but nothing prevents the batch size from changes between layers ; in particular , the multivariate activation before a convolution layer can reshape its output to have each row correspond to a patch of an input image , whereby the convolution filter is now a regular dense weight matrix . A fixed computation graph architecture G ( ~ρ , ~b , ~r , ~s ) has associated hyperparameters ( ~ρ , ~b , ~r , ~s ) , described as follows . ~ρ is the set of Lipschitz constants for each ( multivariate ) gate , as described before . ri is a norm bound ‖W Ti ‖2,1 ≤ ri ( sum of the ‖ · ‖2-norms of the rows ) , bi √ n ( where n is the input batch size ) is the radius of the Frobenius norm ball which Πi is projecting onto , and si is the operator norm of X 7→ [ WiΠiDiXT|〉FiXT ] . While the definition is intricate , it can not only model basic residual networks , but it is sensitive enough to be able to have si = 1 and ri = 0 when residual blocks are fully zeroed out , an effect which indeed occurs during distillation . Theorem 1.3 . Let temperature parameter γ > 0 be given , along with multiclass predictors F , and a computation graph architecture G. Then with probability at least 1− 2δ over an iid draw of data ( ( xi , yi ) ) n i=1 from µ and ( zi ) n i=1 from νn , every f ∈ F satisfies Pr [ arg max y′ f ( x ) y′ 6= y ] ≤ inf ( ~b , ~r , ~s ) ≥1 g∈G ( ~ρ , ~b , ~r , ~s ) 2 [ ∥∥∥∥dµXdνn ∥∥∥∥ ∞ Φγ , m ( f , g ) + 2 n n∑ i=1 ( 1− φγ ( g ( xi ) ) yi + Õ ( k3/2 γ ∥∥∥∥dµXdνn ∥∥∥∥ ∞ Radm ( F ) ) + 6 √ ln ( 1/δ ) 2n ( 1 + ∥∥∥∥dµXdνn ∥∥∥∥ ∞ √ n m ) + Õ ( √ k γ √ n ( 1 + k ∥∥∥∥dµXdνn ∥∥∥∥ ∞ √ n m ) ( ∑ i [ ribiρi L∏ l=i+1 slρl ] 2/3 ) 3/2 ) ] . Under the conditions of Lemma 1.2 , ignoring an additional failure probability 1/n , then ‖dµXdνn ‖∞ = 4 +O ( √ lnn nα/ ( 2α+d ) ) . A proof sketch of this bound appears in Section 3 , with full details deferred to appendices . The proof is a simplification of the covering number argument from ( Bartlett et al. , 2017a ) ; for another computation graph formalism designed to work with the covering number arguments from ( Bartlett et al. , 2017a ) , see the generalization bounds due to Wei & Ma ( 2019 ) .
The paper overall is of good quality. The story of the work is well-written which makes the contributions easier to digest. One suggestion would be to comment a bit more on the relevance of the margin distribution for readers that are unfamiliar with it, for instance, in Figure 1, the term margin distribution is thrown without explaining why one should look into it.
SP:813473d94da9db192e13548da7f92149773062a5
Generalization bounds via distillation
1 OVERVIEW AND MAIN RESULTS . Generalization bounds are statistical tools which take as input various measurements of a predictor on training data , and output a performance estimate for unseen data — that is , they estimate how well the predictor generalizes to unseen data . Despite extensive development spanning many decades ( Anthony & Bartlett , 1999 ) , there is growing concern that these bounds are not only disastrously loose ( Dziugaite & Roy , 2017 ) , but worse that they do not correlate with the underlying phenomena ( Jiang et al. , 2019b ) , and even that the basic method of proof is doomed ( Zhang et al. , 2016 ; Nagarajan & Kolter , 2019 ) . As an explicit demonstration of the looseness of these bounds , Figure 1 calculates bounds for a standard ResNet architecture achieving test errors of respectively 0.008 and 0.067 on mnist and cifar10 ; the observed generalization gap is 10−1 , while standard generalization techniques upper bound it with 1015 . Contrary to this dilemma , there is evidence that these networks can often be compressed or distilled into simpler networks , while still preserving their output values and low test error . Meanwhile , these simpler networks exhibit vastly better generalization bounds : again referring to Figure 1 , those same networks from before can be distilled with hardly any change to their outputs , while their bounds reduce by a factor of roughly 1010 . Distillation is widely studied ( Buciluŭ et al. , 2006 ; Hinton et al. , 2015 ) , but usually the original network is discarded and only the final distilled network is preserved . The purpose of this work is to carry the good generalization bounds of the distilled network back to the original network ; in a sense , the explicit simplicity of the distilled network is used as a witness to implicit simplicity of the original network . The main contributions are as follows . • The main theoretical contribution is a generalization bound for the original , undistilled network which scales primarily with the generalization properties of its distillation , assuming that wellbehaved data augmentation is used to measure the distillation distance . An abstract version of this bound is stated in Lemma 1.1 , along with a sufficient data augmentation technique in Lemma 1.2 . A concrete version of the bound , suitable to handle the ResNet architecture in Figure 1 , is described in Theorem 1.3 . Handling sophisticated architectures with only minor proof alterations is another contribution of this work , and is described alongside Theorem 1.3 . This abstract and concrete analysis is sketched in Section 3 , with full proofs deferred to appendices . • Rather than using an assumption on the distillation process ( e.g. , the aforementioned “ wellbehaved data augmentation ” ) , this work also gives a direct uniform convergence analysis , culminating in Theorem 1.4 . This is presented partially as an open problem or cautionary tale , as its proof is vastly more sophisticated than that of Theorem 1.3 , but ultimately results in a much looser analysis . This analysis is sketched in Section 3 , with full proofs deferred to appendices . • While this work is primarily theoretical , it is motivated by Figure 1 and related experiments : Figures 2 to 4 demonstrate that not only does distillation improve generalization upper bounds , but moreover it makes them sufficiently tight to capture intrinsic properties of the predictors , for example removing the usual bad dependence on width in these bounds ( cf . Figure 3 ) . These experiments are detailed in Section 2 . 1.1 AN ABSTRACT BOUND VIA DATA AUGMENTATION . This subsection describes the basic distillation setup and the core abstract bound based on data augmentation , culminating in Lemmas 1.1 and 1.2 ; a concrete bound follows in Section 1.2 . Given a multi-class predictor f : Rd → Rk , distillation finds another predictor g : Rd → Rk which is simpler , but close in distillation distance Φγ , m , meaning the softmax outputs φγ are close on average over a set of points ( zi ) mi=1 : Φγ , m ( f , g ) : = 1 m m∑ i=1 ∥∥φγ ( f ( zi ) ) − φγ ( g ( zi ) ) ∥∥1 , where φγ ( f ( z ) ) ∝ exp ( f ( z ) /γ ) . ( 1.1 ) The quantity γ > 0 is sometimes called a temperature ( Hinton et al. , 2015 ) . Decreasing γ increases sensitivity near the decision boundary ; in this way , it is naturally related to the concept of margins in generalization theory , as detailed in Appendix B. due to these connections , the use of softmax is beneficial in this work , though not completely standard in the literature ( Buciluŭ et al. , 2006 ) . We can now outline Figure 1 and the associated empirical phenomenon which motivates this work . ( Please see Section 2 for further details on these experiments . ) Consider a predictor f which has good test error but bad generalization bounds ; by treating the distillation distance Φγ , m ( f , g ) as an objective function and increasingly regularizing g , we obtain a sequence of predictors ( g0 , . . . , gt ) , where g0 = f , which trade off between distillation distance and predictor complexity . The curves in Figure 1 are produced in exactly this way , and demonstrate that there are predictors nearly identical to the original f which have vastly smaller generalization bounds . Our goal here is to show that this is enough to imply that f in turn must also have good generalization bounds , despite its apparent complexity . To sketch the idea , by a bit of algebra ( cf . Lemma A.2 ) , we can upper bound error probabilities with expected distillation distances and errors : Prx , y [ arg max y′ f ( x ) y′ 6= y ] ≤ 2Ex ∥∥φγ ( f ( x ) ) − φγ ( g ( x ) ) ∥∥1 + 2Ex , y ( 1− φγ ( g ( x ) ) y ) . The next step is to convert these expected errors into quantities over the training set . The last term is already in a form we want : it depends only on g , so we can apply uniform convergence with the low complexity of g. ( Measured over the training set , this term is the distillation error in Figure 1 . ) The expected distillation distance term is problematic , however . Here are two approaches . 1 . We can directly apply uniform convergence ; for instance , this approach was followed by Suzuki et al . ( 2019 ) , and a more direct approach is followed here to prove Theorem 1.4 . Unfortunately , it is unclear how this technique can avoid paying significantly for the high complexity of f . 2 . The idea in this subsection is to somehow trade off computation for the high statistical cost of the complexity of f . Specifically , notice that Φγ , m ( f , g ) only relies upon the marginal distribution of the inputs x , and not their labels . This subsection will pay computation to estimate Φγ , m with extra samples via data augmentation , offsetting the high complexity of f . We can now set up and state our main distillation bound . Suppose we have a training set ( ( xi , yi ) ) ni=1 drawn from some measure µ , with marginal distribution µX on the inputs x . Suppose we also have ( zi ) m i=1 drawn from a data augmentation distribution νn , the subscript referring to the fact that it depends on ( xi ) ni=1 . Our analysis works when ‖dµX/dνn‖∞ , the ratio between the two densities , is finite . If it is large , then one can tighten the bound by sampling more from νn , which is a computational burden ; explicit bounds on this term will be given shortly in Lemma 1.2 . Lemma 1.1 . Let temperature parameter γ > 0 be given , along with sets of multiclass predictors F and G. Then with probability at least 1 − 2δ over an iid draw of data ( ( xi , yi ) ) ni=1 from µ and ( zi ) m i=1 from νn , every f ∈ F and g ∈ G satisfy Pr [ arg max y′ f ( x ) y′ 6= y ] ≤ 2 ∥∥∥∥dµXdνn ∥∥∥∥ ∞ Φγ , m ( f , g ) + 2 n n∑ i=1 ( 1− φγ ( g ( xi ) ) yi ) + Õ ( k3/2 γ ∥∥∥∥dµXdνn ∥∥∥∥ ∞ ( Radm ( F ) + Radm ( G ) ) + √ k γ Radn ( G ) ) + 6 √ ln ( 1/δ ) 2n ( 1 + ∥∥∥∥dµXdνn ∥∥∥∥ ∞ √ n m ) , where Rademacher complexities Radn and Radm are defined in Section 1.4 . A key point is that the Rademacher complexity Radm ( F ) of the complicated functions F has a subscript “ m ” , which explicitly introduces a factor 1/m in the complexity definition ( cf . Section 1.4 ) . As such , sampling more from the data augmentation measure can mitigate this term , and leave the complexity of the distillation class G as the dominant term . Of course , this also requires ‖dµX/dνn‖∞ to be reasonable . As follows is one data augmentation scheme ( and assumption on marginal distribution µX ) which ensures this . Lemma 1.2 . Let ( xi ) ni=1 be a data sample drawn iid from µX , and suppose the corresponding density p is supported on [ 0 , 1 ] d and is Hölder continuous , meaning |p ( x ) − p ( x′ ) | ≤ Cα‖x− x′‖α for some Cα ≥ 0 , α ∈ [ 0 , 1 ] . Define a data augmentation measure νn via the following sampling procedure . • With probability 1/2 , sample z uniformly within [ 0 , 1 ] d. • Otherwise , select a data index i ∈ [ n ] uniformly , and sample z from a Gaussian centered at xi , and having covariance σ2I where σ : = n−1/ ( 2α+d ) . Then with probability at least 1− 1/n over the draw of ( xi ) ni=1 , ∥∥∥∥dµXdνn ∥∥∥∥ ∞ = 4 +O ( √ lnn nα/ ( 2α+d ) ) . Though the idea is not pursued here , there are other ways to control ‖dµX/dνn‖∞ , for instance via an independent sample of unlabeled data ; Lemma 1.1 is agnostic to these choices . 1.2 A CONCRETE BOUND FOR COMPUTATION GRAPHS . This subsection gives an explicit complexity bound which starts from Lemma 1.1 , but bounds ‖dµX/dνn‖∞ via Lemma 1.2 , and also includes an upper bound on Rademacher complexity which can handle the ResNet , as in Figure 1 . A side contribution of this work is the formalism to easily handle these architectures , detailed as follows . Canonical computation graphs are a way to write down feedforward networks which include dense linear layers , convolutional layers , skip connections , and multivariate gates , to name a few , all while allowing the analysis to look roughly like a regular dense network . The construction applies directly to batches : given an input batch X ∈ Rn×d , the output Xi of layer i is defined inductively as XT0 : = X T , XTi : = σi ( [ WiΠiDi|〉Fi ] XTi−1 ) = σi ( [ WiΠiDiX T i−1 FiX T i−1 ] ) , where : σi is a multivariate-to-multivariate ρi-Lipschitz function ( measured over minibatches on either side with Frobenius norm ) ; Fi is a fixed matrix , for instance an identity mapping as in a residual network ’ s skip connection ; Di is a fixed diagonal matrix selecting certain coordinates , for instance the non-skip part in a residual network ; Πi is a Frobenius norm projection of a full minibatch ; Wi is a weight matrix , the trainable parameters ; [ WiΠiDi|〉Fi ] denotes row-wise concatenation of WiΠiDi and Fi . As a simple example of this architecture , a multi-layer skip connection can be modeled by including identity mappings in all relevant fixed matrices Fi , and also including identity mappings in the corresponding coordinates of the multivariate gates σi . As a second example , note how to model convolution layers : each layer outputs a matrix whose rows correspond to examples , but nothing prevents the batch size from changes between layers ; in particular , the multivariate activation before a convolution layer can reshape its output to have each row correspond to a patch of an input image , whereby the convolution filter is now a regular dense weight matrix . A fixed computation graph architecture G ( ~ρ , ~b , ~r , ~s ) has associated hyperparameters ( ~ρ , ~b , ~r , ~s ) , described as follows . ~ρ is the set of Lipschitz constants for each ( multivariate ) gate , as described before . ri is a norm bound ‖W Ti ‖2,1 ≤ ri ( sum of the ‖ · ‖2-norms of the rows ) , bi √ n ( where n is the input batch size ) is the radius of the Frobenius norm ball which Πi is projecting onto , and si is the operator norm of X 7→ [ WiΠiDiXT|〉FiXT ] . While the definition is intricate , it can not only model basic residual networks , but it is sensitive enough to be able to have si = 1 and ri = 0 when residual blocks are fully zeroed out , an effect which indeed occurs during distillation . Theorem 1.3 . Let temperature parameter γ > 0 be given , along with multiclass predictors F , and a computation graph architecture G. Then with probability at least 1− 2δ over an iid draw of data ( ( xi , yi ) ) n i=1 from µ and ( zi ) n i=1 from νn , every f ∈ F satisfies Pr [ arg max y′ f ( x ) y′ 6= y ] ≤ inf ( ~b , ~r , ~s ) ≥1 g∈G ( ~ρ , ~b , ~r , ~s ) 2 [ ∥∥∥∥dµXdνn ∥∥∥∥ ∞ Φγ , m ( f , g ) + 2 n n∑ i=1 ( 1− φγ ( g ( xi ) ) yi + Õ ( k3/2 γ ∥∥∥∥dµXdνn ∥∥∥∥ ∞ Radm ( F ) ) + 6 √ ln ( 1/δ ) 2n ( 1 + ∥∥∥∥dµXdνn ∥∥∥∥ ∞ √ n m ) + Õ ( √ k γ √ n ( 1 + k ∥∥∥∥dµXdνn ∥∥∥∥ ∞ √ n m ) ( ∑ i [ ribiρi L∏ l=i+1 slρl ] 2/3 ) 3/2 ) ] . Under the conditions of Lemma 1.2 , ignoring an additional failure probability 1/n , then ‖dµXdνn ‖∞ = 4 +O ( √ lnn nα/ ( 2α+d ) ) . A proof sketch of this bound appears in Section 3 , with full details deferred to appendices . The proof is a simplification of the covering number argument from ( Bartlett et al. , 2017a ) ; for another computation graph formalism designed to work with the covering number arguments from ( Bartlett et al. , 2017a ) , see the generalization bounds due to Wei & Ma ( 2019 ) .
The generalization performance of learning algorithms characterizes their ability to generalize their empirical behavior on training examples to unseen test data, which provides an intuitive understanding of how different parameters affect the learning performance and some guides to design learning machines. Different from the traditional error analysis, this paper focuses on bounding the divergence bettween the test error and the training error by the the corresponding distillation error and distillation complexity, e.g., test error is bounded by training error + distillation error + distillation complexity. The current learning theory analysis may be important to understand the theoretical foundations of distillation strategy in deep networks. However, some theoretical issues should be illustrated to improve its readability, e.g,.
SP:813473d94da9db192e13548da7f92149773062a5
Counterfactual Thinking for Long-tailed Information Extraction
1 INTRODUCTION . The goal of Information Extraction ( IE ) ( Sarawagi , 2008 ; Chiticariu et al. , 2013 ) is to detect the structured information from unstructured texts . IE tasks , such as named entity recognition ( NER ) ( Lample et al. , 2016 ) , relation extraction ( RE ) ( Zeng et al. , 2014 ; Peng et al. , 2017 ) and event detection ( ED ) ( Nguyen & Grishman , 2015 ) have developed rapidly with the data-hungry deep learning models trained on a large amount of data . However , in real-world settings , unstructured texts follow a long-tailed distribution ( Doddington et al. , 2004 ) , leading to a significant performance drop on the instance-scarce ( or tail ) classes which have very few instances available . For example , in the ACE2005 ( Doddington et al. , 2004 ) dataset , nearly 70 % of event triggers are long-tailed while they only take up 20 % of training data . On a strong baseline ( Jie & Lu , 2019 ) , the macro F1 score of instance-rich ( or head ) classes can be 71.6 , while the score of tail classes sharply drops to 41.7 . The underlying causes for the above issues are the biased statistical dependencies and spurious correlations between feature representations and classes learned from an imbalanced dataset . For example , an entity Gardens appears 13 times in the training set of OntoNotes5.0 ( Pradhan et al. , 2013 ) , with the NER tag LOC , and only 2 times as organization ORG . A classifier trained on this dataset will build a spurious correlations between Gardens and LOC . As a result , an organization that contains the entity Gardens may be wrongly predicted as a location LOC . There are only a few studies ( Zhang et al. , 2019 ; Han et al. , 2018 ) in the Natural Language Processing ( NLP ) field to address such long-tailed issues . These works mostly rely on external and pre-constructed knowledge graphs , providing useful data-specific prior information which may not be available for other datasets . On the other hand , there are plenty of works from the computer vision society , where the bias is also quite straightforward . Current solutions include re-balanced training ( Lin et al. , 2017 ) that re-balances the contribution of each class in the training stage , transfer learning ( Liu et al. , 2019b ) that takes advantage of the knowledge in data-rich class to boost the performance of instance-scarce classes , decoupling ( Kang et al. , 2019 ) strategy that learns the representations and classifiers separately , and causal inference ( Tang et al. , 2020a ; b ; Abbasnejad et al. , 2020 ) that relies on structured causal models for unbiased scene graph generation , image classification and visual question answering . The aforementioned studies from the computer vision community may not achieve good performance on the textual datasets in the NLP area due to a significant difference between the two fields . For example , unlike images , texts involve complex language structures such as dependency tree and constituent tree that describe the syntactic or semantic level relations between tokens . For the longtailed IE , how to explore the rich relational information as well as complex long-distance interactions among words as conveyed by such linguistic structures remains an open challenge . Furthermore , to capture a more informative context , the way of utilizing the syntax tree for three IE tasks varies : the RE task relies more on the context and entity type rather than entities themselves , while classifications in NER and ED tasks count more on entities than the context . Hence , it is challenging to decide properly on how to utilize language structures for the above three different IE tasks . One may also think that the prevalent pre-trained models such as BERT ( Devlin et al. , 2019 ) may address the long-tailed issues . However , we empirically show that such models still suffer from bias issues . In this paper , we propose CFIE , a novel framework that combines the language structure and counterfactual analysis in causal inference ( Pearl et al. , 2016 ) to alleviate the spurious correlations of the IE tasks including NER , RE and ED . From a causal perspective , counterfactuals ( Bottou et al. , 2013 ; Abbasnejad et al. , 2020 ) state the results of the outcome if certain factors had been different . This concept entails a hypothetical scenario where the values in the causal graph can be altered to study the effect of the factor . Intuitively , the factor that yields the most significant changes in model predictions have the greatest impact and is therefore considered as main effect . Other factors with minor changes are categorized as side effects . In the context of IE with complex language structures , counterfactual analysis answers the question on “ which tokens in the text would be the key clues for RE , NER or ED that could change the prediction result ? ” . With that in mind , our CFIE is proposed to explore the language structure to eliminate the bias caused by the side effect and maintain the main effect for the classification . We evaluate our model on five public datasets across three IE tasks , and achieve significant performance gain on instance-scarce classes . We will release our code to contribute the community . Our major contributions are summarized as : • To the best of our knowledge , our CFIE is the first attempt that marries the counterfactual analysis and language structure to address the long-tailed IE issues . We build different structured causal models ( SCMs ) ( Pearl et al. , 2016 ) for the IE tasks and fuse the dependency structure to the models to better capture the main causality for the classification . • We generate counterfactuals based on syntax structure , where the counterfactuals can be used as interventions to alleviate spurious corrections on models . In doing so , the main effect can be better estimated by the intervention methodology . • We also propose flexible classification debiasing approaches inspired by Total Direct Effect ( TDE ) in causal inference . Our proposed approach is able to make a good balance between the direct effect and counterfactuals representation to achieve more robust predictions . 2 RELATED WORK . Long-tailed Information Extraction : Information extraction tasks , such as relation extraction ( Zeng et al. , 2014 ; Peng et al. , 2017 ; Quirk & Poon , 2017 ) , named entity recognition ( Lample et al. , 2016 ; Chiu & Nichols , 2016 ) , and event extraction ( Nguyen & Grishman , 2015 ; Huang et al. , 2018 ) are fundamental NLP tasks and have been extensively studied in recent years , For the long-tailed IE , recent models ( Lei et al. , 2018 ; Zhang et al. , 2019 ) leverage external rules or transfer knowledge from data-rich classes to the tail classes . Few-shot leaning ( Gao et al. , 2019 ; Obamuyide & Vlachos , 2019 ) has been also applied to IE tasks , although this task focuses more on new classification tasks with only a handful of training instances . Re-balancing/Decoupling Models : Re-balancing approaches include re-sampling strategies ( Mahajan et al. , 2018 ; Wang et al. , 2020a ) that aim to alleviate statistical bias from head classes , and re-weighting approaches ( Milletari et al. , 2016 ; Lin et al. , 2017 ) which assign balanced weights to the losses of training samples from each class to boost the discriminability via robust classifier decision boundaries . These techniques may inevitably suffer the under-fitting/over-fitting issue to head/tail classes ( Tang et al. , 2020a ) . There are also recent studies ( Kang et al. , 2019 ) that decouple the representation learning and the classifier , which effectively mitigate the performance loss caused by direct re-sampling . Casual Inference : Causal inference ( Pearl et al. , 2016 ; Rubin , 2019 ) and counterfactuals have been widely used in psychology , politics and epidemiology for years . There are many studies in computer vision society ( Tang et al. , 2020b ; Abbasnejad et al. , 2020 ; Tang et al. , 2020a ; Niu et al. , 2020 ; Yang et al. , 2020 ; Zhang et al. , 2020 ; Yue et al. , 2020 ) , which use Total Direct Effect ( TDE ) analysis framework and counterfactuals for Scene Graph Generation ( SGG ) , visual question answering , and image classifications . There is also a recent work ( Zeng et al. , 2020 ) that generates counterfactuals for weakly-supervised NER by replacing the target entity with another entity . Our methods differ from the previous works in three aspects : 1 ) We explore the syntax structures of texts for building different causal graphs , 2 ) Counterfactuals are generated based on a task-specific pruned dependency tree . 3 ) Our proposed inference method yields robust predictions for the NER and ED tasks . Model Interpretation : Besides causal inference , there have been plenty of studies ( Molnar , 2020 ) about traditional model interpretation applied in various applications , such as text and image classification ( Ribeiro et al. , 2016 ; Ebrahimi et al. , 2018 ) , question answering ( Feng et al. , 2018 ; Ribeiro et al. , 2018 ) , and machine translation ( Doshi-Velez & Kim , 2017 ) . LIME ( Ribeiro et al. , 2016 ) was proposed to select a set of instances to explain the predictions . The input reduction method ( Feng et al. , 2018 ) is able to find out the most important features and use very few words to obtain the same prediction . Unlike the LIME and input reduction method , the word selections in our CFIE are based on the syntax structure . SEARs ( Ribeiro et al. , 2018 ) induces adversaries by data augmentation during the training phase . Along this line , a recent study ( Kaushik et al. , 2019 ) also uses data augmentation technqiue to provide extra training signal . Our CFIE is orthogonal to data augmenation as it generates counterfactuals during the inference stage , where the counterfactuals are used to mitigate the spurious correlations rather than training the network parameters . 3 MODEL . Figure 1 shows the work flow of our proposed CFIE . We detail these components as follows . 3.1 STEP1 : CAUSAL REPRESENTATION LEARNING . In this step , we train a causal graph on an imbalanced dataset . Our goal here is to teach the model to identify the main cause ( main effect ) and the spurious correlations ( side effect ) for the classification . Structural Causal Models ( SCMs ) : The two well-known causal inference frameworks are SCMs and potential outcomes ( Rubin , 2019 ) which are complementary and theoretically connected . We choose SCMs in our case due to their advantages in expressing and reasoning about the effects of causal relationships among variables . An SCM can be represented as a directed acyclic graph ( DAG ) G = { V , F , U } , where we denote the set of observables ( vertices ) as V = { V1 , ... , Vn } , the set of functions ( directed edges ) as F = { f1 , ... , fn } , and the set of exogenous variables ( e.g . noise ) as U = { U1 , ... , Un } . Note that in the deterministic case where U is given , the value of all variables in the SCM are uniquely determined ( Pearl , 2009 ) . Each observable Vi can be derived from : Vi : = fi ( PAi , Ui ) , ( i = 1 , ... , n ) , ( 1 ) ∀i , PAi ⊆ V\Vi is the set of parents of Vi . Directed edges , such as PAi → Vi in the graph G , i.e. , fi , refers to the direct causation from the parental variables PAi to the child variable Vi . Our Proposed SCMs : Figure 2 ( a ) demonstrates our unified SCMs for IE tasks , which are built based on our prior knowledge for the tasks . The variable S indicates the contextualized representations of an unstructured input sentence , where the representations are the output from a BiLSTM ( Schuster & Paliwal , 1997 ) or pre-trained BERT encoder ( Devlin et al. , 2019 ) . Zi ( i ∈ [ 1 , m ] ) represents features such as the NER tags and part-of-speech ( POS ) tagging . The variable X is the representation of a target relation for RE , entity representation for NER , or trigger representation for ED , and Y indicates the output logits for classification . S X P Y S N X P Y ( a ) ( b ) Let E = { S , X , Z1 , ... , Zm } denotes the parents of Y . The direct causal effects towards Y including X → Y , S → Y , Z1 → Y , .... , Zm → Y are linear transformations . For each edge i → Y , its transformation is denoted as WiY ∈ Rc×d , where i ∈ E and c is the number of classes . We let Hi ∈ Rd×h denote h1 representations with d dimensions for node i ∈ E . Then , the prediction can be obtained by summation Yx = ∑ i∈EWiY Hi or gated mechanism Yx = WgHX σ ( ∑ i∈EWiY Hi ) , where refers to element-wise product , Wg ∈ Rc×d is the linear transformation , and σ ( · ) in- dicates the sigmoid function . To avoid any single edge , such as S → Y , dominating the generation of the logits Yx , we add a cross-entropy loss LiY , i ∈ E for each branch , where i indicates the parent of the node Y . Let LY denote the loss for Yx , the total loss L can be computed by : L = LY + ∑ i∈E LiY ( 2 ) Note that the proposed SCM is encoder neutral . The SCM can be equipped with various encoders , such as BiLSTM , BERT and Roberta ( Liu et al. , 2019a ) . For simplicity , we omit exogenous variables U from the graph as its only useful for the derivations in the following sections . Fusing Syntax Structures Into SCMs : So far we have built basic SCMs for IE tasks . On the edge S → X , we adopt different neural networks architectures for RE , NER and ED . For RE , we use dependency trees to aggregate long-range relations with graph convolution networks ( GCN ) ( Kipf & Welling , 2017 ) . Assume the length of the sentence is h. For the GCN , we generate a matrix A ∈ Rh×h from a dependency tree . The convolution computation for the node i at the l-th layer takes the representation xl−1i from previous layer as input and outputs the updated representations xli . The formulation is given as : xli = σ ( l∑ j=1 AijW lxl−1i + b l ) , i ∈ [ 1 , h ] ( 3 ) where Wl and bl are the weight matrix and bias vector of the l-th layer respectively , and σ ( · ) is the sigmoid function . Here x0 takes value from HS and HX takes value from the output of the last GCN layer xlmax . For NER and ED , we adopt the dependency-guided concatenation approach ( Jie & Lu , 2019 ) . Given a dependency edge ( th , ti , r ) with th as a head ( parent ) , ti as a dependent ( child ) and r is the dependency relation between them , the representations of the dependent ( assume at the 1h is the sequence length for NER and ED , and h = 1 for relation extraction . i-th position of a sentence ) can be denoted as : xi = [ H ( i ) S ; H ( h ) S ; vr ] , th = parent ( ti ) HX = LSTM ( x ) ( 4 ) where H ( i ) S and H ( h ) S are the word representations of the word ti and its parent th , vr denotes the learnable embedding of dependency relation r .
This paper proposes a novel model integrating both causal inference and structure-aware counterfactual training to enhance the long-tail performances of information extraction. The causal mechanism considers a structured causal model that takes into account all possible cause-effect relations for the final predictions, including contexts, target representations, POS tags, NERs, etc. They also implement counterfactual training strategy by selecting the most important factors and wipe off the side effects to enhance the long-tail situations.
SP:0fa59beb93e339dc3612719931b206653916b8b5
Counterfactual Thinking for Long-tailed Information Extraction
1 INTRODUCTION . The goal of Information Extraction ( IE ) ( Sarawagi , 2008 ; Chiticariu et al. , 2013 ) is to detect the structured information from unstructured texts . IE tasks , such as named entity recognition ( NER ) ( Lample et al. , 2016 ) , relation extraction ( RE ) ( Zeng et al. , 2014 ; Peng et al. , 2017 ) and event detection ( ED ) ( Nguyen & Grishman , 2015 ) have developed rapidly with the data-hungry deep learning models trained on a large amount of data . However , in real-world settings , unstructured texts follow a long-tailed distribution ( Doddington et al. , 2004 ) , leading to a significant performance drop on the instance-scarce ( or tail ) classes which have very few instances available . For example , in the ACE2005 ( Doddington et al. , 2004 ) dataset , nearly 70 % of event triggers are long-tailed while they only take up 20 % of training data . On a strong baseline ( Jie & Lu , 2019 ) , the macro F1 score of instance-rich ( or head ) classes can be 71.6 , while the score of tail classes sharply drops to 41.7 . The underlying causes for the above issues are the biased statistical dependencies and spurious correlations between feature representations and classes learned from an imbalanced dataset . For example , an entity Gardens appears 13 times in the training set of OntoNotes5.0 ( Pradhan et al. , 2013 ) , with the NER tag LOC , and only 2 times as organization ORG . A classifier trained on this dataset will build a spurious correlations between Gardens and LOC . As a result , an organization that contains the entity Gardens may be wrongly predicted as a location LOC . There are only a few studies ( Zhang et al. , 2019 ; Han et al. , 2018 ) in the Natural Language Processing ( NLP ) field to address such long-tailed issues . These works mostly rely on external and pre-constructed knowledge graphs , providing useful data-specific prior information which may not be available for other datasets . On the other hand , there are plenty of works from the computer vision society , where the bias is also quite straightforward . Current solutions include re-balanced training ( Lin et al. , 2017 ) that re-balances the contribution of each class in the training stage , transfer learning ( Liu et al. , 2019b ) that takes advantage of the knowledge in data-rich class to boost the performance of instance-scarce classes , decoupling ( Kang et al. , 2019 ) strategy that learns the representations and classifiers separately , and causal inference ( Tang et al. , 2020a ; b ; Abbasnejad et al. , 2020 ) that relies on structured causal models for unbiased scene graph generation , image classification and visual question answering . The aforementioned studies from the computer vision community may not achieve good performance on the textual datasets in the NLP area due to a significant difference between the two fields . For example , unlike images , texts involve complex language structures such as dependency tree and constituent tree that describe the syntactic or semantic level relations between tokens . For the longtailed IE , how to explore the rich relational information as well as complex long-distance interactions among words as conveyed by such linguistic structures remains an open challenge . Furthermore , to capture a more informative context , the way of utilizing the syntax tree for three IE tasks varies : the RE task relies more on the context and entity type rather than entities themselves , while classifications in NER and ED tasks count more on entities than the context . Hence , it is challenging to decide properly on how to utilize language structures for the above three different IE tasks . One may also think that the prevalent pre-trained models such as BERT ( Devlin et al. , 2019 ) may address the long-tailed issues . However , we empirically show that such models still suffer from bias issues . In this paper , we propose CFIE , a novel framework that combines the language structure and counterfactual analysis in causal inference ( Pearl et al. , 2016 ) to alleviate the spurious correlations of the IE tasks including NER , RE and ED . From a causal perspective , counterfactuals ( Bottou et al. , 2013 ; Abbasnejad et al. , 2020 ) state the results of the outcome if certain factors had been different . This concept entails a hypothetical scenario where the values in the causal graph can be altered to study the effect of the factor . Intuitively , the factor that yields the most significant changes in model predictions have the greatest impact and is therefore considered as main effect . Other factors with minor changes are categorized as side effects . In the context of IE with complex language structures , counterfactual analysis answers the question on “ which tokens in the text would be the key clues for RE , NER or ED that could change the prediction result ? ” . With that in mind , our CFIE is proposed to explore the language structure to eliminate the bias caused by the side effect and maintain the main effect for the classification . We evaluate our model on five public datasets across three IE tasks , and achieve significant performance gain on instance-scarce classes . We will release our code to contribute the community . Our major contributions are summarized as : • To the best of our knowledge , our CFIE is the first attempt that marries the counterfactual analysis and language structure to address the long-tailed IE issues . We build different structured causal models ( SCMs ) ( Pearl et al. , 2016 ) for the IE tasks and fuse the dependency structure to the models to better capture the main causality for the classification . • We generate counterfactuals based on syntax structure , where the counterfactuals can be used as interventions to alleviate spurious corrections on models . In doing so , the main effect can be better estimated by the intervention methodology . • We also propose flexible classification debiasing approaches inspired by Total Direct Effect ( TDE ) in causal inference . Our proposed approach is able to make a good balance between the direct effect and counterfactuals representation to achieve more robust predictions . 2 RELATED WORK . Long-tailed Information Extraction : Information extraction tasks , such as relation extraction ( Zeng et al. , 2014 ; Peng et al. , 2017 ; Quirk & Poon , 2017 ) , named entity recognition ( Lample et al. , 2016 ; Chiu & Nichols , 2016 ) , and event extraction ( Nguyen & Grishman , 2015 ; Huang et al. , 2018 ) are fundamental NLP tasks and have been extensively studied in recent years , For the long-tailed IE , recent models ( Lei et al. , 2018 ; Zhang et al. , 2019 ) leverage external rules or transfer knowledge from data-rich classes to the tail classes . Few-shot leaning ( Gao et al. , 2019 ; Obamuyide & Vlachos , 2019 ) has been also applied to IE tasks , although this task focuses more on new classification tasks with only a handful of training instances . Re-balancing/Decoupling Models : Re-balancing approaches include re-sampling strategies ( Mahajan et al. , 2018 ; Wang et al. , 2020a ) that aim to alleviate statistical bias from head classes , and re-weighting approaches ( Milletari et al. , 2016 ; Lin et al. , 2017 ) which assign balanced weights to the losses of training samples from each class to boost the discriminability via robust classifier decision boundaries . These techniques may inevitably suffer the under-fitting/over-fitting issue to head/tail classes ( Tang et al. , 2020a ) . There are also recent studies ( Kang et al. , 2019 ) that decouple the representation learning and the classifier , which effectively mitigate the performance loss caused by direct re-sampling . Casual Inference : Causal inference ( Pearl et al. , 2016 ; Rubin , 2019 ) and counterfactuals have been widely used in psychology , politics and epidemiology for years . There are many studies in computer vision society ( Tang et al. , 2020b ; Abbasnejad et al. , 2020 ; Tang et al. , 2020a ; Niu et al. , 2020 ; Yang et al. , 2020 ; Zhang et al. , 2020 ; Yue et al. , 2020 ) , which use Total Direct Effect ( TDE ) analysis framework and counterfactuals for Scene Graph Generation ( SGG ) , visual question answering , and image classifications . There is also a recent work ( Zeng et al. , 2020 ) that generates counterfactuals for weakly-supervised NER by replacing the target entity with another entity . Our methods differ from the previous works in three aspects : 1 ) We explore the syntax structures of texts for building different causal graphs , 2 ) Counterfactuals are generated based on a task-specific pruned dependency tree . 3 ) Our proposed inference method yields robust predictions for the NER and ED tasks . Model Interpretation : Besides causal inference , there have been plenty of studies ( Molnar , 2020 ) about traditional model interpretation applied in various applications , such as text and image classification ( Ribeiro et al. , 2016 ; Ebrahimi et al. , 2018 ) , question answering ( Feng et al. , 2018 ; Ribeiro et al. , 2018 ) , and machine translation ( Doshi-Velez & Kim , 2017 ) . LIME ( Ribeiro et al. , 2016 ) was proposed to select a set of instances to explain the predictions . The input reduction method ( Feng et al. , 2018 ) is able to find out the most important features and use very few words to obtain the same prediction . Unlike the LIME and input reduction method , the word selections in our CFIE are based on the syntax structure . SEARs ( Ribeiro et al. , 2018 ) induces adversaries by data augmentation during the training phase . Along this line , a recent study ( Kaushik et al. , 2019 ) also uses data augmentation technqiue to provide extra training signal . Our CFIE is orthogonal to data augmenation as it generates counterfactuals during the inference stage , where the counterfactuals are used to mitigate the spurious correlations rather than training the network parameters . 3 MODEL . Figure 1 shows the work flow of our proposed CFIE . We detail these components as follows . 3.1 STEP1 : CAUSAL REPRESENTATION LEARNING . In this step , we train a causal graph on an imbalanced dataset . Our goal here is to teach the model to identify the main cause ( main effect ) and the spurious correlations ( side effect ) for the classification . Structural Causal Models ( SCMs ) : The two well-known causal inference frameworks are SCMs and potential outcomes ( Rubin , 2019 ) which are complementary and theoretically connected . We choose SCMs in our case due to their advantages in expressing and reasoning about the effects of causal relationships among variables . An SCM can be represented as a directed acyclic graph ( DAG ) G = { V , F , U } , where we denote the set of observables ( vertices ) as V = { V1 , ... , Vn } , the set of functions ( directed edges ) as F = { f1 , ... , fn } , and the set of exogenous variables ( e.g . noise ) as U = { U1 , ... , Un } . Note that in the deterministic case where U is given , the value of all variables in the SCM are uniquely determined ( Pearl , 2009 ) . Each observable Vi can be derived from : Vi : = fi ( PAi , Ui ) , ( i = 1 , ... , n ) , ( 1 ) ∀i , PAi ⊆ V\Vi is the set of parents of Vi . Directed edges , such as PAi → Vi in the graph G , i.e. , fi , refers to the direct causation from the parental variables PAi to the child variable Vi . Our Proposed SCMs : Figure 2 ( a ) demonstrates our unified SCMs for IE tasks , which are built based on our prior knowledge for the tasks . The variable S indicates the contextualized representations of an unstructured input sentence , where the representations are the output from a BiLSTM ( Schuster & Paliwal , 1997 ) or pre-trained BERT encoder ( Devlin et al. , 2019 ) . Zi ( i ∈ [ 1 , m ] ) represents features such as the NER tags and part-of-speech ( POS ) tagging . The variable X is the representation of a target relation for RE , entity representation for NER , or trigger representation for ED , and Y indicates the output logits for classification . S X P Y S N X P Y ( a ) ( b ) Let E = { S , X , Z1 , ... , Zm } denotes the parents of Y . The direct causal effects towards Y including X → Y , S → Y , Z1 → Y , .... , Zm → Y are linear transformations . For each edge i → Y , its transformation is denoted as WiY ∈ Rc×d , where i ∈ E and c is the number of classes . We let Hi ∈ Rd×h denote h1 representations with d dimensions for node i ∈ E . Then , the prediction can be obtained by summation Yx = ∑ i∈EWiY Hi or gated mechanism Yx = WgHX σ ( ∑ i∈EWiY Hi ) , where refers to element-wise product , Wg ∈ Rc×d is the linear transformation , and σ ( · ) in- dicates the sigmoid function . To avoid any single edge , such as S → Y , dominating the generation of the logits Yx , we add a cross-entropy loss LiY , i ∈ E for each branch , where i indicates the parent of the node Y . Let LY denote the loss for Yx , the total loss L can be computed by : L = LY + ∑ i∈E LiY ( 2 ) Note that the proposed SCM is encoder neutral . The SCM can be equipped with various encoders , such as BiLSTM , BERT and Roberta ( Liu et al. , 2019a ) . For simplicity , we omit exogenous variables U from the graph as its only useful for the derivations in the following sections . Fusing Syntax Structures Into SCMs : So far we have built basic SCMs for IE tasks . On the edge S → X , we adopt different neural networks architectures for RE , NER and ED . For RE , we use dependency trees to aggregate long-range relations with graph convolution networks ( GCN ) ( Kipf & Welling , 2017 ) . Assume the length of the sentence is h. For the GCN , we generate a matrix A ∈ Rh×h from a dependency tree . The convolution computation for the node i at the l-th layer takes the representation xl−1i from previous layer as input and outputs the updated representations xli . The formulation is given as : xli = σ ( l∑ j=1 AijW lxl−1i + b l ) , i ∈ [ 1 , h ] ( 3 ) where Wl and bl are the weight matrix and bias vector of the l-th layer respectively , and σ ( · ) is the sigmoid function . Here x0 takes value from HS and HX takes value from the output of the last GCN layer xlmax . For NER and ED , we adopt the dependency-guided concatenation approach ( Jie & Lu , 2019 ) . Given a dependency edge ( th , ti , r ) with th as a head ( parent ) , ti as a dependent ( child ) and r is the dependency relation between them , the representations of the dependent ( assume at the 1h is the sequence length for NER and ED , and h = 1 for relation extraction . i-th position of a sentence ) can be denoted as : xi = [ H ( i ) S ; H ( h ) S ; vr ] , th = parent ( ti ) HX = LSTM ( x ) ( 4 ) where H ( i ) S and H ( h ) S are the word representations of the word ti and its parent th , vr denotes the learnable embedding of dependency relation r .
The novelty of the paper seems to be in application of the counterfactual analysis to address the long-tailed IE issues, which might be interesting to the IE researchers. Overall, more theory about the counterfactual generation for IE task should be added, for this is what the novelty of the paper; also, for the rebalancing learning for slide effect and counterfactual, the theory appears to be not enough. The weak of this work is the theoretical and conceptual underpinnings of the proposed methodology.
SP:0fa59beb93e339dc3612719931b206653916b8b5
The geometry of integration in text classification RNNs
1 INTRODUCTION . Modern recurrent neural networks ( RNNs ) can achieve strong performance in natural language processing ( NLP ) tasks such as sentiment analysis , document classification , language modeling , and machine translation . However , the inner workings of these networks remain largely mysterious . As RNNs are parameterized dynamical systems tuned to perform specific tasks , a natural way to understand them is to leverage tools from dynamical systems analysis . A challenge inherent to this approach is that the state space of modern RNN architectures—the number of units comprising the hidden state—is often high-dimensional , with layers routinely comprising hundreds of neurons . This dimensionality renders the application of standard representation techniques , such as phase portraits , difficult . Another difficulty arises from the fact that RNNs are monolithic systems trained end-toend . Instead of modular components with clearly delineated responsibilities that can be understood and tested independently , neural networks could learn an intertwined blend of different mechanisms needed to solve a task , making understanding them that much harder . ∗Work started while an intern at Google . †Equal contribution . Recent work has shown that modern RNN architectures trained on binary sentiment classification learn low-dimensional , interpretable dynamical systems ( Maheswaranathan et al. , 2019 ) . These RNNs were found to implement an integration-like mechanism , moving their hidden states along a line of stable fixed points to keep track of accumulated positive and negative tokens . Later , Maheswaranathan & Sussillo ( 2020 ) showed that contextual processing mechanisms in these networks— e.g . for handling phrases like not good—build on top of the line-integration mechanism , employing an additional subspace which the network enters upon encountering a modifier word . The understanding achieved in those works suggests the potential of the dynamical systems perspective , but it remained to be seen whether this perspective could shed light on RNNs in more complicated settings . In this work , we take steps towards understanding RNN dynamics in more complicated language tasks , illustrating recurrent network dynamics in multiple text-classification tasks with more than two categories . The tasks we study—document classification , review score prediction ( from one to five stars ) , and emotion tagging—exemplify three distinct types of classification tasks . As in the binary sentiment case , we find integration of evidence to underlie the operations of these networks ; however , in multi-class classification , the geometry and dimensionality of the integration manifold depend on the type of task and the structure of the training data . Understanding and precisely characterizing this dependence is the focus of the present work . Our contributions . • We study three distinct types of text-classification tasks—categorical , ordered , and multilabeled—and find empirically that the resulting hidden state trajectories lie largely in a lowdimensional subspace of the full state space . • Within this low-dimensional subspace , we find a manifold of approximately stable fixed points1 near the network trajectories , and by linearizing the network dynamics , we show that this manifold enables the networks to integrate evidence for each classification as they processes the sequence . • We find ( N − 1 ) -dimensional simplex attractors2 for N -class categorical classification , planar attractors for ordered classification , and attractors resembling hypercubes for multi-label classification , explaining these geometries in terms of the dataset statistics . • We show that the dimensionality and geometry of the manifold reflects characteristics of the training dataset , and demonstrate that simple word-count statistics of the dataset can explain the observed geometries . • We develop clean , simple synthetic datasets for each type of classification task . Networks trained on these synthetic datasets exhibit similar dynamics and manifold geometries to networks trained on corresponding natural datasets , furthering an understanding of the underlying mechanism . Related work Our work builds directly on previous analyses of binary sentiment classification by Maheswaranathan et al . ( 2019 ) and Maheswaranathan & Sussillo ( 2020 ) . Apart from these works , the dynamical properties of continuous-time RNNs have been extensively studied ( Vyas et al. , 2020 ) , largely for connections to neural computation in biological systems . Such analyses have recently begun to yield insights on discrete-time RNNs : for example , Schuessler et al . ( 2020 ) showed that training continuous-time RNNs on low-dimensional tasks led to low-dimensional updates to the networks ’ weight matrices ; this observation held empirically in binary sentiment LSTMs as well . Similarly , by viewing the discrete-time GRU as a discretization of a continuous-time dynamical system , Jordan et al . ( 2019 ) demonstrated that the continuous-time analogue could express a wide variety of dynamical features , including essentially nonlinear features like limit cycles . Understanding and interpreting learned neural networks is a rapidly-growing field . Specifically in the context of natural language processing , the body of work on interpretability of neural models is reviewed thoroughly in Belinkov & Glass ( 2018 ) . Common methods of analysis include , for example , training auxiliary classifiers ( e.g. , part-of-speech ) on RNN trajectories to probe the network ’ s 1As will be discussed in more detail below , by fixed points we mean hidden state locations that are approximately fixed on time-scales of order of the average phrase length for the task at hand . Throughout this work we will use the term fixed point manifold to be synonymous with manifolds of slow points . 2A 1-simplex is a line segment , a 2-simplex a triangle , a 3-simplex a tetrahedron , etc . A simplex is regular if it has the highest degree of symmetry ( e.g . an equilateral triangle is a regular 2-simplex ) . representations ; use of challenge sets to capture wider language phenomena than seen in natural corpora ; and visualization of hidden unit activations as in Karpathy et al . ( 2015 ) and Radford et al . ( 2017 ) . 2 SETUP . Models We study three common RNN architectures : LSTMs ( Hochreiter & Schmidhuber , 1997 ) , GRUs ( Cho et al. , 2014 ) , and UGRNNs ( Collins et al. , 2016 ) . We denote their n-dimensional hidden state and d-dimensional input at time t as ht and xt , respectively . The function that applies hidden state update for these networks will be denoted by F , so that ht = F ( ht−1 , xt ) . The network ’ s hidden state after the entire example is processed , hT , is fed through a linear layer to get N output logits for each label : y = WhT + b . We call the rows of W ‘ readout vectors ’ and denote the readout corresponding to the ith neuron by ri , for i = 1 , . . . , N . Throughout the main text , we will present results for the GRU architecture . Qualitative features of results were found to be constant across all architectures ; additional results for LSTMs and UGRNNs are given in Appendix E. Tasks The classification tasks we study fall into three categories . In the categorical case , samples are classified into non-overlapping classes , for example “ sports ” or “ politics ” . By contrast , in the ordered case , there is a natural ordering among labels : for example , predicting a numerical rating ( say , out of five stars ) accompanying a user ’ s review . Like the categorical labels , ordered labels are exclusive . Some tasks , however , involve labels which may not be exclusive ; an example of this multi-labeled case is tagging a document for the presence of one or more emotions . A detailed description of the natural and synthetic datasets used is provided in Appendices C and D , respectively . Linearization and eigenmodes Part of our analysis relies on linearization to render the complex RNN dynamics tractable . This linearization is possible because , as we will see , the RNN states visited during training and inference lie near approximate fixed points h∗ of the dynamics—points that the update equation leave ( approximately ) unchanged , i.e . for which h∗ ≈ F ( h∗ , x ) .3 Near these points , the dynamics of the displacement ∆ht : = ht − h∗ from the fixed point h∗ is well approximated by the linearization ∆ht ≈ Jrec| ( h∗ , x∗ ) ∆ht−1 + J inp ∣∣ ( h∗ , x∗ ) ( xt − x∗ ) , ( 1 ) where we have defined the recurrent and input Jacobians J recij ( h , x ) : = ∂F ( h , x ) i ∂hj and J inpij ( h , x ) : = ∂F ( h , x ) i ∂xj , respectively ( see Appendix A for details ) . In the linear approximation , the spectrum of Jrec plays a key role in the resulting dynamics . Each eigenmode of Jrec represents a displacement whose magnitude either grows or shrinks exponentially in time , with a timescale τa determined by the magnitude of the corresponding ( complex ) eigenvalue λa via the relation τa : = |log |λa||−1 . Thus , eigenvalues within the unit circle thus represent stable ( decaying ) modes , while those outside represent unstable ( growing ) modes . The Jacobians we find in practice almost exclusively have stable modes , most of which decay on very short timescales ( a few tokens ) . Eigenmodes near the unit circle have long timescales , and therefore facilitate the network ’ s storage of information . Latent semantic analysis For a given text classification task , one can summarize the data by building a matrix of word or token counts for each class ( analogous to a document-term matrix ( Manning & Schutze , 1999 ) , where the documents are classes ) . Here , the i , j entry corresponds to the number of times the ith word in the vocabulary appears in examples belonging to the jth class . In effect , the column corresponding to a given word forms an “ evidence vector ” , i.e . a large entry in an particular row suggests strong evidence for the corresponding class . Latent semantic analysis ( LSA ) ( Deerwester et al. , 1990 ) looks for structure in this matrix via a singular value decomposition ( SVD ) ; if the evidence vectors lie predominantly in a low-dimensional subspace , LSA will pick up on this structure . The top singular modes define a “ semantic space ” : the left singular vectors correspond to the projections of each class label into this space , and the right singular vectors correspond to how individual tokens are represented in this space . 3Although the fixed point expression depends on the input x , throughout this text we will only study fixed points with the zero input . That is , we focus on the autonomous dynamical system given by ht+1 = F ( ht , 0 ) ( see Appendix A for details ) . Below , we will show that RNNs trained on classification tasks pick up on the same structure in the dataset as LSA ; the dimensionality and geometry of the semantic space predicts corresponding features of the RNNs . Regularization While the main text focuses on the interaction between dataset statistics and resulting network dimensionality , regularization also plays a role in determining the dynamical structures . In particular , strongly regularizing the network can reduce the dimensionality of the resulting manifolds , while weakly regularizing can increase the dimensionality . Focusing on ` 2-regularization , we document this effect for the synthetic and natural datasets in Appendicies D.1 and F , respectively .
This paper sheds light on how trained RNNs solve text classification problems by analyzing them from a dynamical systems perspective. It extends recent work where a similar analysis was applied to the simpler setting of binary sentiment classification. When projecting the RNN hidden states to principal dimensions that explain most of the variance, the authors find (N-1) dimensional simplex attractors for N-dimensional classification, 2D attractors for ordered classification, and N-dimensional hypercubes for multi-label classification.
SP:b2f83cd755f4da835e943237e2ba6faf69e8008a
The geometry of integration in text classification RNNs
1 INTRODUCTION . Modern recurrent neural networks ( RNNs ) can achieve strong performance in natural language processing ( NLP ) tasks such as sentiment analysis , document classification , language modeling , and machine translation . However , the inner workings of these networks remain largely mysterious . As RNNs are parameterized dynamical systems tuned to perform specific tasks , a natural way to understand them is to leverage tools from dynamical systems analysis . A challenge inherent to this approach is that the state space of modern RNN architectures—the number of units comprising the hidden state—is often high-dimensional , with layers routinely comprising hundreds of neurons . This dimensionality renders the application of standard representation techniques , such as phase portraits , difficult . Another difficulty arises from the fact that RNNs are monolithic systems trained end-toend . Instead of modular components with clearly delineated responsibilities that can be understood and tested independently , neural networks could learn an intertwined blend of different mechanisms needed to solve a task , making understanding them that much harder . ∗Work started while an intern at Google . †Equal contribution . Recent work has shown that modern RNN architectures trained on binary sentiment classification learn low-dimensional , interpretable dynamical systems ( Maheswaranathan et al. , 2019 ) . These RNNs were found to implement an integration-like mechanism , moving their hidden states along a line of stable fixed points to keep track of accumulated positive and negative tokens . Later , Maheswaranathan & Sussillo ( 2020 ) showed that contextual processing mechanisms in these networks— e.g . for handling phrases like not good—build on top of the line-integration mechanism , employing an additional subspace which the network enters upon encountering a modifier word . The understanding achieved in those works suggests the potential of the dynamical systems perspective , but it remained to be seen whether this perspective could shed light on RNNs in more complicated settings . In this work , we take steps towards understanding RNN dynamics in more complicated language tasks , illustrating recurrent network dynamics in multiple text-classification tasks with more than two categories . The tasks we study—document classification , review score prediction ( from one to five stars ) , and emotion tagging—exemplify three distinct types of classification tasks . As in the binary sentiment case , we find integration of evidence to underlie the operations of these networks ; however , in multi-class classification , the geometry and dimensionality of the integration manifold depend on the type of task and the structure of the training data . Understanding and precisely characterizing this dependence is the focus of the present work . Our contributions . • We study three distinct types of text-classification tasks—categorical , ordered , and multilabeled—and find empirically that the resulting hidden state trajectories lie largely in a lowdimensional subspace of the full state space . • Within this low-dimensional subspace , we find a manifold of approximately stable fixed points1 near the network trajectories , and by linearizing the network dynamics , we show that this manifold enables the networks to integrate evidence for each classification as they processes the sequence . • We find ( N − 1 ) -dimensional simplex attractors2 for N -class categorical classification , planar attractors for ordered classification , and attractors resembling hypercubes for multi-label classification , explaining these geometries in terms of the dataset statistics . • We show that the dimensionality and geometry of the manifold reflects characteristics of the training dataset , and demonstrate that simple word-count statistics of the dataset can explain the observed geometries . • We develop clean , simple synthetic datasets for each type of classification task . Networks trained on these synthetic datasets exhibit similar dynamics and manifold geometries to networks trained on corresponding natural datasets , furthering an understanding of the underlying mechanism . Related work Our work builds directly on previous analyses of binary sentiment classification by Maheswaranathan et al . ( 2019 ) and Maheswaranathan & Sussillo ( 2020 ) . Apart from these works , the dynamical properties of continuous-time RNNs have been extensively studied ( Vyas et al. , 2020 ) , largely for connections to neural computation in biological systems . Such analyses have recently begun to yield insights on discrete-time RNNs : for example , Schuessler et al . ( 2020 ) showed that training continuous-time RNNs on low-dimensional tasks led to low-dimensional updates to the networks ’ weight matrices ; this observation held empirically in binary sentiment LSTMs as well . Similarly , by viewing the discrete-time GRU as a discretization of a continuous-time dynamical system , Jordan et al . ( 2019 ) demonstrated that the continuous-time analogue could express a wide variety of dynamical features , including essentially nonlinear features like limit cycles . Understanding and interpreting learned neural networks is a rapidly-growing field . Specifically in the context of natural language processing , the body of work on interpretability of neural models is reviewed thoroughly in Belinkov & Glass ( 2018 ) . Common methods of analysis include , for example , training auxiliary classifiers ( e.g. , part-of-speech ) on RNN trajectories to probe the network ’ s 1As will be discussed in more detail below , by fixed points we mean hidden state locations that are approximately fixed on time-scales of order of the average phrase length for the task at hand . Throughout this work we will use the term fixed point manifold to be synonymous with manifolds of slow points . 2A 1-simplex is a line segment , a 2-simplex a triangle , a 3-simplex a tetrahedron , etc . A simplex is regular if it has the highest degree of symmetry ( e.g . an equilateral triangle is a regular 2-simplex ) . representations ; use of challenge sets to capture wider language phenomena than seen in natural corpora ; and visualization of hidden unit activations as in Karpathy et al . ( 2015 ) and Radford et al . ( 2017 ) . 2 SETUP . Models We study three common RNN architectures : LSTMs ( Hochreiter & Schmidhuber , 1997 ) , GRUs ( Cho et al. , 2014 ) , and UGRNNs ( Collins et al. , 2016 ) . We denote their n-dimensional hidden state and d-dimensional input at time t as ht and xt , respectively . The function that applies hidden state update for these networks will be denoted by F , so that ht = F ( ht−1 , xt ) . The network ’ s hidden state after the entire example is processed , hT , is fed through a linear layer to get N output logits for each label : y = WhT + b . We call the rows of W ‘ readout vectors ’ and denote the readout corresponding to the ith neuron by ri , for i = 1 , . . . , N . Throughout the main text , we will present results for the GRU architecture . Qualitative features of results were found to be constant across all architectures ; additional results for LSTMs and UGRNNs are given in Appendix E. Tasks The classification tasks we study fall into three categories . In the categorical case , samples are classified into non-overlapping classes , for example “ sports ” or “ politics ” . By contrast , in the ordered case , there is a natural ordering among labels : for example , predicting a numerical rating ( say , out of five stars ) accompanying a user ’ s review . Like the categorical labels , ordered labels are exclusive . Some tasks , however , involve labels which may not be exclusive ; an example of this multi-labeled case is tagging a document for the presence of one or more emotions . A detailed description of the natural and synthetic datasets used is provided in Appendices C and D , respectively . Linearization and eigenmodes Part of our analysis relies on linearization to render the complex RNN dynamics tractable . This linearization is possible because , as we will see , the RNN states visited during training and inference lie near approximate fixed points h∗ of the dynamics—points that the update equation leave ( approximately ) unchanged , i.e . for which h∗ ≈ F ( h∗ , x ) .3 Near these points , the dynamics of the displacement ∆ht : = ht − h∗ from the fixed point h∗ is well approximated by the linearization ∆ht ≈ Jrec| ( h∗ , x∗ ) ∆ht−1 + J inp ∣∣ ( h∗ , x∗ ) ( xt − x∗ ) , ( 1 ) where we have defined the recurrent and input Jacobians J recij ( h , x ) : = ∂F ( h , x ) i ∂hj and J inpij ( h , x ) : = ∂F ( h , x ) i ∂xj , respectively ( see Appendix A for details ) . In the linear approximation , the spectrum of Jrec plays a key role in the resulting dynamics . Each eigenmode of Jrec represents a displacement whose magnitude either grows or shrinks exponentially in time , with a timescale τa determined by the magnitude of the corresponding ( complex ) eigenvalue λa via the relation τa : = |log |λa||−1 . Thus , eigenvalues within the unit circle thus represent stable ( decaying ) modes , while those outside represent unstable ( growing ) modes . The Jacobians we find in practice almost exclusively have stable modes , most of which decay on very short timescales ( a few tokens ) . Eigenmodes near the unit circle have long timescales , and therefore facilitate the network ’ s storage of information . Latent semantic analysis For a given text classification task , one can summarize the data by building a matrix of word or token counts for each class ( analogous to a document-term matrix ( Manning & Schutze , 1999 ) , where the documents are classes ) . Here , the i , j entry corresponds to the number of times the ith word in the vocabulary appears in examples belonging to the jth class . In effect , the column corresponding to a given word forms an “ evidence vector ” , i.e . a large entry in an particular row suggests strong evidence for the corresponding class . Latent semantic analysis ( LSA ) ( Deerwester et al. , 1990 ) looks for structure in this matrix via a singular value decomposition ( SVD ) ; if the evidence vectors lie predominantly in a low-dimensional subspace , LSA will pick up on this structure . The top singular modes define a “ semantic space ” : the left singular vectors correspond to the projections of each class label into this space , and the right singular vectors correspond to how individual tokens are represented in this space . 3Although the fixed point expression depends on the input x , throughout this text we will only study fixed points with the zero input . That is , we focus on the autonomous dynamical system given by ht+1 = F ( ht , 0 ) ( see Appendix A for details ) . Below , we will show that RNNs trained on classification tasks pick up on the same structure in the dataset as LSA ; the dimensionality and geometry of the semantic space predicts corresponding features of the RNNs . Regularization While the main text focuses on the interaction between dataset statistics and resulting network dimensionality , regularization also plays a role in determining the dynamical structures . In particular , strongly regularizing the network can reduce the dimensionality of the resulting manifolds , while weakly regularizing can increase the dimensionality . Focusing on ` 2-regularization , we document this effect for the synthetic and natural datasets in Appendicies D.1 and F , respectively .
This paper presents an analysis on the trained recurrent neural networks (RNN) especially for NLP classification problems. The analysis takes the dynamical systems point of view and investigates the dynamics by looking at the Jacobians around the fixed points. This work founds low dimensionalility and attractor dynamics in the RNNs which might lead to a better undertanding of RNNs.
SP:b2f83cd755f4da835e943237e2ba6faf69e8008a
Deep Kernel Processes
1 INTRODUCTION . The deep learning revolution has shown us that effective performance on difficult tasks such as image classification ( Krizhevsky et al. , 2012 ) requires deep models with flexible lower-layers that learn task-dependent representations . Here , we consider whether these insights from the neural network literature can be applied to purely kernel-based methods . ( Note that we do not consider deep Gaussian processes or DGPs to be “ fully kernel-based ” as they use a feature-based representation in intermediate layers ) . Importantly , deep kernel methods ( e.g . Cho & Saul , 2009 ) already exist . In these methods , which are closely related to infinite Bayesian neural networks ( Lee et al. , 2017 ; Matthews et al. , 2018 ; Garriga-Alonso et al. , 2018 ; Novak et al. , 2018 ) , we take an initial kernel ( usually the dot product of the input features ) and perform a series of deterministic , parameter-free transformations to obtain an output kernel that we use in e.g . a support vector machine or Gaussian process . However , the deterministic , parameter-free nature of the transformation from input to output kernel means that they lack the capability to learn a top-layer representation , which is believed to be crucial for the effectiveness of deep methods ( Aitchison , 2019 ) . To obtain the flexibility necessary to learn a task-dependent representation , we propose deep kernel processes ( DKPs ) , which combine nonlinear transformations of the kernel , as in Cho & Saul ( 2009 ) with a flexible learned representation by exploiting a Wishart or inverse Wishart process ( Dawid , 1981 ; Shah et al. , 2014 ) . We find that models ranging from DGPs ( Damianou & Lawrence , 2013 ; Salimbeni & Deisenroth , 2017 ) to Bayesian neural networks ( BNNs ; Blundell et al. , 2015 , App . C.1 ) , infinite BNNs ( App . C.2 ) and infinite BNNs with bottlenecks ( App . C.3 ) can be written as DKPs ( i.e . only with kernel/Gram matrices , without needing features or weights ) . Practically , we find that the deep inverse Wishart process ( DIWP ) , admits convenient forms for variational approximate posteriors , and we give a novel scheme for doubly-stochastic variational inference ( DSVI ) with inducing points purely in the kernel domain ( as opposed to Salimbeni & Deisenroth , 2017 , who described DSVI for standard feature-based DGPs ) , and demonstrate improved performance with carefully matched models on fully-connected benchmark datasets . 2 BACKGROUND . We briefly revise Wishart and inverse Wishart distributions . The Wishart distribution is a generalization of the gamma distribution that is defined over positive semidefinite matrices . Suppose that we have a collection of P -dimensional random variables xi with i ∈ { 1 , . . . , N } such that xi iid∼ N ( 0 , V ) , then , ∑N i=1xix T i = S ∼ W ( V , N ) ( 1 ) has Wishart distribution with scale matrix V and N degrees of freedom . When N > P − 1 , the density is , W ( S ; V , N ) = 1 2NP |V|ΓP ( N 2 ) |S| ( N−P−1 ) /2 exp ( − 12 Tr ( V−1S ) ) , ( 2 ) where ΓP is the multivariate gamma function . Further , the inverse , S−1 has inverse Wishart distribution , W−1 ( V−1 , N ) . The inverse Wishart is defined only for N > P − 1 and also has closed-form density . Finally , we note that the Wishart distribution has mean NV while the inverse Wishart has mean V−1/ ( N − P − 1 ) ( for N > P + 1 ) . 3 DEEP KERNEL PROCESSES . We define a kernel process to be a set of distributions over positive definite matrices of different sizes , that are consistent under marginalisation ( Dawid , 1981 ; Shah et al. , 2014 ) . The two most common kernel processes are the Wishart process and inverse Wishart process , which we write in a slightly unusual form to ensure their expectation is K. We take G and G′ to be finite dimensional marginals of the underlying Wishart and inverse Wishart process , G ∼ W ( K /N , N ) , G′ ∼ W−1 ( δK , δ + ( P + 1 ) ) , ( 3a ) G∗ ∼ W ( K∗/N , N ) , G′∗ ∼ W−1 ( δK∗ , δ + ( P ∗ + 1 ) ) , ( 3b ) and where we explicitly give the consistent marginal distributions over K∗ , G∗ and G′∗ which are P ∗ × P ∗ principal submatrices of the P × P matrices K , G and G′ dropping the same rows and columns . In the inverse-Wishart distribution , δ is a positive parameter that can be understood as controlling the degree of variability , with larger values for δ implying smaller variability in G′ . We define a deep kernel process by analogy with a DGP , as a composition of kernel processes , and show in App . A that under sensible assumptions any such composition is itself a kernel process . 1 3.1 DGPS WITH ISOTROPIC KERNELS ARE DEEP WISHART PROCESSES . We consider deep GPs of the form ( Fig . 1 top ) with X ∈ RP×N0 K ` = { 1 N0 XXT for ` = 1 , K ( G ` −1 ) otherwise , ( 4a ) P ( F ` |K ` ) = ∏N ` λ=1N ( f ` λ ; 0 , K ` ) , ( 4b ) G ` = 1 N ` F ` F T ` . ( 4c ) Here , F ` ∈ RP×N ` are the N ` hidden features in layer ` ; λ indexes hidden features so f ` λ is a single column of F ` , representing the value of the λth feature for all training inputs . Note that K ( · ) is a 1Note that we leave the question of the full Kolmogorov extension theorem ( Kolmogorov , 1933 ) for matrices to future work : for our purposes , it is sufficient to work with very large but ultimately finite input spaces as in practice , the input vectors are represented by elements of the finite set of 32-bit or 64-bit floating-point numbers ( Sterbenz , 1974 ) . function that takes a Gram matrix and returns a kernel matrix ; whereas K ` is a ( possibly random ) variable representing a kernel matrix . Note , we have restricted ourselves to kernels , that can be written as functions of the Gram matrix , G ` , and do not require the full set of activations , F ` . As we describe later , this is not too restrictive , as it includes amongst others all isotropic kernels ( i.e . those that can be written as a function of the distance between points Williams & Rasmussen , 2006 ) . Note that we have a number of choices as to how to initialize the kernel in Eq . ( 4a ) . The current choice just uses a linear dot-product kernel , rather than immediately applying the kernel function K. This is both to ensure exact equivalence with infinite NNs with bottlenecks ( App . C.3 ) and also to highlight an interesting interpretation of this layer as Bayesian inference over generalised lengthscale hyperparameters in the squared-exponential kernel ( App . B e.g . Lalchand & Rasmussen , 2020 ) . For DGP regression , the outputs , Y , are most commonly given by a likelihood that can be written in terms of the output features , FL+1 . For instance , for regression , the distribution of the λth output feature column could be P ( yλ|FL+1 ) = N ( yλ ; f L+1 λ , σ 2I ) , ( 5 ) but our methods can be used with many other forms for the likelihood , including e.g . classification . The generative process for the Gram matrices , G ` , consists of generating samples from a Gaussian distribution ( Eq . 4b ) , and taking their product with themselves transposed ( Eq . 4c ) . This exactly matches the generative process for a Wishart distribution ( Eq . 1 ) , so we can write the Gram matrices , G ` , directly in terms of the kernel , without needing to sample features ( Fig . 1 bottom ) , P ( G1|X ) =W ( 1 N1 ( 1 N0 XXT ) , N1 ) , ( 6a ) P ( G ` |G ` −1 ) =W ( K ( G ` −1 ) /N ` , N ` ) , for ` ∈ { 2 , . . . L } , ( 6b ) P ( FL+1|GL ) = ∏NL+1 λ=1 N ( fL+1λ ; 0 , K ( GL ) ) . ( 6c ) Except at the output , the model is phrased entirely in terms of positive-definite kernels and Gram matrices , and is consistent under marginalisation ( assuming a valid kernel ) and is thus a DKP . At a high level , the model can be understood as alternatively sampling a Gram matrix ( introducing flexibility in the representation ) , and nonlinearly transforming the Gram matrix using a kernel ( Fig . 2 ) . This highlights a particularly simple interpretation of the DKP as an autoregressive process . In a standard autoregressive process , we might propagate the current vector , xt , through a deterministic function , f ( xt ) , and add zero-mean Gaussian noise , ξ , xt+1 = f ( xt ) + σ 2ξ such that E [ xt+1|xt ] = f ( xt ) . ( 7 ) By analogy , the next Gram matrix has expectation centered on a deterministic transformation of the previous Gram matrix , E [ G ` |G ` −1 ] = K ( G ` −1 ) , ( 8 ) so G ` can be written as this expectation plus a zero-mean random variable , Ξ ` , that can be interpreted as noise , G ` = K ( G ` −1 ) + Ξ ` . ( 9 ) Note that Ξ ` is not in general positive definite , and may not have an analytically tractable distribution . This noise decreases as N ` increases , V [ G ` ij ] = V [ Ξ ` ij ] = 1N ` ( K2ij ( G ` −1 ) +K 2 ii ( G ` −1 ) K 2 jj ( G ` −1 ) ) . ( 10 ) Notably , as N ` tends to infinity , the Wishart samples converge on their expectation , and the noise disappears , leaving us with a series of deterministic transformations of the Gram matrix . Therefore , we can understand a deep kernel process as alternatively adding “ noise ” to the kernel by sampling e.g . a Wishart or inverse Wishart distribution ( G2 and G3 in Fig . 2 ) and computing a nonlinear transformation of the kernel ( K ( G2 ) and K ( G3 ) in Fig . 2 ) Remember that we are restricted to kernels that can be written as a function of the Gram matrix , K ` = K ( G ` ) = Kfeatures ( F ` ) , K ` ij = k ( F ` i , : , F ` j , : ) . ( 11 ) where Kfeatures ( · ) takes a matrix of features , F ` , and returns the kernel matrix , K ` , and k is the usual kernel , which takes two feature vectors ( rows of F ` ) and returns an element of the kernel matrix . This does not include all possible kernels because it is not possible to recover the features from the Gram matrix . In particular , the Gram matrix is invariant to unitary transformations of the features : the Gram matrix is the same for F ` and F′ ` = UF ` where U is a unitary matrix , such that UU T = I , G ` = 1 N ` F ` F T ` = 1 N ` F ` U ` U T ` F T ` = 1 N ` F′ ` F ′T ` . ( 12 ) Superficially , this might seem very limiting — leaving us only with dot-product kernels ( Williams & Rasmussen , 2006 ) such as , k ( f , f ′ ) = f · f ′ + σ2 . ( 13 ) However , in reality , a far broader range of kernels fit within this class . Importantly , isotropic or radial basis function kernels including the squared exponential and Matern depend only on the squared distance between points , R , ( Williams & Rasmussen , 2006 ) k ( f , f ′ ) = k ( R ) , R = |f − f ′|2 . ( 14 ) These kernels can be written as a function of G , because the matrix of squared distances , R , can be computed from G , R ` ij = 1 N ` ∑N ` λ=1 ( F ` iλ − F ` jλ ) 2 = 1N ` ∑N ` λ=1 ( ( F ` iλ ) 2 − 2F ` iλF ` jλ + ( F ` jλ ) 2 ) = G ` ii − 2G ` ij +G ` jj . ( 15 )
This paper proposes deep kernel processes (DKPs), which can be viewed as a specific kind of deep Gaussian processes where the kernel can be written as a function of the Gram matrix. The features in the intermediate layers are integrated out and the Gram matrix are Wishart distributed. A doubly stochastic variational inference method is proposed to learn DKPs. The idea looks novel to me. My major concern is about the writing.
SP:40e4749c3e5c57e12a6c540510b74ae3551e479a
Deep Kernel Processes
1 INTRODUCTION . The deep learning revolution has shown us that effective performance on difficult tasks such as image classification ( Krizhevsky et al. , 2012 ) requires deep models with flexible lower-layers that learn task-dependent representations . Here , we consider whether these insights from the neural network literature can be applied to purely kernel-based methods . ( Note that we do not consider deep Gaussian processes or DGPs to be “ fully kernel-based ” as they use a feature-based representation in intermediate layers ) . Importantly , deep kernel methods ( e.g . Cho & Saul , 2009 ) already exist . In these methods , which are closely related to infinite Bayesian neural networks ( Lee et al. , 2017 ; Matthews et al. , 2018 ; Garriga-Alonso et al. , 2018 ; Novak et al. , 2018 ) , we take an initial kernel ( usually the dot product of the input features ) and perform a series of deterministic , parameter-free transformations to obtain an output kernel that we use in e.g . a support vector machine or Gaussian process . However , the deterministic , parameter-free nature of the transformation from input to output kernel means that they lack the capability to learn a top-layer representation , which is believed to be crucial for the effectiveness of deep methods ( Aitchison , 2019 ) . To obtain the flexibility necessary to learn a task-dependent representation , we propose deep kernel processes ( DKPs ) , which combine nonlinear transformations of the kernel , as in Cho & Saul ( 2009 ) with a flexible learned representation by exploiting a Wishart or inverse Wishart process ( Dawid , 1981 ; Shah et al. , 2014 ) . We find that models ranging from DGPs ( Damianou & Lawrence , 2013 ; Salimbeni & Deisenroth , 2017 ) to Bayesian neural networks ( BNNs ; Blundell et al. , 2015 , App . C.1 ) , infinite BNNs ( App . C.2 ) and infinite BNNs with bottlenecks ( App . C.3 ) can be written as DKPs ( i.e . only with kernel/Gram matrices , without needing features or weights ) . Practically , we find that the deep inverse Wishart process ( DIWP ) , admits convenient forms for variational approximate posteriors , and we give a novel scheme for doubly-stochastic variational inference ( DSVI ) with inducing points purely in the kernel domain ( as opposed to Salimbeni & Deisenroth , 2017 , who described DSVI for standard feature-based DGPs ) , and demonstrate improved performance with carefully matched models on fully-connected benchmark datasets . 2 BACKGROUND . We briefly revise Wishart and inverse Wishart distributions . The Wishart distribution is a generalization of the gamma distribution that is defined over positive semidefinite matrices . Suppose that we have a collection of P -dimensional random variables xi with i ∈ { 1 , . . . , N } such that xi iid∼ N ( 0 , V ) , then , ∑N i=1xix T i = S ∼ W ( V , N ) ( 1 ) has Wishart distribution with scale matrix V and N degrees of freedom . When N > P − 1 , the density is , W ( S ; V , N ) = 1 2NP |V|ΓP ( N 2 ) |S| ( N−P−1 ) /2 exp ( − 12 Tr ( V−1S ) ) , ( 2 ) where ΓP is the multivariate gamma function . Further , the inverse , S−1 has inverse Wishart distribution , W−1 ( V−1 , N ) . The inverse Wishart is defined only for N > P − 1 and also has closed-form density . Finally , we note that the Wishart distribution has mean NV while the inverse Wishart has mean V−1/ ( N − P − 1 ) ( for N > P + 1 ) . 3 DEEP KERNEL PROCESSES . We define a kernel process to be a set of distributions over positive definite matrices of different sizes , that are consistent under marginalisation ( Dawid , 1981 ; Shah et al. , 2014 ) . The two most common kernel processes are the Wishart process and inverse Wishart process , which we write in a slightly unusual form to ensure their expectation is K. We take G and G′ to be finite dimensional marginals of the underlying Wishart and inverse Wishart process , G ∼ W ( K /N , N ) , G′ ∼ W−1 ( δK , δ + ( P + 1 ) ) , ( 3a ) G∗ ∼ W ( K∗/N , N ) , G′∗ ∼ W−1 ( δK∗ , δ + ( P ∗ + 1 ) ) , ( 3b ) and where we explicitly give the consistent marginal distributions over K∗ , G∗ and G′∗ which are P ∗ × P ∗ principal submatrices of the P × P matrices K , G and G′ dropping the same rows and columns . In the inverse-Wishart distribution , δ is a positive parameter that can be understood as controlling the degree of variability , with larger values for δ implying smaller variability in G′ . We define a deep kernel process by analogy with a DGP , as a composition of kernel processes , and show in App . A that under sensible assumptions any such composition is itself a kernel process . 1 3.1 DGPS WITH ISOTROPIC KERNELS ARE DEEP WISHART PROCESSES . We consider deep GPs of the form ( Fig . 1 top ) with X ∈ RP×N0 K ` = { 1 N0 XXT for ` = 1 , K ( G ` −1 ) otherwise , ( 4a ) P ( F ` |K ` ) = ∏N ` λ=1N ( f ` λ ; 0 , K ` ) , ( 4b ) G ` = 1 N ` F ` F T ` . ( 4c ) Here , F ` ∈ RP×N ` are the N ` hidden features in layer ` ; λ indexes hidden features so f ` λ is a single column of F ` , representing the value of the λth feature for all training inputs . Note that K ( · ) is a 1Note that we leave the question of the full Kolmogorov extension theorem ( Kolmogorov , 1933 ) for matrices to future work : for our purposes , it is sufficient to work with very large but ultimately finite input spaces as in practice , the input vectors are represented by elements of the finite set of 32-bit or 64-bit floating-point numbers ( Sterbenz , 1974 ) . function that takes a Gram matrix and returns a kernel matrix ; whereas K ` is a ( possibly random ) variable representing a kernel matrix . Note , we have restricted ourselves to kernels , that can be written as functions of the Gram matrix , G ` , and do not require the full set of activations , F ` . As we describe later , this is not too restrictive , as it includes amongst others all isotropic kernels ( i.e . those that can be written as a function of the distance between points Williams & Rasmussen , 2006 ) . Note that we have a number of choices as to how to initialize the kernel in Eq . ( 4a ) . The current choice just uses a linear dot-product kernel , rather than immediately applying the kernel function K. This is both to ensure exact equivalence with infinite NNs with bottlenecks ( App . C.3 ) and also to highlight an interesting interpretation of this layer as Bayesian inference over generalised lengthscale hyperparameters in the squared-exponential kernel ( App . B e.g . Lalchand & Rasmussen , 2020 ) . For DGP regression , the outputs , Y , are most commonly given by a likelihood that can be written in terms of the output features , FL+1 . For instance , for regression , the distribution of the λth output feature column could be P ( yλ|FL+1 ) = N ( yλ ; f L+1 λ , σ 2I ) , ( 5 ) but our methods can be used with many other forms for the likelihood , including e.g . classification . The generative process for the Gram matrices , G ` , consists of generating samples from a Gaussian distribution ( Eq . 4b ) , and taking their product with themselves transposed ( Eq . 4c ) . This exactly matches the generative process for a Wishart distribution ( Eq . 1 ) , so we can write the Gram matrices , G ` , directly in terms of the kernel , without needing to sample features ( Fig . 1 bottom ) , P ( G1|X ) =W ( 1 N1 ( 1 N0 XXT ) , N1 ) , ( 6a ) P ( G ` |G ` −1 ) =W ( K ( G ` −1 ) /N ` , N ` ) , for ` ∈ { 2 , . . . L } , ( 6b ) P ( FL+1|GL ) = ∏NL+1 λ=1 N ( fL+1λ ; 0 , K ( GL ) ) . ( 6c ) Except at the output , the model is phrased entirely in terms of positive-definite kernels and Gram matrices , and is consistent under marginalisation ( assuming a valid kernel ) and is thus a DKP . At a high level , the model can be understood as alternatively sampling a Gram matrix ( introducing flexibility in the representation ) , and nonlinearly transforming the Gram matrix using a kernel ( Fig . 2 ) . This highlights a particularly simple interpretation of the DKP as an autoregressive process . In a standard autoregressive process , we might propagate the current vector , xt , through a deterministic function , f ( xt ) , and add zero-mean Gaussian noise , ξ , xt+1 = f ( xt ) + σ 2ξ such that E [ xt+1|xt ] = f ( xt ) . ( 7 ) By analogy , the next Gram matrix has expectation centered on a deterministic transformation of the previous Gram matrix , E [ G ` |G ` −1 ] = K ( G ` −1 ) , ( 8 ) so G ` can be written as this expectation plus a zero-mean random variable , Ξ ` , that can be interpreted as noise , G ` = K ( G ` −1 ) + Ξ ` . ( 9 ) Note that Ξ ` is not in general positive definite , and may not have an analytically tractable distribution . This noise decreases as N ` increases , V [ G ` ij ] = V [ Ξ ` ij ] = 1N ` ( K2ij ( G ` −1 ) +K 2 ii ( G ` −1 ) K 2 jj ( G ` −1 ) ) . ( 10 ) Notably , as N ` tends to infinity , the Wishart samples converge on their expectation , and the noise disappears , leaving us with a series of deterministic transformations of the Gram matrix . Therefore , we can understand a deep kernel process as alternatively adding “ noise ” to the kernel by sampling e.g . a Wishart or inverse Wishart distribution ( G2 and G3 in Fig . 2 ) and computing a nonlinear transformation of the kernel ( K ( G2 ) and K ( G3 ) in Fig . 2 ) Remember that we are restricted to kernels that can be written as a function of the Gram matrix , K ` = K ( G ` ) = Kfeatures ( F ` ) , K ` ij = k ( F ` i , : , F ` j , : ) . ( 11 ) where Kfeatures ( · ) takes a matrix of features , F ` , and returns the kernel matrix , K ` , and k is the usual kernel , which takes two feature vectors ( rows of F ` ) and returns an element of the kernel matrix . This does not include all possible kernels because it is not possible to recover the features from the Gram matrix . In particular , the Gram matrix is invariant to unitary transformations of the features : the Gram matrix is the same for F ` and F′ ` = UF ` where U is a unitary matrix , such that UU T = I , G ` = 1 N ` F ` F T ` = 1 N ` F ` U ` U T ` F T ` = 1 N ` F′ ` F ′T ` . ( 12 ) Superficially , this might seem very limiting — leaving us only with dot-product kernels ( Williams & Rasmussen , 2006 ) such as , k ( f , f ′ ) = f · f ′ + σ2 . ( 13 ) However , in reality , a far broader range of kernels fit within this class . Importantly , isotropic or radial basis function kernels including the squared exponential and Matern depend only on the squared distance between points , R , ( Williams & Rasmussen , 2006 ) k ( f , f ′ ) = k ( R ) , R = |f − f ′|2 . ( 14 ) These kernels can be written as a function of G , because the matrix of squared distances , R , can be computed from G , R ` ij = 1 N ` ∑N ` λ=1 ( F ` iλ − F ` jλ ) 2 = 1N ` ∑N ` λ=1 ( ( F ` iλ ) 2 − 2F ` iλF ` jλ + ( F ` jλ ) 2 ) = G ` ii − 2G ` ij +G ` jj . ( 15 )
This paper proposes a prior distribution over covariance matrices of kernels which is defined as a sequential graphical model where each variable is Wishart distributed and its scale matrix is a non-linear transformation of its predecesor variable on the graph. The paper begins by considering a DGP with isotropic kernels across the layers and realizes that the Gram matrices are Wishart distributed. Based on this, the paper proposes to bypass the inference of the features and sample the Gram matrices directly from Wishart distributions. This insight, in addition to the layered structure of DGPs, gives rise to the proposed prior distribution. Furthermore, given the restrictions of the Wishart distribution for modelling covariance matrices of arbitrary size [1], as well as the conjugacy properties of the inverse Wishart distribution, the paper uses the inverse Wishart distribution instead. Doubly stochastic variational inference is proposed for approximating the posterior distribution which includes the use of inducing points thanks to the marginalization properties of the inverse Wishart distribution. The experimental contribution consists of a comparison against DGP and Neural Network GP on the UCI, MNIST and CIFAR-10 dataset.
SP:40e4749c3e5c57e12a6c540510b74ae3551e479a
Continuous Transfer Learning
1 INTRODUCTION Source domain Target domain 𝓓𝓓𝑺𝑺 𝓓𝓓𝑻𝑻𝟏𝟏 𝓓𝓓𝑻𝑻𝟐𝟐 𝓓𝓓𝑻𝑻𝒕𝒕 𝓓𝓓𝑻𝑻𝒏𝒏⋯⋯𝓓𝓓𝑻𝑻𝟑𝟑 Negative transfer 𝓓𝓓𝑺𝑺 Figure 1 : Illustration of continuous transfer learning . It learns a predictive function in DTt using knowledge from both source domain DS and historical target domain DTi ( i = 1 , · · · , t 1 ) . Directly transferring from the source domain DS to the target domain DTt might lead to negative transfer with undesirable predictive performance . Transfer learning has achieved significant success across multiple high-impact application domains ( Pan & Yang , 2009 ) . Compared to conventional machine learning methods assuming both training and test data have the same data distribution , transfer learning allows us to learn the target domain with limited label information by leveraging a related source domain with abundant label information ( Ying et al. , 2018 ) . However , in many real applications , the target domain is constantly evolving over time . For example , the online movie reviews are changing over the years : some famous movies were not well received by the mainstream audience when they were first released , but became famous only years later ( e.g. , Citizen Cane , Fight Club , and The Shawshank Redemption ) ; whereas the online book reviews typically do not have this type of dynamics . It is challenging to transfer knowledge from the static source domain ( e.g. , the book reviews ) to the time evolving target domain ( e.g. , the movie reviews ) . Therefore , in this paper , we study the transfer learning setting with a static source domain and a continuously time evolving target domain ( see Figure 1 ) , which has not attracted much attention from the research community and yet is commonly seen across many real applications . The unique challenge for continuous transfer learning lies in the time evolving nature of the task relatedness between the static source domain and the time evolving target domain . Although the change in the target data distribution in consecutive time stamps might be small , over time , the cumulative change in the target domain might even lead to negative transfer ( Rosenstein et al. , 2005 ) . Existing theoretical analysis on transfer learning ( Ben-David et al. , 2010 ; Mansour et al. , 2009 ) showed that the target error is typically bounded by the source error , the domain discrepancy of marginal data distributions and the difference of labeling functions . However , it has been observed ( Zhao et al. , 2019 ; Wu et al. , 2019 ) that marginal feature distribution alignment might not guarantee the minimization of the target error in real world scenarios . This indicates that in the context of continuous transfer learning , marginal feature distribution alignment would lead to the sub-optimal solution ( or even negative transfer ) with undesirable predictive performance when directly transferring from DS to the target domain DTt at the tth time stamp . This paper aims to bridge the gap in terms of both the theoretical analysis and the empirical solutions for the target domain with a time evolving distribution , which lead to a novel continuous transfer learning algorithm as well as the characterization of negative transfer . The main contributions of this paper are summarized as follows : ( 1 ) We derive a generic error bound for continuous transfer learning setting with flexible domain divergence measures ; ( 2 ) We propose a label-informed domain discrepancy measure ( C-divergence ) with its empirical estimate , which instantiates a tighter error bound for continuous transfer learning setting ; ( 3 ) Based on the proposed C-divergence , we design a novel adversarial Variational Auto-encoder algorithm ( CONTE ) for continuous transfer learning ; ( 4 ) Extensive experimental results on various data sets verify the effectiveness of the proposed CONTE algorithm . The rest of the paper is organized as follows . Section 2 introduces the notation and our problem definition . We derive a generic error bound for continuous transfer learning setting in Section 3 . Then we propose a novel C-divergence in Section 4 , followed by a instantiated error bound and a novel continuous transfer learning algorithm in Section 5 . The experimental results are provided in Section 6 . We summarize the related work in Section 7 , and conclude the paper in Section 8 . 2 PRELIMINARIES . In this section , we introduce the notation and problem definition of continuous transfer learning . 2.1 NOTATION . We use X and Y to denote the input space and label space . Let DS and DT denote the source and target domains with data distribution pS ( x , y ) and pT ( x , y ) over X ⇥ Y , respectively . Let H be a hypothesis class on X , where a hypothesis is a function h : X ! Y . The notation is summarized in Table 3 in the appendices . 2.2 PROBLEM DEFINITION . Transfer learning ( Pan & Yang , 2009 ) refers to the knowledge transfer from source domain to target domain such that the prediction performance on the target domain could be significantly improved as compared to learning from the target domain alone . However , in some applications , the target domain is changing over time , hence the time evolving relatedness between the source and target domains . This motivates us to consider the transfer learning setting with the time evolving target domain , which is much less studied as compared to the static transfer learning setting . We formally define the continuous transfer learning problem as follows . Definition 2.1 . ( Continuous Transfer Learning ) Given a source domain DS ( available at time stamp j = 1 ) and a time evolving target domain { DTj } nj=1 with time stamp j , continuous transfer learning aims to improve the prediction function for target domain DTt+1 using the knowledge from source domain DS and the historical target domain DTj ( j = 1 , · · · , t ) . Notice that the source domain DS can be considered a special initial domain for the time-evolving target domain . Therefore , for notation simplicity , we will use DT0 to represent the source domain in this paper . It assumes that there are mT0 labeled source examples drawn independently from a source domain DT0 and mTj labeled target examples drawn independently from a target domain DTj at time stamp j . 3 A GENERIC ERROR BOUND . Given a static source domain and a time evolving target domain , continuous transfer learning aims to improve the target predictive function over DTt+1 using the source domain and historical target domain . We begin by considering the binary classification setting , i.e. , Y = { 0 , 1 } . The source error of a hypothesis h can be defined as follows : ✏T0 ( h ) = E ( x , y ) ⇠pT0 ( x , y ) ⇥ L ( h ( x ) , y ) ⇤ where L ( · , · ) is the loss function . Its empirical estimate using source labeled examples is denoted as ✏̂T0 ( h ) . Similarly , we define the target error ✏Tj ( h ) and the empirical estimate of the target error ✏̂Tj ( h ) over the target distribution pTj ( x , y ) at time stamp j . A natural domain discrepancy measure over joint distributions on X ⇥ Y between features and class labels can be defined as follows : d1 ( DT0 , DT ) = sup Q2Q PrDT0 [ Q ] PrDT [ Q ] ( 1 ) where Q is the set of measurable subsets under pT0 ( x , y ) and pT ( x , y ) 1 . Then , the error bound of continuous transfer learning is given by the following theorem . Theorem 3.1 . Assume the loss function L is bounded with 0 L M . Given a source domain DT0 and historical target domain { DTi } ti=1 , for h 2 H , the target domain error ✏Tt+1 on Dt+1 is 1Note that it is slightly different from L1 or variation divergence in ( Ben-David et al. , 2010 ) with only marginal distribution of features involved . bounded as follows . ✏Tt+1 ( h ) 1 µ̄ 0 @ tX j=0 µ t j ✏Tj ( h ) +M tX j=0 µ t j d1 ( DTj , DTt+1 ) 1 A where µ 0 is the domain decay rate2 indicating the importance of source or historical target domain over DTt+1 , and µ̄ = Pt j=0 µ t j . Remark . In particular , we have the following arguments . ( 1 ) It is not tractable to accurately estimate d1 from finite examples in real scenarios ( Ben-David et al. , 2010 ) ; ( 2 ) This error bound could be much tighter when considering other advanced domain discrepancy measures , e.g. , Adistance ( Ben-David et al. , 2007 ) , discrepancy distance ( Mansour et al. , 2009 ) , etc . ( 3 ) There are two special cases : when µ = 0 , the error bound of DTt+1 would be simply determined by the latest historical target data DTt , and if µ goes to infinity , DTt+1 is just determined by the source data DT0 because intuitively the coefficient µt j/µ̄ of historical target domain data DTj ( j = 1 , · · · , t ) converges to zero . Corollary 3.2 . With the assumption in Theorem 3.1 and assume that the loss function L is symmetric ( i.e. , L ( y1 , y2 ) = L ( y2 , y1 ) for y1 , y2 2 Y ) and obeys the triangle inequality , Then ( 1 ) if A-distance ( Ben-David et al. , 2007 ) is adopted to measure the distribution shift , i.e. , dH H = suph , h02H PrDT0 [ h ( x ) 6= h 0 ( x ) ] PrDT [ h ( x ) 6= h 0 ( x ) ] , we have : ✏Tt+1 ( h ) 1 µ̄ 0 @ tX j=0 µ t j ✏Tj ( h ) +M tX j=0 µ t j ✓ dH H ( DTj , DTt+1 ) + ⇤ j M ◆1 A where ⇤j = minh2H ✏Tj ( h ) + ✏Tt+1 ( h ) . ( 2 ) if discrepancy distance ( Mansour et al. , 2009 ) is adopted to measure the distribution shift , i.e. , ddisc ( DT0 , DT ) = maxh , h02H EDT0 [ L ( h ( x ) , h 0 ( x ) ) ] EDT [ L ( h ( x ) , h0 ( x ) ) ] , we have : ✏Tt+1 ( h ) 1 µ̄ 0 @ tX j=0 µ t j ✏Tj ( h ) + tX j=0 µ t j ddisc ( DTj , DTt+1 ) + ⌦j 1 A where ⌦j = EDTj [ L ( h ⇤ j ( x ) , y ) ] + EDTt+1 [ L ( h ⇤ j ( x ) , h ⇤ t+1 ( x ) ) ] + EDTt+1 [ L ( h ⇤ t+1 ( x ) , y ) ] , and h ⇤ j = argminh2H ✏Tj ( h ) for j = 0 , · · · , t , t+ 1 . The aforementioned domain discrepancy measures mainly focus on the marginal distribution over input features and have inspired a line of practical transfer learning algorithms ( Ganin et al. , 2016 ; Chen et al. , 2019 ) . However , recent work ( Wu et al. , 2019 ; Zhao et al. , 2019 ) observed that the minimization of marginal distributions can not guarantee the success of transfer learning in real scenarios . We propose to address this problem by incorporating the label information in the domain discrepancy measure ( see next section ) .
The paper proposed a transfer learning setting where the target domain varies/evolves over time and the source domain is considered static. The paper uses C-divergence to measure label-dependent domain discrepancy between source/previous target domain and the current target domain and provided a theoretical bound. The paper also used supervised VAE for CONTE algorithm and included C-divergence as a part of the objective function.
SP:cc84a9b9b02da8079787f6e5de7e1b83d95e8d5f
Continuous Transfer Learning
1 INTRODUCTION Source domain Target domain 𝓓𝓓𝑺𝑺 𝓓𝓓𝑻𝑻𝟏𝟏 𝓓𝓓𝑻𝑻𝟐𝟐 𝓓𝓓𝑻𝑻𝒕𝒕 𝓓𝓓𝑻𝑻𝒏𝒏⋯⋯𝓓𝓓𝑻𝑻𝟑𝟑 Negative transfer 𝓓𝓓𝑺𝑺 Figure 1 : Illustration of continuous transfer learning . It learns a predictive function in DTt using knowledge from both source domain DS and historical target domain DTi ( i = 1 , · · · , t 1 ) . Directly transferring from the source domain DS to the target domain DTt might lead to negative transfer with undesirable predictive performance . Transfer learning has achieved significant success across multiple high-impact application domains ( Pan & Yang , 2009 ) . Compared to conventional machine learning methods assuming both training and test data have the same data distribution , transfer learning allows us to learn the target domain with limited label information by leveraging a related source domain with abundant label information ( Ying et al. , 2018 ) . However , in many real applications , the target domain is constantly evolving over time . For example , the online movie reviews are changing over the years : some famous movies were not well received by the mainstream audience when they were first released , but became famous only years later ( e.g. , Citizen Cane , Fight Club , and The Shawshank Redemption ) ; whereas the online book reviews typically do not have this type of dynamics . It is challenging to transfer knowledge from the static source domain ( e.g. , the book reviews ) to the time evolving target domain ( e.g. , the movie reviews ) . Therefore , in this paper , we study the transfer learning setting with a static source domain and a continuously time evolving target domain ( see Figure 1 ) , which has not attracted much attention from the research community and yet is commonly seen across many real applications . The unique challenge for continuous transfer learning lies in the time evolving nature of the task relatedness between the static source domain and the time evolving target domain . Although the change in the target data distribution in consecutive time stamps might be small , over time , the cumulative change in the target domain might even lead to negative transfer ( Rosenstein et al. , 2005 ) . Existing theoretical analysis on transfer learning ( Ben-David et al. , 2010 ; Mansour et al. , 2009 ) showed that the target error is typically bounded by the source error , the domain discrepancy of marginal data distributions and the difference of labeling functions . However , it has been observed ( Zhao et al. , 2019 ; Wu et al. , 2019 ) that marginal feature distribution alignment might not guarantee the minimization of the target error in real world scenarios . This indicates that in the context of continuous transfer learning , marginal feature distribution alignment would lead to the sub-optimal solution ( or even negative transfer ) with undesirable predictive performance when directly transferring from DS to the target domain DTt at the tth time stamp . This paper aims to bridge the gap in terms of both the theoretical analysis and the empirical solutions for the target domain with a time evolving distribution , which lead to a novel continuous transfer learning algorithm as well as the characterization of negative transfer . The main contributions of this paper are summarized as follows : ( 1 ) We derive a generic error bound for continuous transfer learning setting with flexible domain divergence measures ; ( 2 ) We propose a label-informed domain discrepancy measure ( C-divergence ) with its empirical estimate , which instantiates a tighter error bound for continuous transfer learning setting ; ( 3 ) Based on the proposed C-divergence , we design a novel adversarial Variational Auto-encoder algorithm ( CONTE ) for continuous transfer learning ; ( 4 ) Extensive experimental results on various data sets verify the effectiveness of the proposed CONTE algorithm . The rest of the paper is organized as follows . Section 2 introduces the notation and our problem definition . We derive a generic error bound for continuous transfer learning setting in Section 3 . Then we propose a novel C-divergence in Section 4 , followed by a instantiated error bound and a novel continuous transfer learning algorithm in Section 5 . The experimental results are provided in Section 6 . We summarize the related work in Section 7 , and conclude the paper in Section 8 . 2 PRELIMINARIES . In this section , we introduce the notation and problem definition of continuous transfer learning . 2.1 NOTATION . We use X and Y to denote the input space and label space . Let DS and DT denote the source and target domains with data distribution pS ( x , y ) and pT ( x , y ) over X ⇥ Y , respectively . Let H be a hypothesis class on X , where a hypothesis is a function h : X ! Y . The notation is summarized in Table 3 in the appendices . 2.2 PROBLEM DEFINITION . Transfer learning ( Pan & Yang , 2009 ) refers to the knowledge transfer from source domain to target domain such that the prediction performance on the target domain could be significantly improved as compared to learning from the target domain alone . However , in some applications , the target domain is changing over time , hence the time evolving relatedness between the source and target domains . This motivates us to consider the transfer learning setting with the time evolving target domain , which is much less studied as compared to the static transfer learning setting . We formally define the continuous transfer learning problem as follows . Definition 2.1 . ( Continuous Transfer Learning ) Given a source domain DS ( available at time stamp j = 1 ) and a time evolving target domain { DTj } nj=1 with time stamp j , continuous transfer learning aims to improve the prediction function for target domain DTt+1 using the knowledge from source domain DS and the historical target domain DTj ( j = 1 , · · · , t ) . Notice that the source domain DS can be considered a special initial domain for the time-evolving target domain . Therefore , for notation simplicity , we will use DT0 to represent the source domain in this paper . It assumes that there are mT0 labeled source examples drawn independently from a source domain DT0 and mTj labeled target examples drawn independently from a target domain DTj at time stamp j . 3 A GENERIC ERROR BOUND . Given a static source domain and a time evolving target domain , continuous transfer learning aims to improve the target predictive function over DTt+1 using the source domain and historical target domain . We begin by considering the binary classification setting , i.e. , Y = { 0 , 1 } . The source error of a hypothesis h can be defined as follows : ✏T0 ( h ) = E ( x , y ) ⇠pT0 ( x , y ) ⇥ L ( h ( x ) , y ) ⇤ where L ( · , · ) is the loss function . Its empirical estimate using source labeled examples is denoted as ✏̂T0 ( h ) . Similarly , we define the target error ✏Tj ( h ) and the empirical estimate of the target error ✏̂Tj ( h ) over the target distribution pTj ( x , y ) at time stamp j . A natural domain discrepancy measure over joint distributions on X ⇥ Y between features and class labels can be defined as follows : d1 ( DT0 , DT ) = sup Q2Q PrDT0 [ Q ] PrDT [ Q ] ( 1 ) where Q is the set of measurable subsets under pT0 ( x , y ) and pT ( x , y ) 1 . Then , the error bound of continuous transfer learning is given by the following theorem . Theorem 3.1 . Assume the loss function L is bounded with 0 L M . Given a source domain DT0 and historical target domain { DTi } ti=1 , for h 2 H , the target domain error ✏Tt+1 on Dt+1 is 1Note that it is slightly different from L1 or variation divergence in ( Ben-David et al. , 2010 ) with only marginal distribution of features involved . bounded as follows . ✏Tt+1 ( h ) 1 µ̄ 0 @ tX j=0 µ t j ✏Tj ( h ) +M tX j=0 µ t j d1 ( DTj , DTt+1 ) 1 A where µ 0 is the domain decay rate2 indicating the importance of source or historical target domain over DTt+1 , and µ̄ = Pt j=0 µ t j . Remark . In particular , we have the following arguments . ( 1 ) It is not tractable to accurately estimate d1 from finite examples in real scenarios ( Ben-David et al. , 2010 ) ; ( 2 ) This error bound could be much tighter when considering other advanced domain discrepancy measures , e.g. , Adistance ( Ben-David et al. , 2007 ) , discrepancy distance ( Mansour et al. , 2009 ) , etc . ( 3 ) There are two special cases : when µ = 0 , the error bound of DTt+1 would be simply determined by the latest historical target data DTt , and if µ goes to infinity , DTt+1 is just determined by the source data DT0 because intuitively the coefficient µt j/µ̄ of historical target domain data DTj ( j = 1 , · · · , t ) converges to zero . Corollary 3.2 . With the assumption in Theorem 3.1 and assume that the loss function L is symmetric ( i.e. , L ( y1 , y2 ) = L ( y2 , y1 ) for y1 , y2 2 Y ) and obeys the triangle inequality , Then ( 1 ) if A-distance ( Ben-David et al. , 2007 ) is adopted to measure the distribution shift , i.e. , dH H = suph , h02H PrDT0 [ h ( x ) 6= h 0 ( x ) ] PrDT [ h ( x ) 6= h 0 ( x ) ] , we have : ✏Tt+1 ( h ) 1 µ̄ 0 @ tX j=0 µ t j ✏Tj ( h ) +M tX j=0 µ t j ✓ dH H ( DTj , DTt+1 ) + ⇤ j M ◆1 A where ⇤j = minh2H ✏Tj ( h ) + ✏Tt+1 ( h ) . ( 2 ) if discrepancy distance ( Mansour et al. , 2009 ) is adopted to measure the distribution shift , i.e. , ddisc ( DT0 , DT ) = maxh , h02H EDT0 [ L ( h ( x ) , h 0 ( x ) ) ] EDT [ L ( h ( x ) , h0 ( x ) ) ] , we have : ✏Tt+1 ( h ) 1 µ̄ 0 @ tX j=0 µ t j ✏Tj ( h ) + tX j=0 µ t j ddisc ( DTj , DTt+1 ) + ⌦j 1 A where ⌦j = EDTj [ L ( h ⇤ j ( x ) , y ) ] + EDTt+1 [ L ( h ⇤ j ( x ) , h ⇤ t+1 ( x ) ) ] + EDTt+1 [ L ( h ⇤ t+1 ( x ) , y ) ] , and h ⇤ j = argminh2H ✏Tj ( h ) for j = 0 , · · · , t , t+ 1 . The aforementioned domain discrepancy measures mainly focus on the marginal distribution over input features and have inspired a line of practical transfer learning algorithms ( Ganin et al. , 2016 ; Chen et al. , 2019 ) . However , recent work ( Wu et al. , 2019 ; Zhao et al. , 2019 ) observed that the minimization of marginal distributions can not guarantee the success of transfer learning in real scenarios . We propose to address this problem by incorporating the label information in the domain discrepancy measure ( see next section ) .
This paper studies how to transfer the information in the static source domain to the time-evolving target domain. This paper proposes a domain discrepancy measure and an algorithm for continuous transfer learning. The results seem to be interesting and the problem this paper studies is important. However, the domain rate in the main results and algorithm could be easily generalized which can make the results more broadly applicable. Moreover, it needs more clarification about the motivation of using the C-divergence measure in the time-evolving target domain.
SP:cc84a9b9b02da8079787f6e5de7e1b83d95e8d5f
BAFFLE: TOWARDS RESOLVING FEDERATED LEARNING’S DILEMMA - THWARTING BACKDOOR AND INFERENCE ATTACKS
1 INTRODUCTION . Federated learning ( FL ) is an emerging collaborative machine learning trend with many applications such as next word prediction for mobile keyboards ( McMahan & Ramage , 2017 ) , medical imaging ( Sheller et al. , 2018a ) , and intrusion detection for IoT ( Nguyen et al. , 2019 ) . In FL , clients locally train model updates using private data and provide these to a central aggregator who combines them to a global model that is sent back to clients for the next training iteration . FL offers efficiency and scalability as the training is distributed among many clients and executed in parallel ( Bonawitz et al. , 2019 ) . In particular , FL improves privacy by enabling clients to keep their training data locally ( McMahan et al. , 2017 ) . This is not only relevant for compliance to legal obligations such as the GDPR ( 2018 ) , but also in general when processing personal and sensitive data . Despite its benefits , FL is vulnerable to backdoor ( Bagdasaryan et al. , 2020 ; Nguyen et al. , 2020 ; Xie et al. , 2020 ) and inference attacks ( Pyrgelis et al. , 2018 ; Shokri et al. , 2017 ; Ganju et al. , 2018 ) . In the former , the adversary stealthily manipulates the global model so that attacker-chosen inputs result in wrong predictions chosen by the adversary . Existing backdoor defenses , e.g. , ( Shen et al. , 2016 ; Blanchard et al. , 2017 ) fail to effectively protect against state-of-the-art backdoor attacks , e.g. , constrain-and-scale ( Bagdasaryan et al. , 2020 ) and DBA ( Xie et al. , 2020 ) . In inference attacks , the adversary aims at learning information about the clients ’ local data by analyzing their model updates . Mitigating both attack types at the same time is highly challenging due to a dilemma : Backdoor defenses require access to the clients ’ model updates , whereas inference mitigation strategies prohibit this to avoid information leakage . No solution currently exists that defends against both attacks at the same time ( §6 ) . Our Goals and Contributions . In this paper , we provide the following contributions : 1 . BAFFLE , a novel generic FL defense system that simultaneously protects both the security and the data privacy of FL by effectively preventing backdoor and inference attacks . To the best of our knowledge , this is the first work that discusses and tackles this dilemma , i.e. , no existing defense against backdoor attacks preserves the privacy of the clients ’ data ( §4 ) . 2 . To the best of our knowledge , we are the first to point out that combining clustering , clipping , and noising can prevent the adversary to trade-off between attack impact and attack stealthiness . However , the naı̈ve combination of these two classes of defenses is not effective to defend against sophisticated backdoor attacks . Therefore , we introduce a novel backdoor defense ( cf . Alg . 1 ) that has three-folds of novelty : ( 1 ) a novel two-layer defense , ( 2 ) a new dynamic clustering approach ( §3.1 ) , and ( 3 ) a new adaptive threshold tuning scheme for clipping and noising ( §3.2 ) . The clustering component filters out malicious model updates with high attack impact while adaptive smoothing , clipping , and noising eliminate potentially remaining malicious model contributions . Moreover , BAFFLE is able to mitigate more complex attack scenarios like the simultaneous injection of different backdoors by several adversaries that can not be handled in existing defenses ( §3 ) . 3 . We design tailored efficient secure ( two-party ) computation protocols for BAFFLE resulting in private BAFFLE , the first privacy-preserving backdoor defense that also inhibits inference attacks ( §4 ) . To the best of our knowledge , no existing defense against backdoor attacks preserves the privacy of the clients ’ data ( §6 ) . 4 . We demonstrate BAFFLE ’ s effectiveness against backdoor attacks through an extensive evaluation on various datasets and applications ( §5 ) . Beyond mitigating state-of-the-art backdoor attacks , we also show that BAFFLE succeeds to thwart adaptive attacks that optimize the attack strategy to circumvent BAFFLE ( §5.1 ) . 5 . We evaluate the overhead of applying secure two-party computation to demonstrate the efficiency of private BAFFLE . A training iteration of private BAFFLE for a neural network with 2.7 million parameters and 50 clients on CIFAR-10 takes less than 13 minutes ( §5.3 ) . 2 BACKGROUND AND PROBLEM SETTING . Federated learning ( FL ) is a concept for distributed machine learning where K clients and an aggregator A collaboratively build a global model G ( McMahan et al. , 2017 ) . In training round t ∈ [ 1 , T ] , each client i ∈ [ 1 , K ] locally trains a local modelWi ( with p parameters/weightsw1i , . . . , w p i ) based on the previous global model Gt−1 using its local data Di and sends Wi to A . Then , A aggregates the received models Wi into the new global model Gt by averaging the local models ( weighted by the number of training samples used to train it ) : Gt = ΣKi=1 ni×Wi n , where ni = ‖Di‖ , n = ΣKi=1ni ( cf . Alg . 2 and Alg . 3 in §A for details ) . In practice , previous works employ equal weights ( ni = n/K ) for the contributions of all clients ( Bagdasaryan et al. , 2020 ; Xie et al. , 2020 ) . We adopt this approach , i.e. , we set Gt = ΣKi=1 Wi K . Adversary model : In typical FL settings , there are two adversaries : malicious clients that try to inject backdoors into the global model and honest-but-curious ( a.k.a . semi-honest ) aggregators that correctly compute and follow the training protocols , but aim at ( passively ) gaining information about the training data of the clients through inference attacks ( Bonawitz et al. , 2017 ) . The former type of adversary Ac has full control over K ′ ( K ′ < K2 ) clients and their training data , processes , and parameters ( Bagdasaryan et al. , 2020 ) . Ac also has full knowledge of the aggregator ’ s operations , including potentially applied backdooring defenses and can arbitrarily adapt its attack strategy at any time during the training like simultaneously injecting none , one , or several backdoors . However , Ac has no control over any processes executed at the aggregator nor over the honest clients . The second adversary type , the honest-but-curious aggregatorAs , has access to all local model updates Wi , and can thus perform model inference attacks on each local model Wi to extract information about the corresponding participant ’ s data Di used for training Wi . Backdoor attacks . The goals of Ac are two-fold : ( 1 ) Impact : Ac aims at manipulating the global model Gt such that the modified model G′t provides incorrect predictions G′t ( x ) = c ′ 6= Gt ( x ) , ∀x ∈ IAc , where IAc is a trigger set specific adversary-chosen inputs . ( 2 ) Stealthiness : In addition , Ac seeks to make poisoned models and benign models indistinguishable to avoid detection . Model G′t should therefore perform normally on all other inputs that are not in the trigger set , i.e. , G′t ( x ) = Gt ( x ) , ∀x 6∈ IAc , and the dissimilarity ( e.g. , Euclidean distance ) between a poisoned model W ′ and a benign model W must be smaller than a threshold ε : ‖W ′ −W‖ < ε . Inference Attacks . The honest-but-curious aggregator As attempts to infer sensitive information about clients ’ data Di from their model updates Wi ( Pyrgelis et al. , 2018 ; Shokri et al. , 2017 ; Ganju et al. , 2018 ; Carlini et al. , 2019 ; Melis et al. , 2019 ) by maximising the information φi = Infer ( Wi ) that As gains about the data Di of client i by inferring from its corresponding model Wi . 3 BACKDOOR-RESILIENT FEDERATED LEARNING . We introduce BAFFLE , a novel defense against backdoor attacks preventing adversary Ac from achieving attack stealthiness and impact ( cf . §2 ) . Ac can control the attack impact by , e.g. , adjusting the poisoned data rate PDR , i.e. , the fraction of poisoned data DAc in the training data D ( Eq . 3 ) , or , by tuning the loss-control parameter α that controls the trade-off between backdoor task learning and similarity with the global model ( Eq . 4 ) , see §D for details . On one hand , by increasing attack impact , poisoned models become more dissimilar to benign ones , i.e. , easier to be detected . One the other hand , if poisoned updates are not well trained on the backdoor to remain undetected , the backdoor can be eliminated more easily . BAFFLE exploits this conflict to realize a multilayer backdoor defense shown in Fig . 1 and Alg . 1 . The first layer , called Model Filtering ( §3.1 ) , uses dynamic clustering to identify and remove potentially poisoned model updates having high attack impact . The second layer , called Poison Elimination ( §3.2 ) , leverages an adaptive threshold tuning scheme to clip model weights in combination with appropriate noising to smooth out and remove the backdoor impact of potentially surviving poisoned model updates . 3.1 FILTERING POISONED MODELS . The Model Filtering layer utilizes a new dynamic clustering approach aiming at excluding models with high attack impact . It overcomes several limitations of existing defenses as ( 1 ) it can handle dynamic attack scenarios such as simultaneous injection of multiple backdoors , and ( 2 ) it minimizes false positives . Existing defenses ( Blanchard et al. , 2017 ; Shen et al. , 2016 ) cluster updates into two groups where the smaller group is always considered potentially malicious and removed , leading to false positives and reduced accuracy when no attack is taking place . More importantly , Ac may also split compromised clients into several groups injecting different backdoors . A fixed number of clusters bares the risk that poisoned and benign models end up in the same cluster , in particular , if models with different backdoors differ significantly . This is shown in Fig . 2 depicting different clusterings of model updates1 . Fig . 2a shows the ground truth where Ac uses two groups of clients : 20 clients inject a backdoor and five provide random models to fool the deployed clustering-based defense . Fig . 2b shows how K-means ( as used by Shen et al . ( 2016 ) ) fails to separate benign and poisoned models so that all poisoned ones end up in the same cluster with the benign models . 1The models were trained for an FL-based Network Intrusion Detection System ( NIDS ) , cf . §E . Algorithm 1 BAFFLE 1 : Input : K , G0 , T . K is the number of clients , G0 is the initial global model , T is the number of training iterations 2 : Output : GT . GT is the updated global model after T iterations 3 : for each training iteration t in [ 1 , T ] do 4 : for each client i in [ 1 , K ] do 5 : Wi ← CLIENTUPDATE ( Gt−1 ) . The aggregator sendsGt−1 to Client i who trainsGt−1 using its dataDi locally to achieve local modalWi and sendsWi back to the aggregator . 6 : ( c11 , . . . , cKK ) ← COSINEDISTANCE ( W1 , . . . , WK ) . ∀i , j ∈ ( 1 , . . . , K ) , cij is the Cosine distance betweenWi andWj 7 : ( b1 , . . . , bL ) ← CLUSTERING ( c11 , . . . , cKK ) . L is the number of admitted models , bl are the indices of the admitted models 8 : ( e1 , . . . , eK ) ← EUCLIDEANDISTISTANCES ( Gt−1 , ( W1 , . . . , WK ) ) . ei is the Euclidean distance betweenGt−1 andWi 9 : St ← MEDIAN ( e1 , . . . , eK ) . St is the adaptive clipping bound at round t 10 : for each client l in [ 1 , L ] do 11 : W∗bl ← Wbl ∗ MIN ( 1 , St/ebl ) . W ∗ bl is the admitted model after clipped by the adaptive clipping bound St 12 : G∗t ← ∑L l=1W ∗ bl /L . Aggregating , G∗t is the plain global model before adding noise 13 : σ ← λ ∗ St . Adaptive noising level 14 : Gt ← G∗t +N ( 0 , σ ) . Adaptive noising Dynamic Clustering . We overcome both challenges by calculating the pairwise Cosine distances measuring the angular differences between all model updates and applying the HDBSCAN clustering algorithm ( Campello et al. , 2013 ) . The Cosine distance is not affected by attacks that scale updates to boost their impact as this does not change the angle between the updates . While Ac can easily manipulate the L2-norms of updates , reducing the Cosine distances decreases the attack impact ( Fung et al. , 2018 ) . HDBSCAN clusters the models based on their density and dynamically determines the required number of clusters . This can also be a single cluster , preventing false positives in the absence of attacks . Additionally , HDBSCAN labels models as noise if they do not fit into any cluster . This allows BAFFLE to efficiently handle multiple poisoned models with different backdoors by labeling them as noise to be excluded . We select the minimum cluster size to be at least 50 % of the clients , i.e. , K2 + 1 , s.t . it contains the majority of the updates ( which we assume to be benign , cf . §2 ) . All remaining ( potentially poisoned ) models are marked as outliers . This behavior is depicted in Fig . 2d where the two benign clusters C and D from Fig . 2c are merged into one cluster while both malicious and random contributions are labeled as outliers . Hence , to the best of our knowledge , our clustering is the first FL backdoor defense for dynamic attacks where the number of injected backdoors varies . The clustering step is shown in Lines 6-7 of Alg . 1 where L models ( Wb1 , . . . , WbL ) are accepted .
In the paper, the authors proposed a novel privacy-preserving defense approach BAFFLE for federated learning which could simultaneously impede backdoor and inference attacks. To impede backdoor attacks, the Model Filtering layer (i.e., by dynamic clustering) and Poison Elimination layer (i.e., by noising and clipping) were presented respectively for the malicious updates and the weak manipulations of the model. To thwart inference attacks, private BAFFLE was built to evaluate the BAFFLE algorithm under encryption using secure computation techniques.
SP:aeb3b57c2e2f7f7dfba24ee77e4aab2f445b947f