paper_name stringlengths 11 170 | text stringlengths 8.07k 307k | summary stringlengths 152 6.16k | paper_id stringlengths 43 43 |
|---|---|---|---|
Overcoming barriers to the training of effective learned optimizers | 1 INTRODUCTION . Much of the success of modern deep learning has been driven by a shift from hand-designed features carefully curated by human experts , to domain-agnostic methods that can learn features from large amounts of data . By leveraging large-scale datasets with flexible models , we are now able to rapidly learn powerful features for new problem settings that often generalize to novel tasks . While learned features outperform hand-designed features on numerous tasks ( Krizhevsky et al. , 2012 ; Berner et al. , 2019 ; Vinyals et al. , 2019 ; Piech et al. , 2015 ) , we continue to use hand-designed optimization algorithms ( such as gradient descent , momentum , and so on ) for training models . These hand-designed update rules benefit from decades of optimization research but still require extensive expert supervision in order to be used effectively in machine learning . For example , they fail to flexibly adapt to new problem settings and require careful tuning of learning rate schedules and momentum timescales for different model architectures and datasets ( Choi et al. , 2019 ) . In addition , most do not leverage alternative sources of information beyond the gradient , such as the validation loss . By separating the optimization target ( training loss ) from the broader goal ( generalization ) , classic methods require more careful tuning of regularization and/or data augmentation strategies by the practitioner . To address these drawbacks , recent work on learned optimizers aims to replace hand-designed optimizers with a parametric optimizer , trained on a set of tasks , that can then be applied more generally . Recent work in this area has focused on either augmenting existing optimizers to adapt their own hyperparameters ( Daniel et al. , 2016 ; Xu et al. , 2017 ; 2019 ) , or developing more expressive learned optimizers to replace existing optimizers entirely ( Andrychowicz et al. , 2016 ; Wichrowska et al. , 2017 ; Lv et al. , 2017 ; Metz et al. , 2018 ; 2019a ; b ; Gu et al. , 2019 ) . These latter models take in problem information ( such as the current gradient of the training loss ) and iteratively update parameters . However , to date , learned optimizers have proven to be brittle and ineffective at generalizing across diverse sets of problems . Our work identifies fundamental barriers that have limited progress in learned optimizer research and addresses several of these barriers to train effective optimizers : 1 . Computational scale : Training a learned optimizer is costly . When training the optimizer , a single training step requires applying the optimizer to a training task for some number of unrolled steps . This work utilizes massive parallel computing infrastructure to scale the number of unrolled steps an order of magnitude larger than in previous work . 2 . Training tasks : Deep learning requires large training datasets . For learned optimizers to be effective , we similarly need a large dataset of optimization tasks on which to train . We build off of the TaskSet dataset ( Metz et al. , 2020 ) and construct a dataset of more than a six thousand diverse optimization tasks commonly found in machine learning . We show how this large and diverse task distribution is critical for training optimizers that generalize . 3 . Inductive bias of optimizer architecture : The parameterization of the learned optimizer and the task information fed to it both strongly affect performance . We propose a new hierarchical learned optimizer architecture that incorporates additional task information ( such as validation loss ) , and show that it outperforms previous learned optimizer architectures . By addressing these barriers , we develop learned optimizers that exceed prior work in scale , robustness , and out of distribution generalization . As a final test , we show that the learned optimizer can be used to train new learned optimizers from scratch ( analogous to “ self-hosting ” compilers ( Hart and Levin , 1962 ) ) . 2 PRELIMINARIES . Training a learned optimizer is a bilevel optimization problem that contains two loops : an inner loop that applies the optimizer to solve a task , and an outer loop that iteratively updates the parameters of the learned optimizer ( Franceschi et al. , 2018 ) . We use the inner- and outer- prefixes throughout to be explicit about which optimization loop we are referring to . That is , the inner-loss refers to a target task ’ s loss function that we wish to optimize , and the outer-loss refers to a measure of the optimizer ’ s performance training the target task ( inner-task ) . Correspondingly , we refer to the optimizer parameters as outer-parameters , and the parameters that the optimizer is updating as inner-parameters . Outer-optimization refers to the act of finding outer-parameters that perform well under some outer-loss . For a given inner-task , we apply the learned optimizer for some number of steps ( unrolling the optimizer ) . Ideally , we would unroll each target task until some stopping criterion is reached , but this is computationally infeasible for even moderate scale machine learning tasks . Each outer-iteration requires unrolling the optimizer on a target task . Short ( truncated ) unrolls are more computationally efficient , but suffer from truncation bias Wu et al . ( 2016 ) ; Metz et al . ( 2019b ) in that the outer-loss surface computed using truncated unrolls is different ( and may have different minima ) than the fully unrolled outer-loss . 3 METHODS : ADDRESSING THE THREE BARRIERS TO LEARNED OPTIMIZERS . 3.1 OUTER-OPTIMIZATION . To train the optimizer , we minimize an outer-loss that quantifies the performance of the optimizer . This is defined as the mean of the inner-loss computed on the inner-validation set for some number of unrolled steps , averaged over inner-tasks in the outer-training taskset . Although this outer-loss is differentiable , it is costly to compute the outer-gradient ( which involves backpropagating through the unrolled optimization ) . In addition , the outer-loss surface is badly conditioned and extremely non-smooth Metz et al . ( 2019b ) , making it difficult to optimize . We deal with these issues by using derivative-free optimization–specifically , evolutionary strategies ( ES ) Rechenberg ( 1973 ) –to minimize the outer-loss , obviating the need to compute derivatives through the unrolled optimization process . Previous work has used unrolled derivatives ( Andrychowicz et al. , 2016 ; Wichrowska et al. , 2017 ; Metz et al. , 2019b ) , and was thus limited to short numbers of unrolled steps ( e.g . 20 in Andrychowicz et al . ( 2016 ) and starting at 50 in Metz et al . ( 2019b ) ) . Without ES , the gradient estimates we obtain are extreamly high variance to the point that no training occurs . Using ES , we are able to use considerably longer unrolls . Initial unroll lengths were chosen to balance communication cost between parallel workers ( updating optimizer parameters ) with the computational cost of unrolling on individual workers ( estimating the local gradient with ES ) . We start outer-training by sampling unroll steps uniformly from 240-360 . When performance saturates with these biased gradients , continue training with an unbiased , but more expensive , gradient estimator ( see Appendix B ) . ES and PES have an additional benefit , in that optimizing with ES smooths the underlying loss function . This smoothing helps stabilize outer-training ( Metz et al. , 2019b ) . We set the standard deviation of the Gaussian distribution used by the ES algorithm ( which also controls how much the outer-loss is smoothed ) to 0.01 . To deal with the high variance of the ES estimate of the gradient , we use antithetic sampling and train in in parallel using 1024 multi-core CPU workers . While using more workers increases training speed , we find 1024 to be the point where performance gains become sub-linear . For more details see Appendix B . 3.2 TASK DISTRIBUTIONS . To train the optimizer , we need to define a set of inner-tasks to use for training . The choice of training tasks is critically important for two reasons : it determines the ability of the optimizer to outer-generalize ( i.e . the learned optimizer ’ s performance on new tasks ) , and it determines the computational complexity of outer-training . For improved outer-generalization , we would like our inner-problems to be representative of tasks we care about . In this work , these are state-of-the-art machine learning models such as ResNets ( He et al. , 2016a ) or Transformers ( Vaswani et al. , 2017 ) . Unfortunately , directly utilizing these large scale models is computationally infeasible , therefore we outer-train on proxy tasks for speed ( Zoph et al. , 2018 ) . In order to outer-train a learned optimizer capable of generalizing to new optimization tasks , we utilize an outer-training task set consisting of around 6,000 tasks designed after Metz et al . ( 2020 ) . These tasks include RNNs ( Hochreiter and Schmidhuber , 1997 ; Chung et al. , 2014 ) , CNNs ( LeCun , 1998 ) , masked auto regressive flows ( Papamakarios et al. , 2017 ) , fully connected networks , language modeling , variational autoencoders ( Kingma and Welling , 2013 ) , simple 2D test functions , quadratic bowls , and more . For tasks that require them , we additionally sample a dataset , batch size , network architecture , and initialization scheme . To keep outer-training efficient , we ensure that all tasks take less than 100 milliseconds per-training step . For each task that makes use of a dataset , we create four splits of the data to prevent leakage : training data , which we compute gradients on and use to update the inner-parameters ; inner-validation data , which is used to compute validation losses used by the learned optimizer ; outer-validation data , which is used to update the weights of the learned optimizer ; and test data , which is used to test an already trained learned optimizer . Because loss values vary in magnitude , when outer-training we normalize these outer-loss values by the best loss achieved by a baseline optimizer and the initial loss value . Note this normalization is not used during inner-training . 3.3 OPTIMIZER ARCHITECTURE . Designing a learned optimizer architecture requires balancing computational efficiency and expressivity . Past work in learned optimizers has shown that incorporating inductive biases based on existing optimization techniques such as momentum or second moment accumulation leads to better performance ( Wichrowska et al. , 2017 ; Metz et al. , 2019b ) . The optimizer we use in this work consists of a hierarchical optimizer similar to ( Wichrowska et al. , 2017 ) ( Figure 1 ) . A per-tensor LSTM is run on features computed over each parameter tensor . This LSTM then forwards information to the other tensors ’ LSTMs as well as to a per-parameter feedforward neural network . The per-parameter feedforward network additionally takes in information about gradients and parameter value , and outputs parameter updates . Additional outputs are aggregated and fed back into the per-tensor network . This information routing allows for communication across all components . For per-parameter features we leverage effective inductive biases from hand-designed optimizers , and use a variety of features including the gradient , the parameter value , and momentum-like running averages of both . All features are normalized , in a fashion similar to that in RMSProp ( Tieleman and Hinton , 2012 ) , or relative to the norm across the full tensor . For per-tensor features we use a variety of features built from summary statistics computed from the current tensor , the tensor ’ s gradient , and running average features such as momentum and second moments . We also include information about the tensor ’ s rank and shape . We also feed global features into the per-tensor LSTM , such as training loss and validation loss , normalized so as to have a relatively consistent scale across tasks . To compute a weight update , the per-parameter MLP outputs two values , ( a , b ) , which are used to update inner-parameters : wt+1 = wt + exp ( a ) b . See Appendix C for many more details . | This paper attempts to address the fundamental barriers of learned optimization. The authors identify three barriers: computational requirements, number of training tasks and lack of inductive bias. A “large-scale” evaluation and comparison of learned optimizers is then carried out using many (1024) multi-core CPUs. A simple modification of an existing learned optimizer is also proposed that involves adding more input features. Unfortunately the results don’t seem to reveal any new insights. | SP:cc0f8de167292fb0c4030746628536907cb3913a |
Overcoming barriers to the training of effective learned optimizers | 1 INTRODUCTION . Much of the success of modern deep learning has been driven by a shift from hand-designed features carefully curated by human experts , to domain-agnostic methods that can learn features from large amounts of data . By leveraging large-scale datasets with flexible models , we are now able to rapidly learn powerful features for new problem settings that often generalize to novel tasks . While learned features outperform hand-designed features on numerous tasks ( Krizhevsky et al. , 2012 ; Berner et al. , 2019 ; Vinyals et al. , 2019 ; Piech et al. , 2015 ) , we continue to use hand-designed optimization algorithms ( such as gradient descent , momentum , and so on ) for training models . These hand-designed update rules benefit from decades of optimization research but still require extensive expert supervision in order to be used effectively in machine learning . For example , they fail to flexibly adapt to new problem settings and require careful tuning of learning rate schedules and momentum timescales for different model architectures and datasets ( Choi et al. , 2019 ) . In addition , most do not leverage alternative sources of information beyond the gradient , such as the validation loss . By separating the optimization target ( training loss ) from the broader goal ( generalization ) , classic methods require more careful tuning of regularization and/or data augmentation strategies by the practitioner . To address these drawbacks , recent work on learned optimizers aims to replace hand-designed optimizers with a parametric optimizer , trained on a set of tasks , that can then be applied more generally . Recent work in this area has focused on either augmenting existing optimizers to adapt their own hyperparameters ( Daniel et al. , 2016 ; Xu et al. , 2017 ; 2019 ) , or developing more expressive learned optimizers to replace existing optimizers entirely ( Andrychowicz et al. , 2016 ; Wichrowska et al. , 2017 ; Lv et al. , 2017 ; Metz et al. , 2018 ; 2019a ; b ; Gu et al. , 2019 ) . These latter models take in problem information ( such as the current gradient of the training loss ) and iteratively update parameters . However , to date , learned optimizers have proven to be brittle and ineffective at generalizing across diverse sets of problems . Our work identifies fundamental barriers that have limited progress in learned optimizer research and addresses several of these barriers to train effective optimizers : 1 . Computational scale : Training a learned optimizer is costly . When training the optimizer , a single training step requires applying the optimizer to a training task for some number of unrolled steps . This work utilizes massive parallel computing infrastructure to scale the number of unrolled steps an order of magnitude larger than in previous work . 2 . Training tasks : Deep learning requires large training datasets . For learned optimizers to be effective , we similarly need a large dataset of optimization tasks on which to train . We build off of the TaskSet dataset ( Metz et al. , 2020 ) and construct a dataset of more than a six thousand diverse optimization tasks commonly found in machine learning . We show how this large and diverse task distribution is critical for training optimizers that generalize . 3 . Inductive bias of optimizer architecture : The parameterization of the learned optimizer and the task information fed to it both strongly affect performance . We propose a new hierarchical learned optimizer architecture that incorporates additional task information ( such as validation loss ) , and show that it outperforms previous learned optimizer architectures . By addressing these barriers , we develop learned optimizers that exceed prior work in scale , robustness , and out of distribution generalization . As a final test , we show that the learned optimizer can be used to train new learned optimizers from scratch ( analogous to “ self-hosting ” compilers ( Hart and Levin , 1962 ) ) . 2 PRELIMINARIES . Training a learned optimizer is a bilevel optimization problem that contains two loops : an inner loop that applies the optimizer to solve a task , and an outer loop that iteratively updates the parameters of the learned optimizer ( Franceschi et al. , 2018 ) . We use the inner- and outer- prefixes throughout to be explicit about which optimization loop we are referring to . That is , the inner-loss refers to a target task ’ s loss function that we wish to optimize , and the outer-loss refers to a measure of the optimizer ’ s performance training the target task ( inner-task ) . Correspondingly , we refer to the optimizer parameters as outer-parameters , and the parameters that the optimizer is updating as inner-parameters . Outer-optimization refers to the act of finding outer-parameters that perform well under some outer-loss . For a given inner-task , we apply the learned optimizer for some number of steps ( unrolling the optimizer ) . Ideally , we would unroll each target task until some stopping criterion is reached , but this is computationally infeasible for even moderate scale machine learning tasks . Each outer-iteration requires unrolling the optimizer on a target task . Short ( truncated ) unrolls are more computationally efficient , but suffer from truncation bias Wu et al . ( 2016 ) ; Metz et al . ( 2019b ) in that the outer-loss surface computed using truncated unrolls is different ( and may have different minima ) than the fully unrolled outer-loss . 3 METHODS : ADDRESSING THE THREE BARRIERS TO LEARNED OPTIMIZERS . 3.1 OUTER-OPTIMIZATION . To train the optimizer , we minimize an outer-loss that quantifies the performance of the optimizer . This is defined as the mean of the inner-loss computed on the inner-validation set for some number of unrolled steps , averaged over inner-tasks in the outer-training taskset . Although this outer-loss is differentiable , it is costly to compute the outer-gradient ( which involves backpropagating through the unrolled optimization ) . In addition , the outer-loss surface is badly conditioned and extremely non-smooth Metz et al . ( 2019b ) , making it difficult to optimize . We deal with these issues by using derivative-free optimization–specifically , evolutionary strategies ( ES ) Rechenberg ( 1973 ) –to minimize the outer-loss , obviating the need to compute derivatives through the unrolled optimization process . Previous work has used unrolled derivatives ( Andrychowicz et al. , 2016 ; Wichrowska et al. , 2017 ; Metz et al. , 2019b ) , and was thus limited to short numbers of unrolled steps ( e.g . 20 in Andrychowicz et al . ( 2016 ) and starting at 50 in Metz et al . ( 2019b ) ) . Without ES , the gradient estimates we obtain are extreamly high variance to the point that no training occurs . Using ES , we are able to use considerably longer unrolls . Initial unroll lengths were chosen to balance communication cost between parallel workers ( updating optimizer parameters ) with the computational cost of unrolling on individual workers ( estimating the local gradient with ES ) . We start outer-training by sampling unroll steps uniformly from 240-360 . When performance saturates with these biased gradients , continue training with an unbiased , but more expensive , gradient estimator ( see Appendix B ) . ES and PES have an additional benefit , in that optimizing with ES smooths the underlying loss function . This smoothing helps stabilize outer-training ( Metz et al. , 2019b ) . We set the standard deviation of the Gaussian distribution used by the ES algorithm ( which also controls how much the outer-loss is smoothed ) to 0.01 . To deal with the high variance of the ES estimate of the gradient , we use antithetic sampling and train in in parallel using 1024 multi-core CPU workers . While using more workers increases training speed , we find 1024 to be the point where performance gains become sub-linear . For more details see Appendix B . 3.2 TASK DISTRIBUTIONS . To train the optimizer , we need to define a set of inner-tasks to use for training . The choice of training tasks is critically important for two reasons : it determines the ability of the optimizer to outer-generalize ( i.e . the learned optimizer ’ s performance on new tasks ) , and it determines the computational complexity of outer-training . For improved outer-generalization , we would like our inner-problems to be representative of tasks we care about . In this work , these are state-of-the-art machine learning models such as ResNets ( He et al. , 2016a ) or Transformers ( Vaswani et al. , 2017 ) . Unfortunately , directly utilizing these large scale models is computationally infeasible , therefore we outer-train on proxy tasks for speed ( Zoph et al. , 2018 ) . In order to outer-train a learned optimizer capable of generalizing to new optimization tasks , we utilize an outer-training task set consisting of around 6,000 tasks designed after Metz et al . ( 2020 ) . These tasks include RNNs ( Hochreiter and Schmidhuber , 1997 ; Chung et al. , 2014 ) , CNNs ( LeCun , 1998 ) , masked auto regressive flows ( Papamakarios et al. , 2017 ) , fully connected networks , language modeling , variational autoencoders ( Kingma and Welling , 2013 ) , simple 2D test functions , quadratic bowls , and more . For tasks that require them , we additionally sample a dataset , batch size , network architecture , and initialization scheme . To keep outer-training efficient , we ensure that all tasks take less than 100 milliseconds per-training step . For each task that makes use of a dataset , we create four splits of the data to prevent leakage : training data , which we compute gradients on and use to update the inner-parameters ; inner-validation data , which is used to compute validation losses used by the learned optimizer ; outer-validation data , which is used to update the weights of the learned optimizer ; and test data , which is used to test an already trained learned optimizer . Because loss values vary in magnitude , when outer-training we normalize these outer-loss values by the best loss achieved by a baseline optimizer and the initial loss value . Note this normalization is not used during inner-training . 3.3 OPTIMIZER ARCHITECTURE . Designing a learned optimizer architecture requires balancing computational efficiency and expressivity . Past work in learned optimizers has shown that incorporating inductive biases based on existing optimization techniques such as momentum or second moment accumulation leads to better performance ( Wichrowska et al. , 2017 ; Metz et al. , 2019b ) . The optimizer we use in this work consists of a hierarchical optimizer similar to ( Wichrowska et al. , 2017 ) ( Figure 1 ) . A per-tensor LSTM is run on features computed over each parameter tensor . This LSTM then forwards information to the other tensors ’ LSTMs as well as to a per-parameter feedforward neural network . The per-parameter feedforward network additionally takes in information about gradients and parameter value , and outputs parameter updates . Additional outputs are aggregated and fed back into the per-tensor network . This information routing allows for communication across all components . For per-parameter features we leverage effective inductive biases from hand-designed optimizers , and use a variety of features including the gradient , the parameter value , and momentum-like running averages of both . All features are normalized , in a fashion similar to that in RMSProp ( Tieleman and Hinton , 2012 ) , or relative to the norm across the full tensor . For per-tensor features we use a variety of features built from summary statistics computed from the current tensor , the tensor ’ s gradient , and running average features such as momentum and second moments . We also include information about the tensor ’ s rank and shape . We also feed global features into the per-tensor LSTM , such as training loss and validation loss , normalized so as to have a relatively consistent scale across tasks . To compute a weight update , the per-parameter MLP outputs two values , ( a , b ) , which are used to update inner-parameters : wt+1 = wt + exp ( a ) b . See Appendix C for many more details . | The authors propose to use a combination of Andrychowicz et al. LSTM based approach and Metz et.al feed forward network to learn an optimizer that is useful accross any task. The authors propose to use a few thousand tasks as developed in Metz et. al. for the purpose of training the optimizer. They focus on evolutionary strategies (ES) in lieu of unrolled optimization to keep the problem tractable. | SP:cc0f8de167292fb0c4030746628536907cb3913a |
A Provably Convergent and Practical Algorithm for Min-Max Optimization with Applications to GANs | 1 INTRODUCTION . We consider the problem of min-max optimization minx∈Rd maxy∈Rd f ( x , y ) , where the loss function f may be nonconvex in x and nonconcave in y. Min-max optimization of such loss functions has many applications to machine learning , including to GANs ( Goodfellow et al. , 2014 ) and adversarial training ( Madry et al. , 2018 ) . In particular , following Goodfellow et al . ( 2014 ) , GAN training can be formulated as a min-max optimization problem where x encodes the parameters of a “ generator ” network , and y encodes the parameters of a “ discriminator ” network . Unlike standard minimization problems , the min-max nature of GANs makes them particularly difficult to train ( Goodfellow , 2017 ) , and has received wide attention . A common algorithm to solve these min-max optimization problems , gradient descent ascent ( GDA ) , alternates between stochastic gradient descent steps for x and ascent steps for y.1 The advantage of GDA is that it just requires first-order access to f and each iteration is efficient in terms of memory and time , making it quite practical . However , as many works have observed , GDA can suffer from issues such as cycling ( Arjovsky & Bottou , 2017 ) and “ mode collapse ” ( Dumoulin et al. , 2017 ; Che et al. , 2017 ; Santurkar et al. , 2018 ) . Several recent works have focused on finding convergent first-order algorithms for min-max optimization ( Rafique et al. , 2018 ; Daskalakis et al. , 2018 ; Liang & Stokes , 2019 ; Gidel et al. , 2019b ; Mertikopoulos et al. , 2019 ; Nouiehed et al. , 2019 ; Lu et al. , 2020 ; Lin et al. , 2020 ; Mokhtari et al. , 2019 ; Thekumparampil et al. , 2019 ; Mokhtari et al. , 2020 ) . However , these algorithms are also not guaranteed to converge for general nonconvex-nonconcave min-max problems . The challenge is that min-max optimization generalizes nonconvex minimization , which , in general , is intractable . Algorithms for nonconvex minimization resort to finding “ local ” optima or assume a starting point “ close ” to a global optimum . However , unlike minimization problems where local notions of optima exist ( Nesterov & Polyak , 2006 ) , it has been challenging to define a notion of convergent points for min-max optimization , and most notions of local optima considered in previous works ( Daskalakis & Panageas , 2018 ; Jin et al. , 2020 ; Fiez et al. , 2019 ) require significant restrictions for existence . Our contributions . Our main result is a new first-order algorithm for min-max optimization ( Algorithm 1 ) that for any ε > 0 , any nonconvex-nonconcave loss function , and any starting point , converges in poly ( d , L , b , 1/ε ) steps , if f is b-bounded with L-Lipschitz gradient ( Theorem 2.3 ) . 1In practice , gradients steps are often replaced by ADAM steps ; we ignore this distinction for this discussion . A key ingredient in our result is an approximation to the global max function maxz∈Rd f ( x , z ) . Unlike GDA and related algorithms that alternate between updating the discriminator and generator in an incremental fashion , our algorithm lets the discriminator run a convergent algorithm ( such as gradient ascent ) until it reaches a first-order stationary point . We then empower the generator to simulate the discriminator ’ s response for arbitrarily many gradient ascent updates . Roughly , at each iteration of our algorithm , the min-player proposes a stochastic ( batch ) gradient update for x and simulates the response of the max-player with gradient ascent steps for y until it reaches a first-order stationary point . If the resulting loss has decreased , the updates for x and y are accepted ; otherwise they are only accepted with a small probability ( a la simulated annealing ) . The point ( x ? , y ? ) returned by our algorithm satisfies the following guarantee : if the min-player proposes a stochastic gradient descent update to x ? , and the max-player is allowed to respond by updating y ? using any “ path ” that increases the loss at a rate of at least ε — with high probability , the final loss can not decrease by more than ε . See Section 2 for our convergence guarantees , Section 4 for the key ideas in our proof , and Appendix C for a comparison to previous notions of convergence . Empirically , we apply our algorithm for training GANs ( with the cross-entropy loss ) on both synthetic ( mixture of Gaussians ) and real-world ( MNIST and CIFAR-10 ) datasets ( Section 3 ) . We compare our algorithm ’ s performance against two related algorithms : gradient/ADAM descent ascent ( with one or multiple discriminator steps ) , and Unrolled GANs ( Metz et al. , 2017 ) . Our simulations with MNIST ( Figure 1 ) and mixture of Gaussians ( Figure 2 ) indicate that training GANs using our algorithm can avoid mode collapse and cycling . For instance , on the Gaussian mixture dataset , we found that by around the 1500 ’ th iteration GDA learned only one mode in 100 % of the runs , and cycled between multiple modes . In contrast , our algorithm learned all four modes in 68 % of the runs , and three modes in 26 % of the runs . On 0-1 MNIST , we found that GDA tends to briefly generate shapes that look like a combination of 0 ’ s and 1 ’ s , then switches between generating only 1 ’ s and only 0 ’ s . In contrast , our algorithm seems to learn to generate both 0 ’ s and 1 ’ s early on and does not stop generating either digit . GANs trained using our algorithm generated both digits by the 1000 ’ th iteration in 86 % of the runs , while those trained using GDA only did so in 23 % of the runs . Our CIFAR-10 simulations ( Figure 3 ) indicate that our algorithm trains more stably , resulting in a lower mean and standard deviation for FID scores compared to GDA . Furthermore , the per-step computational and memory cost of our algorithm is similar to GDA indicating that our algorithm can scale to larger datasets . Related work . Guaranteed convergence for min-max optimization . Several works have studied GDA dynamics in GANs ( Nagarajan & Kolter , 2017 ; Mescheder et al. , 2017 ; Li et al. , 2018 ; Balduzzi et al. , 2018 ; Daskalakis & Panageas , 2018 ; Jin et al. , 2020 ) and established that GDA suffers from severe limitations : GDA can exhibit rotation around some points , or otherwise fail to converge . Thus , we can not expect global convergence guarantees for GDA . To address these convergence issues for GDA , multiple works have proposed algorithms based on Optimistic Mirror Descent ( OMD ) , Extra-gradient method , or similar approaches ( Gidel et al. , 2019b ; Daskalakis et al. , 2018 ; Liang & Stokes , 2019 ; Daskalakis & Panageas , 2019 ; Mokhtari et al. , 2019 ; 2020 ) . These algorithms avoid some of the pathological behaviors of GDA and achieve guaranteed convergence in poly ( κ , log ( 1/ε ) ) iterations where κ is the condition number of f. However , all these results either require convexity/concavity assumptions on f , which usually do not hold for GANs , or require that the starting point lies in a small region around an equilibrium point , and hence provide no guarantees for an arbitrary initialization . Some works also provide convergence guarantees for min-max optimization ( Nemirovski & Yudin , 1978 ; Kinderlehrer & Stampacchia , 1980 ; Nemirovski , 2004 ; Rafique et al. , 2018 ; Lu et al. , 2020 ; Lin et al. , 2020 ; Nouiehed et al. , 2019 ; Thekumparampil et al. , 2019 ) . However , they require f to be concave in y , again limiting their applicability . As for nonconvex-nonconcave min-max optimization , Heusel et al . ( 2017 ) prove convergence of finite-step GDA , under the assumption that the underlying continuous dynamics converge to a local min-max optimum ( this assumption may not even hold for f that is bi-linear ) . Jin et al . ( 2020 ) present a version of GDA for min-max optimization ( generalized by Fiez et al . ( 2019 ) ) such that if the algorithm converges , the convergence point is a local min-max optimum . Both these results require that the min-player use a vanishingly small step size relative to the max-player , resulting in slow convergence . Wang et al . ( 2020 ) present an algorithm that can converge for nonconvex-nonconcave functions , but requires the initial point to lie in a region close a local min-max optimum ( such optima are not guaranteed to exist ) . In contrast to the above works , our algorithm is guaranteed to converge for any nonconvex-nonconcave loss , from any starting point , in poly ( d , L , b , 1/ε ) steps , if f is b-bounded with L-Lipschitz gradient . Greedy paths . The paths along which the max-player is allowed to make updates in our equilibrium definition are inspired from the work of Mangoubi & Vishnoi ( 2020 ) , which gives a second-order algorithm for min-max optimization . The “ greedy paths ” considered in their work are defined such that at every point along these paths , f is non-decreasing , and the first derivative of f is at least ε or the 2nd derivative is at least √ ε . In contrast , we just require a condition on the first derivative of f along the path . This distinction gives rise to a different notion of equilibrium than the one presented in their work . The first-order condition on the paths crucially also results in our algorithm being applicable to machine learning settings where only first-order oracles are available , because unlike Mangoubi & Vishnoi ( 2020 ) , traversing such a path only requires first-order access to f . Training GANs . Starting with Goodfellow et al . ( 2014 ) , there has been considerable work to develop algorithms to train GANs . One line of work focuses on modifying the loss to improve convergence ( Arjovsky et al. , 2017 ; Bellemare et al. , 2017 ; Lim & Ye , 2017 ; Mao et al. , 2017 ; Salimans et al. , 2018 ; Metz et al. , 2017 ) . Another line of work regularizes the discriminator using gradient penalties or spectral normalization ( Gulrajani et al. , 2017 ; Kodali et al. , 2017 ; Miyato et al. , 2018 ) . Metz et al . ( 2017 ) introduced Unrolled GANs , where the generator optimizes an “ unrolled ” loss function that allows the generator to simulate a fixed number of discriminator updates . While this has some similarity to our algorithm there are two important distinctions : 1 ) the discriminator in Unrolled GANs may not reach a first-order stationary point , and hence their algorithm does not come with any convergence guarantees , and 2 ) unlike our algorithm , the implementation of the generator in Unrolled GANs requires memory that grows with the number of discriminator steps , limiting its scalability . We observe that our algorithm , applied to training GANs , trains stably and avoids mode collapse , while achieving a training time per iteration and memory requirements that are similar to GDA , and much lower than Unrolled GANs ( Metz et al. , 2017 ) ( see also the discussion in Section 5 ) . Remark 1.1 ( Loss functions in GANs ) . Loss functions f : Rd×Rd → R which take bounded values on Rd × Rd arise in many GAN applications . For instance , GANs with mean-squared error loss Mao et al . ( 2017 ) have uniformly bounded f . GANs with cross entropy loss Goodfellow et al . ( 2014 ) have f uniformly bounded above , and Wasserstein GANs Arjovsky et al . ( 2017 ) have a loss function f ( x , y ) which is bounded above as a function of y and is uniformly bounded below . | The paper introduces a first-order algorithm for nonconvex-nonconcave min-max optimization problems. The proposed algorithm terminates in time polynomial in the dimension and smoothness parameters of the loss function. The points (x*,y*) returned by the algorithm satisfy the following guarantee: if the min-player proposes a stochastic gradient descent update to x^*, and the max-player is allowed to respond by updating y^* using any “path” that increases the loss at a rate of at least \epsilon with high probability, the final loss cannot decrease by more than \epsilon. Then the algorithm is tested in GANs settings on mixtures of Gaussians, MNIST and CIFAR-10 datasets against compared against gradient/ADAM descent ascent and Unrolled GANs. The algorithm is shown to be significantly more stable than GDA (e.g. less mode collapse, cycling, and more stable digit generation). | SP:4985bfe9b838b639e0841b767cccf5eead3f8e47 |
A Provably Convergent and Practical Algorithm for Min-Max Optimization with Applications to GANs | 1 INTRODUCTION . We consider the problem of min-max optimization minx∈Rd maxy∈Rd f ( x , y ) , where the loss function f may be nonconvex in x and nonconcave in y. Min-max optimization of such loss functions has many applications to machine learning , including to GANs ( Goodfellow et al. , 2014 ) and adversarial training ( Madry et al. , 2018 ) . In particular , following Goodfellow et al . ( 2014 ) , GAN training can be formulated as a min-max optimization problem where x encodes the parameters of a “ generator ” network , and y encodes the parameters of a “ discriminator ” network . Unlike standard minimization problems , the min-max nature of GANs makes them particularly difficult to train ( Goodfellow , 2017 ) , and has received wide attention . A common algorithm to solve these min-max optimization problems , gradient descent ascent ( GDA ) , alternates between stochastic gradient descent steps for x and ascent steps for y.1 The advantage of GDA is that it just requires first-order access to f and each iteration is efficient in terms of memory and time , making it quite practical . However , as many works have observed , GDA can suffer from issues such as cycling ( Arjovsky & Bottou , 2017 ) and “ mode collapse ” ( Dumoulin et al. , 2017 ; Che et al. , 2017 ; Santurkar et al. , 2018 ) . Several recent works have focused on finding convergent first-order algorithms for min-max optimization ( Rafique et al. , 2018 ; Daskalakis et al. , 2018 ; Liang & Stokes , 2019 ; Gidel et al. , 2019b ; Mertikopoulos et al. , 2019 ; Nouiehed et al. , 2019 ; Lu et al. , 2020 ; Lin et al. , 2020 ; Mokhtari et al. , 2019 ; Thekumparampil et al. , 2019 ; Mokhtari et al. , 2020 ) . However , these algorithms are also not guaranteed to converge for general nonconvex-nonconcave min-max problems . The challenge is that min-max optimization generalizes nonconvex minimization , which , in general , is intractable . Algorithms for nonconvex minimization resort to finding “ local ” optima or assume a starting point “ close ” to a global optimum . However , unlike minimization problems where local notions of optima exist ( Nesterov & Polyak , 2006 ) , it has been challenging to define a notion of convergent points for min-max optimization , and most notions of local optima considered in previous works ( Daskalakis & Panageas , 2018 ; Jin et al. , 2020 ; Fiez et al. , 2019 ) require significant restrictions for existence . Our contributions . Our main result is a new first-order algorithm for min-max optimization ( Algorithm 1 ) that for any ε > 0 , any nonconvex-nonconcave loss function , and any starting point , converges in poly ( d , L , b , 1/ε ) steps , if f is b-bounded with L-Lipschitz gradient ( Theorem 2.3 ) . 1In practice , gradients steps are often replaced by ADAM steps ; we ignore this distinction for this discussion . A key ingredient in our result is an approximation to the global max function maxz∈Rd f ( x , z ) . Unlike GDA and related algorithms that alternate between updating the discriminator and generator in an incremental fashion , our algorithm lets the discriminator run a convergent algorithm ( such as gradient ascent ) until it reaches a first-order stationary point . We then empower the generator to simulate the discriminator ’ s response for arbitrarily many gradient ascent updates . Roughly , at each iteration of our algorithm , the min-player proposes a stochastic ( batch ) gradient update for x and simulates the response of the max-player with gradient ascent steps for y until it reaches a first-order stationary point . If the resulting loss has decreased , the updates for x and y are accepted ; otherwise they are only accepted with a small probability ( a la simulated annealing ) . The point ( x ? , y ? ) returned by our algorithm satisfies the following guarantee : if the min-player proposes a stochastic gradient descent update to x ? , and the max-player is allowed to respond by updating y ? using any “ path ” that increases the loss at a rate of at least ε — with high probability , the final loss can not decrease by more than ε . See Section 2 for our convergence guarantees , Section 4 for the key ideas in our proof , and Appendix C for a comparison to previous notions of convergence . Empirically , we apply our algorithm for training GANs ( with the cross-entropy loss ) on both synthetic ( mixture of Gaussians ) and real-world ( MNIST and CIFAR-10 ) datasets ( Section 3 ) . We compare our algorithm ’ s performance against two related algorithms : gradient/ADAM descent ascent ( with one or multiple discriminator steps ) , and Unrolled GANs ( Metz et al. , 2017 ) . Our simulations with MNIST ( Figure 1 ) and mixture of Gaussians ( Figure 2 ) indicate that training GANs using our algorithm can avoid mode collapse and cycling . For instance , on the Gaussian mixture dataset , we found that by around the 1500 ’ th iteration GDA learned only one mode in 100 % of the runs , and cycled between multiple modes . In contrast , our algorithm learned all four modes in 68 % of the runs , and three modes in 26 % of the runs . On 0-1 MNIST , we found that GDA tends to briefly generate shapes that look like a combination of 0 ’ s and 1 ’ s , then switches between generating only 1 ’ s and only 0 ’ s . In contrast , our algorithm seems to learn to generate both 0 ’ s and 1 ’ s early on and does not stop generating either digit . GANs trained using our algorithm generated both digits by the 1000 ’ th iteration in 86 % of the runs , while those trained using GDA only did so in 23 % of the runs . Our CIFAR-10 simulations ( Figure 3 ) indicate that our algorithm trains more stably , resulting in a lower mean and standard deviation for FID scores compared to GDA . Furthermore , the per-step computational and memory cost of our algorithm is similar to GDA indicating that our algorithm can scale to larger datasets . Related work . Guaranteed convergence for min-max optimization . Several works have studied GDA dynamics in GANs ( Nagarajan & Kolter , 2017 ; Mescheder et al. , 2017 ; Li et al. , 2018 ; Balduzzi et al. , 2018 ; Daskalakis & Panageas , 2018 ; Jin et al. , 2020 ) and established that GDA suffers from severe limitations : GDA can exhibit rotation around some points , or otherwise fail to converge . Thus , we can not expect global convergence guarantees for GDA . To address these convergence issues for GDA , multiple works have proposed algorithms based on Optimistic Mirror Descent ( OMD ) , Extra-gradient method , or similar approaches ( Gidel et al. , 2019b ; Daskalakis et al. , 2018 ; Liang & Stokes , 2019 ; Daskalakis & Panageas , 2019 ; Mokhtari et al. , 2019 ; 2020 ) . These algorithms avoid some of the pathological behaviors of GDA and achieve guaranteed convergence in poly ( κ , log ( 1/ε ) ) iterations where κ is the condition number of f. However , all these results either require convexity/concavity assumptions on f , which usually do not hold for GANs , or require that the starting point lies in a small region around an equilibrium point , and hence provide no guarantees for an arbitrary initialization . Some works also provide convergence guarantees for min-max optimization ( Nemirovski & Yudin , 1978 ; Kinderlehrer & Stampacchia , 1980 ; Nemirovski , 2004 ; Rafique et al. , 2018 ; Lu et al. , 2020 ; Lin et al. , 2020 ; Nouiehed et al. , 2019 ; Thekumparampil et al. , 2019 ) . However , they require f to be concave in y , again limiting their applicability . As for nonconvex-nonconcave min-max optimization , Heusel et al . ( 2017 ) prove convergence of finite-step GDA , under the assumption that the underlying continuous dynamics converge to a local min-max optimum ( this assumption may not even hold for f that is bi-linear ) . Jin et al . ( 2020 ) present a version of GDA for min-max optimization ( generalized by Fiez et al . ( 2019 ) ) such that if the algorithm converges , the convergence point is a local min-max optimum . Both these results require that the min-player use a vanishingly small step size relative to the max-player , resulting in slow convergence . Wang et al . ( 2020 ) present an algorithm that can converge for nonconvex-nonconcave functions , but requires the initial point to lie in a region close a local min-max optimum ( such optima are not guaranteed to exist ) . In contrast to the above works , our algorithm is guaranteed to converge for any nonconvex-nonconcave loss , from any starting point , in poly ( d , L , b , 1/ε ) steps , if f is b-bounded with L-Lipschitz gradient . Greedy paths . The paths along which the max-player is allowed to make updates in our equilibrium definition are inspired from the work of Mangoubi & Vishnoi ( 2020 ) , which gives a second-order algorithm for min-max optimization . The “ greedy paths ” considered in their work are defined such that at every point along these paths , f is non-decreasing , and the first derivative of f is at least ε or the 2nd derivative is at least √ ε . In contrast , we just require a condition on the first derivative of f along the path . This distinction gives rise to a different notion of equilibrium than the one presented in their work . The first-order condition on the paths crucially also results in our algorithm being applicable to machine learning settings where only first-order oracles are available , because unlike Mangoubi & Vishnoi ( 2020 ) , traversing such a path only requires first-order access to f . Training GANs . Starting with Goodfellow et al . ( 2014 ) , there has been considerable work to develop algorithms to train GANs . One line of work focuses on modifying the loss to improve convergence ( Arjovsky et al. , 2017 ; Bellemare et al. , 2017 ; Lim & Ye , 2017 ; Mao et al. , 2017 ; Salimans et al. , 2018 ; Metz et al. , 2017 ) . Another line of work regularizes the discriminator using gradient penalties or spectral normalization ( Gulrajani et al. , 2017 ; Kodali et al. , 2017 ; Miyato et al. , 2018 ) . Metz et al . ( 2017 ) introduced Unrolled GANs , where the generator optimizes an “ unrolled ” loss function that allows the generator to simulate a fixed number of discriminator updates . While this has some similarity to our algorithm there are two important distinctions : 1 ) the discriminator in Unrolled GANs may not reach a first-order stationary point , and hence their algorithm does not come with any convergence guarantees , and 2 ) unlike our algorithm , the implementation of the generator in Unrolled GANs requires memory that grows with the number of discriminator steps , limiting its scalability . We observe that our algorithm , applied to training GANs , trains stably and avoids mode collapse , while achieving a training time per iteration and memory requirements that are similar to GDA , and much lower than Unrolled GANs ( Metz et al. , 2017 ) ( see also the discussion in Section 5 ) . Remark 1.1 ( Loss functions in GANs ) . Loss functions f : Rd×Rd → R which take bounded values on Rd × Rd arise in many GAN applications . For instance , GANs with mean-squared error loss Mao et al . ( 2017 ) have uniformly bounded f . GANs with cross entropy loss Goodfellow et al . ( 2014 ) have f uniformly bounded above , and Wasserstein GANs Arjovsky et al . ( 2017 ) have a loss function f ( x , y ) which is bounded above as a function of y and is uniformly bounded below . | This paper proposes a new stochastic gradient descent-ascent-based method to approximate a stationary point (or local min-max solution) of a nonconvex-nonconcave minimax problem with application in GANs. The method is similar to the one in the GAN original paper, but the authors incorporate it with an acceptance rule and use a different model for the max problem. The algorithm also uses ADAM instead of standard SGD. The authors also provide some convergence guarantee to a local min-max point in polynomial-time complexity. Unfortunately, the reviewer was unable to verify the proof due to the time limit. | SP:4985bfe9b838b639e0841b767cccf5eead3f8e47 |
A Provably Convergent and Practical Algorithm for Min-Max Optimization with Applications to GANs | 1 INTRODUCTION . We consider the problem of min-max optimization minx∈Rd maxy∈Rd f ( x , y ) , where the loss function f may be nonconvex in x and nonconcave in y. Min-max optimization of such loss functions has many applications to machine learning , including to GANs ( Goodfellow et al. , 2014 ) and adversarial training ( Madry et al. , 2018 ) . In particular , following Goodfellow et al . ( 2014 ) , GAN training can be formulated as a min-max optimization problem where x encodes the parameters of a “ generator ” network , and y encodes the parameters of a “ discriminator ” network . Unlike standard minimization problems , the min-max nature of GANs makes them particularly difficult to train ( Goodfellow , 2017 ) , and has received wide attention . A common algorithm to solve these min-max optimization problems , gradient descent ascent ( GDA ) , alternates between stochastic gradient descent steps for x and ascent steps for y.1 The advantage of GDA is that it just requires first-order access to f and each iteration is efficient in terms of memory and time , making it quite practical . However , as many works have observed , GDA can suffer from issues such as cycling ( Arjovsky & Bottou , 2017 ) and “ mode collapse ” ( Dumoulin et al. , 2017 ; Che et al. , 2017 ; Santurkar et al. , 2018 ) . Several recent works have focused on finding convergent first-order algorithms for min-max optimization ( Rafique et al. , 2018 ; Daskalakis et al. , 2018 ; Liang & Stokes , 2019 ; Gidel et al. , 2019b ; Mertikopoulos et al. , 2019 ; Nouiehed et al. , 2019 ; Lu et al. , 2020 ; Lin et al. , 2020 ; Mokhtari et al. , 2019 ; Thekumparampil et al. , 2019 ; Mokhtari et al. , 2020 ) . However , these algorithms are also not guaranteed to converge for general nonconvex-nonconcave min-max problems . The challenge is that min-max optimization generalizes nonconvex minimization , which , in general , is intractable . Algorithms for nonconvex minimization resort to finding “ local ” optima or assume a starting point “ close ” to a global optimum . However , unlike minimization problems where local notions of optima exist ( Nesterov & Polyak , 2006 ) , it has been challenging to define a notion of convergent points for min-max optimization , and most notions of local optima considered in previous works ( Daskalakis & Panageas , 2018 ; Jin et al. , 2020 ; Fiez et al. , 2019 ) require significant restrictions for existence . Our contributions . Our main result is a new first-order algorithm for min-max optimization ( Algorithm 1 ) that for any ε > 0 , any nonconvex-nonconcave loss function , and any starting point , converges in poly ( d , L , b , 1/ε ) steps , if f is b-bounded with L-Lipschitz gradient ( Theorem 2.3 ) . 1In practice , gradients steps are often replaced by ADAM steps ; we ignore this distinction for this discussion . A key ingredient in our result is an approximation to the global max function maxz∈Rd f ( x , z ) . Unlike GDA and related algorithms that alternate between updating the discriminator and generator in an incremental fashion , our algorithm lets the discriminator run a convergent algorithm ( such as gradient ascent ) until it reaches a first-order stationary point . We then empower the generator to simulate the discriminator ’ s response for arbitrarily many gradient ascent updates . Roughly , at each iteration of our algorithm , the min-player proposes a stochastic ( batch ) gradient update for x and simulates the response of the max-player with gradient ascent steps for y until it reaches a first-order stationary point . If the resulting loss has decreased , the updates for x and y are accepted ; otherwise they are only accepted with a small probability ( a la simulated annealing ) . The point ( x ? , y ? ) returned by our algorithm satisfies the following guarantee : if the min-player proposes a stochastic gradient descent update to x ? , and the max-player is allowed to respond by updating y ? using any “ path ” that increases the loss at a rate of at least ε — with high probability , the final loss can not decrease by more than ε . See Section 2 for our convergence guarantees , Section 4 for the key ideas in our proof , and Appendix C for a comparison to previous notions of convergence . Empirically , we apply our algorithm for training GANs ( with the cross-entropy loss ) on both synthetic ( mixture of Gaussians ) and real-world ( MNIST and CIFAR-10 ) datasets ( Section 3 ) . We compare our algorithm ’ s performance against two related algorithms : gradient/ADAM descent ascent ( with one or multiple discriminator steps ) , and Unrolled GANs ( Metz et al. , 2017 ) . Our simulations with MNIST ( Figure 1 ) and mixture of Gaussians ( Figure 2 ) indicate that training GANs using our algorithm can avoid mode collapse and cycling . For instance , on the Gaussian mixture dataset , we found that by around the 1500 ’ th iteration GDA learned only one mode in 100 % of the runs , and cycled between multiple modes . In contrast , our algorithm learned all four modes in 68 % of the runs , and three modes in 26 % of the runs . On 0-1 MNIST , we found that GDA tends to briefly generate shapes that look like a combination of 0 ’ s and 1 ’ s , then switches between generating only 1 ’ s and only 0 ’ s . In contrast , our algorithm seems to learn to generate both 0 ’ s and 1 ’ s early on and does not stop generating either digit . GANs trained using our algorithm generated both digits by the 1000 ’ th iteration in 86 % of the runs , while those trained using GDA only did so in 23 % of the runs . Our CIFAR-10 simulations ( Figure 3 ) indicate that our algorithm trains more stably , resulting in a lower mean and standard deviation for FID scores compared to GDA . Furthermore , the per-step computational and memory cost of our algorithm is similar to GDA indicating that our algorithm can scale to larger datasets . Related work . Guaranteed convergence for min-max optimization . Several works have studied GDA dynamics in GANs ( Nagarajan & Kolter , 2017 ; Mescheder et al. , 2017 ; Li et al. , 2018 ; Balduzzi et al. , 2018 ; Daskalakis & Panageas , 2018 ; Jin et al. , 2020 ) and established that GDA suffers from severe limitations : GDA can exhibit rotation around some points , or otherwise fail to converge . Thus , we can not expect global convergence guarantees for GDA . To address these convergence issues for GDA , multiple works have proposed algorithms based on Optimistic Mirror Descent ( OMD ) , Extra-gradient method , or similar approaches ( Gidel et al. , 2019b ; Daskalakis et al. , 2018 ; Liang & Stokes , 2019 ; Daskalakis & Panageas , 2019 ; Mokhtari et al. , 2019 ; 2020 ) . These algorithms avoid some of the pathological behaviors of GDA and achieve guaranteed convergence in poly ( κ , log ( 1/ε ) ) iterations where κ is the condition number of f. However , all these results either require convexity/concavity assumptions on f , which usually do not hold for GANs , or require that the starting point lies in a small region around an equilibrium point , and hence provide no guarantees for an arbitrary initialization . Some works also provide convergence guarantees for min-max optimization ( Nemirovski & Yudin , 1978 ; Kinderlehrer & Stampacchia , 1980 ; Nemirovski , 2004 ; Rafique et al. , 2018 ; Lu et al. , 2020 ; Lin et al. , 2020 ; Nouiehed et al. , 2019 ; Thekumparampil et al. , 2019 ) . However , they require f to be concave in y , again limiting their applicability . As for nonconvex-nonconcave min-max optimization , Heusel et al . ( 2017 ) prove convergence of finite-step GDA , under the assumption that the underlying continuous dynamics converge to a local min-max optimum ( this assumption may not even hold for f that is bi-linear ) . Jin et al . ( 2020 ) present a version of GDA for min-max optimization ( generalized by Fiez et al . ( 2019 ) ) such that if the algorithm converges , the convergence point is a local min-max optimum . Both these results require that the min-player use a vanishingly small step size relative to the max-player , resulting in slow convergence . Wang et al . ( 2020 ) present an algorithm that can converge for nonconvex-nonconcave functions , but requires the initial point to lie in a region close a local min-max optimum ( such optima are not guaranteed to exist ) . In contrast to the above works , our algorithm is guaranteed to converge for any nonconvex-nonconcave loss , from any starting point , in poly ( d , L , b , 1/ε ) steps , if f is b-bounded with L-Lipschitz gradient . Greedy paths . The paths along which the max-player is allowed to make updates in our equilibrium definition are inspired from the work of Mangoubi & Vishnoi ( 2020 ) , which gives a second-order algorithm for min-max optimization . The “ greedy paths ” considered in their work are defined such that at every point along these paths , f is non-decreasing , and the first derivative of f is at least ε or the 2nd derivative is at least √ ε . In contrast , we just require a condition on the first derivative of f along the path . This distinction gives rise to a different notion of equilibrium than the one presented in their work . The first-order condition on the paths crucially also results in our algorithm being applicable to machine learning settings where only first-order oracles are available , because unlike Mangoubi & Vishnoi ( 2020 ) , traversing such a path only requires first-order access to f . Training GANs . Starting with Goodfellow et al . ( 2014 ) , there has been considerable work to develop algorithms to train GANs . One line of work focuses on modifying the loss to improve convergence ( Arjovsky et al. , 2017 ; Bellemare et al. , 2017 ; Lim & Ye , 2017 ; Mao et al. , 2017 ; Salimans et al. , 2018 ; Metz et al. , 2017 ) . Another line of work regularizes the discriminator using gradient penalties or spectral normalization ( Gulrajani et al. , 2017 ; Kodali et al. , 2017 ; Miyato et al. , 2018 ) . Metz et al . ( 2017 ) introduced Unrolled GANs , where the generator optimizes an “ unrolled ” loss function that allows the generator to simulate a fixed number of discriminator updates . While this has some similarity to our algorithm there are two important distinctions : 1 ) the discriminator in Unrolled GANs may not reach a first-order stationary point , and hence their algorithm does not come with any convergence guarantees , and 2 ) unlike our algorithm , the implementation of the generator in Unrolled GANs requires memory that grows with the number of discriminator steps , limiting its scalability . We observe that our algorithm , applied to training GANs , trains stably and avoids mode collapse , while achieving a training time per iteration and memory requirements that are similar to GDA , and much lower than Unrolled GANs ( Metz et al. , 2017 ) ( see also the discussion in Section 5 ) . Remark 1.1 ( Loss functions in GANs ) . Loss functions f : Rd×Rd → R which take bounded values on Rd × Rd arise in many GAN applications . For instance , GANs with mean-squared error loss Mao et al . ( 2017 ) have uniformly bounded f . GANs with cross entropy loss Goodfellow et al . ( 2014 ) have f uniformly bounded above , and Wasserstein GANs Arjovsky et al . ( 2017 ) have a loss function f ( x , y ) which is bounded above as a function of y and is uniformly bounded below . | This paper treats non-convex/non-concave min/max problems motivated by the respective problems that arise in GAN training. The main contribution is that they develop an ADAM-based algorithm that converges to \eps- local min/max points. The paper seems to be well-written and easy to follow. Moreover the proofs seem correct and sound. That said, my main concerns about this paper are twofold: | SP:4985bfe9b838b639e0841b767cccf5eead3f8e47 |
Machine Reading Comprehension with Enhanced Linguistic Verifiers | 1 INTRODUCTION . Teaching a machine to read and comprehend large-scale textual documents is a promising and longstanding goal of natural language understanding . This field , so called machine reading comprehension ( MRC ) ( Zhang et al. , 2019 ; 2020c ) , has achieved impressive milestones in recent years thanks to the releasing of large-scale benchmark datasets and pretrained contextualized language models ( CLM ) . For example , for the well-testified span-extraction style SQuAD2.0 dataset1 , current best results under the framework of pretraining+fine-tuning employing ALBERT ( Lan et al. , 2020 ) are 90.7 % of exact matching ( EM ) and 93.0 % of F1 score , exceeds their human-level scores of 86.8 % and 89.5 % ( Rajpurkar et al. , 2016 ; 2018 ) in a large margin . MRC is traditionally defined to be a question-answering task which outputs answers by given inputs of passage-question pairs . Considering the types of answers , Chen ( 2018 ) classified MRC ’ s tasks into four categories : cloze-filling of a question with gaps ( Ghaeini et al. , 2018 ) , multiple-choice from several options ( Zhang et al. , 2020a ) , span extraction of answer from the passage ( Rajpurkar et al. , 2016 ; 2018 ; Trischler et al. , 2017 ) and free-style answer generation and summarization from the passage ( Nguyen et al. , 2016 ) . MRC is regarded to be widely applicable to numerous applications that are rich of question-style queries , such as information retrieval and task-oriented conversations . For detailed survey of this field , please refer to ( Zhang et al. , 2020c ) for recent research roadmap , datasets and future directions . In this paper , we focus on span-extraction style MRC with unanswerable questions . Rajpurkar et al . ( 2018 ) introduced 50K+ unanswerable questions to construct the SQuAD2.0 dataset . Unanswerable questions include rewriting originally answerable questions through ways of negation word inserted or removed , antonym used , entity swap , mutual exclusion , and impossible condition . Plausible answers which correspond to spans in the given passage are attached to these unanswerable questions . Numerous verifiers have been proposed to score the answerability of questions . For example , Hu et al . ( 2019 ) proposed a read-then-verify system that explicitly verified the legitimacy of the predicted answer . An answer verifier was designed to decide whether or not the predicted answer is entailable by the input snippets ( i.e. , segments of the input passage ) . Their system achieved a F1 score of 74.8 % and 74.2 % respectively on the SQuAD2.0 ’ s dev and test sets . Zhang et al . ( 2020b ) proposed a 1https : //rajpurkar.github.io/SQuAD-explorer/ pipeline with two verifiers : a sketchy reading verifier that briefly investigates the overall interactions of between a segment and a question through a binary classification network following CLM , and an intensive reading module that includes a span extractor and an answerability verifier . These two verifiers are interpolated to yield the final decision of answerablility . This framework has achieved significant improvements ( F1 score of 90.9 % and 91.4 % , respectively on the dev and test sets of SQuAD2.0 ) than the strong ALBERT baseline ( Lan et al. , 2020 ) . Minimizing span losses of start and end positions of answers for answerable questions is overwhelming in current pretraining+fine-tuning frameworks . However , there are still requirements for designing fine-grained verifiers for predicting questions ’ answerabilities by utilizing the interaction of between answer-injected questions and passages . It is valuable for us to score the linguistic correctness of the predicted answer , through replacing the interrogatives in questions by their predicted answers to check out if it is a linguistically correct sentence and in addition if the given passage can entail that rewritten question . For example , there are two reference answers ( “ P is not equal to NP ” as a complete sentence , “ not equal ” as a verb phrase ) to a question “ What implication can be derived for P and NP if P and co-NP are established to be unequal ? ” . When a system predicts “ not equal to NP. ” with unbalanced arguments ( i.e. , containing objective argument NP yet missing subjective argument P ) , it is scored 0 in exact match and discounted in F1 score . Intuitively , “ P is not equal to NP/not equal implication ... ” should be scored higher than “ not equal to NP implication ... ” . This motivates our first position-sensitive question-rewritten verifier . That is , we score the correctness and completeness of the predicted answer and the rewritten question by the existing CLM models , and build an entailment network that takes cross-attention of between the rewritten question and passage as inputs . On the other hand , the original passage/document is frequently too long to be directly used in pretraining+tuning frameworks . For example , as reported in ( Gong et al. , 2020 ) , passages in TriviaQA dataset ( Joshi et al. , 2017 ) averagely contain 2,622 tokens generated by BERT tokenizer ( Kudo & Richardson , 2018 ) in their training set . Current CLMs are incapable of accepting arbitrarily long token sequences . Thus , we are forced to cut the passage into segments with fixed length ( e.g. , 512 tokens with strides such as 128 or 256 ) . Then , the reference input to MRC now is a fix-length segment instead of the whole passage . When the manually annotated answer to the question is out of the scope of the segment , the question will be annotated to be unanswerable regardless its answerability in the whole passage . This brings bias to answerable questions since one individual segment loses its context , and it is possible that this segment implicitly contain clues for correctly answering the question . For example , in SQuAD2.0 , only one answer span is provided for one question regardless of the multiple appearances ( 104,674 appearances of answer texts for the 86,821 answerable questions ) of the same answer text in the given paragraph . For long-text MRC , Gong et al . ( 2020 ) proposed recurrent chunking mechanisms by first employing reinforcement learning to centralize the candidate answer span in the segment and then building a recurrent network to transfer contextual information among segments . Considering that it is non-trivial of data-preparation and multi-turn reasoning for training and inferencing under a reinforcement learning framework , we propose a different solution in this paper . We build a hierarchical attention network ( HAN ) ( Yang et al. , 2016 ) on sentence-level , segment-level and finally paragraph-level cross-attentions to questions for extracting and verifying candidate answers . Since the HAN framework includes segment sequences in a recurrent way , Gong et al . ( 2020 ) ’ s recurrent chunking can be regarded as a special case of ours . We combine these two types of verifiers together into a pipeline , and apply it to three span-extraction MRC benchmark sets : SQuAD2.0 ( Rajpurkar et al. , 2018 ) , NewsQA ( Trischler et al. , 2017 ) , and TriviaQA ( Joshi et al. , 2017 ) ( wikipedia part ) . Our pipeline achieves significantly better improvements on both exact matching and F1 scores than state-of-the-art baselines . 2 ENHANCED LINGUISTIC VERIFIERS . 2.1 ANSWER-INJECTED REWRITING OF QUESTIONS . The overwhelming types of questions in span-extraction MRC datasets are in a scope of 5W1H , as listed in Table 1 . NewsQA ’ s statistical information comes from their website2 . We calculate the train and validation sets together for SQuAD2.0 and TriviaQA , using these 5W1H interrogatives and their extensions ( such as “ whom ” and “ whose ” are all who-style question indicators ) . 2https : //www.microsoft.com/en-us/research/project/newsqa-dataset There are nearly 5 % questions that contain multiple interrogatives , such as WhatWDT year and whereWRB was the first perfect score given ? , WhoWP gets to choose whereWRB a gymnast starts to run on the runway ? . In order to detect interrogatives , we utilize Stanford dependency parser V4.0.0 ( Chen & Manning , 2014 ) which outputs the dependency tree together with words ’ POS tags . We inject answer text to questions with one interrogative by simply replacing it with the answer text . For questions with multiple interrogatives , we first parse the answer text and obtain its POS tag sequence and then align the interrogatives with the words in the answer text through simple heuristic rules such as whoWP for personal names , whereWRB for spaces , whenWRB for time and date . In case we fail finding the alignment , we simply attach the answer text at the left-hand-side of the question . We count on multi-head self-attention mechanism ( Vaswani et al. , 2017 ) in CLMs as a linguistic scorer to score the linguistic likelihood of the sequence . 2.2 REWRITTEN QUESTION RELATED VERIFICATION . Figure 1 illustrates our answer verification framework . We propose two types of maximum likelihood losses to score the sequences of predicted answer text and answer-injected question text by tunable pretrained CLMs . In addition , inspired by ( Zhang et al. , 2020b ) , we adapt a cross-attention span loss on the segment and rewritten question . We first integrate a question ( with |q| tokens ) and a segment ( with |p| tokens ) of a paragraph in a standard format of “ [ CLS ] question [ SEP ] segment [ SEP ] ” . Here , [ CLS ] is a classification token which is recognized to contain information of the whole sequence with a length of ( |q|+ |p|+ 3 ) . There are two separation [ SEP ] tokens respectively follow the question and the segment . The whole sequence will be sent to tunable CLMs which first embed the sequence using token , position , and segment ( tokens in “ [ CLS ] question [ SEP ] ” are assigned value of 0 , otherwise 1 ) embedding networks . Then , Transformer ’ s encoder layers are employed to represent the sequence to finally output the H tensor . Suppose that each token in H is represented by a h-dimension vector ( e.g. , h=4,096 ) . H is sent to a linear layer which projects h-dim into 2-dim , i.e. , ( batch , |q|+ |p|+ 3 , 2 ) , standing for the start/end position scores of each token in the segment . Cross entropy loss is adapted to compute the span loss , numbered with l1 in Figure 1 . Simultaneously , the vector of the first position in a sequence , i.e. , [ CLS ] ’ s representation vector is sent to a dropout layer and then a linear layer that projects h-dim into 2-dim to score the answerability of the question , by employing cross entropy loss l2 . Our proposed losses are denoted by l3 ( phrase-level ) , l4 ( sentence-level ) and l5 ( question-segment level ) in Figure 1 . We give detailed ablation experiments of these three losses in the Appendix . Note that we focus on answerable questions , i.e. , we compute these losses only when the question is answerable annotated in the train/dev sets and predicted to be answerable by the “ binary classifier ” during training/testing . One motivation is that the best-reported exact matching score for answerable questions only achieved 83.1 % while the whole exact matching score was 90.9 % , reported in ( Zhang et al. , 2020b ) . This 7.8 % gap reflects the importance of verifying the linguistic correctness of predicted answer phrases to the answerable questions . In order to compute the “ linguistic likelihood ” of these two sequences , predicted answer text and rewritten question , we first attach a [ CLS ] token to each of them and then sent them to the same CLMs . Each [ CLS ] ’ s representative vector will be further sent to a h-to-1 linear layer . The second option of computing the likelihood of the predicted answer text is to compare a similarity score ( e.g. , cosine ) of between its [ CLS ] ’ s vector and the reference answer text ’ s [ CLS ] vector . | In this paper, two linguistic verifiers are proposed to improve the model performance on machine reading comprehension datasets, such as SQuAD v2, NewsQA and TriviaQA. The first verifier rewrites the question by replacing its interrogatives with the predicted answer phrases. Then it computes a score between the rewritten question and the context, so that the answer candidates are position-sensitive. The second verifier leverages a hierarchical attention network, so that the long context can be split in to shorter segments, which are then recurrently connected to conduct answerability classification and boundary determination. | SP:9b909cc1c71ca942c7b094c735181010d93a7d86 |
Machine Reading Comprehension with Enhanced Linguistic Verifiers | 1 INTRODUCTION . Teaching a machine to read and comprehend large-scale textual documents is a promising and longstanding goal of natural language understanding . This field , so called machine reading comprehension ( MRC ) ( Zhang et al. , 2019 ; 2020c ) , has achieved impressive milestones in recent years thanks to the releasing of large-scale benchmark datasets and pretrained contextualized language models ( CLM ) . For example , for the well-testified span-extraction style SQuAD2.0 dataset1 , current best results under the framework of pretraining+fine-tuning employing ALBERT ( Lan et al. , 2020 ) are 90.7 % of exact matching ( EM ) and 93.0 % of F1 score , exceeds their human-level scores of 86.8 % and 89.5 % ( Rajpurkar et al. , 2016 ; 2018 ) in a large margin . MRC is traditionally defined to be a question-answering task which outputs answers by given inputs of passage-question pairs . Considering the types of answers , Chen ( 2018 ) classified MRC ’ s tasks into four categories : cloze-filling of a question with gaps ( Ghaeini et al. , 2018 ) , multiple-choice from several options ( Zhang et al. , 2020a ) , span extraction of answer from the passage ( Rajpurkar et al. , 2016 ; 2018 ; Trischler et al. , 2017 ) and free-style answer generation and summarization from the passage ( Nguyen et al. , 2016 ) . MRC is regarded to be widely applicable to numerous applications that are rich of question-style queries , such as information retrieval and task-oriented conversations . For detailed survey of this field , please refer to ( Zhang et al. , 2020c ) for recent research roadmap , datasets and future directions . In this paper , we focus on span-extraction style MRC with unanswerable questions . Rajpurkar et al . ( 2018 ) introduced 50K+ unanswerable questions to construct the SQuAD2.0 dataset . Unanswerable questions include rewriting originally answerable questions through ways of negation word inserted or removed , antonym used , entity swap , mutual exclusion , and impossible condition . Plausible answers which correspond to spans in the given passage are attached to these unanswerable questions . Numerous verifiers have been proposed to score the answerability of questions . For example , Hu et al . ( 2019 ) proposed a read-then-verify system that explicitly verified the legitimacy of the predicted answer . An answer verifier was designed to decide whether or not the predicted answer is entailable by the input snippets ( i.e. , segments of the input passage ) . Their system achieved a F1 score of 74.8 % and 74.2 % respectively on the SQuAD2.0 ’ s dev and test sets . Zhang et al . ( 2020b ) proposed a 1https : //rajpurkar.github.io/SQuAD-explorer/ pipeline with two verifiers : a sketchy reading verifier that briefly investigates the overall interactions of between a segment and a question through a binary classification network following CLM , and an intensive reading module that includes a span extractor and an answerability verifier . These two verifiers are interpolated to yield the final decision of answerablility . This framework has achieved significant improvements ( F1 score of 90.9 % and 91.4 % , respectively on the dev and test sets of SQuAD2.0 ) than the strong ALBERT baseline ( Lan et al. , 2020 ) . Minimizing span losses of start and end positions of answers for answerable questions is overwhelming in current pretraining+fine-tuning frameworks . However , there are still requirements for designing fine-grained verifiers for predicting questions ’ answerabilities by utilizing the interaction of between answer-injected questions and passages . It is valuable for us to score the linguistic correctness of the predicted answer , through replacing the interrogatives in questions by their predicted answers to check out if it is a linguistically correct sentence and in addition if the given passage can entail that rewritten question . For example , there are two reference answers ( “ P is not equal to NP ” as a complete sentence , “ not equal ” as a verb phrase ) to a question “ What implication can be derived for P and NP if P and co-NP are established to be unequal ? ” . When a system predicts “ not equal to NP. ” with unbalanced arguments ( i.e. , containing objective argument NP yet missing subjective argument P ) , it is scored 0 in exact match and discounted in F1 score . Intuitively , “ P is not equal to NP/not equal implication ... ” should be scored higher than “ not equal to NP implication ... ” . This motivates our first position-sensitive question-rewritten verifier . That is , we score the correctness and completeness of the predicted answer and the rewritten question by the existing CLM models , and build an entailment network that takes cross-attention of between the rewritten question and passage as inputs . On the other hand , the original passage/document is frequently too long to be directly used in pretraining+tuning frameworks . For example , as reported in ( Gong et al. , 2020 ) , passages in TriviaQA dataset ( Joshi et al. , 2017 ) averagely contain 2,622 tokens generated by BERT tokenizer ( Kudo & Richardson , 2018 ) in their training set . Current CLMs are incapable of accepting arbitrarily long token sequences . Thus , we are forced to cut the passage into segments with fixed length ( e.g. , 512 tokens with strides such as 128 or 256 ) . Then , the reference input to MRC now is a fix-length segment instead of the whole passage . When the manually annotated answer to the question is out of the scope of the segment , the question will be annotated to be unanswerable regardless its answerability in the whole passage . This brings bias to answerable questions since one individual segment loses its context , and it is possible that this segment implicitly contain clues for correctly answering the question . For example , in SQuAD2.0 , only one answer span is provided for one question regardless of the multiple appearances ( 104,674 appearances of answer texts for the 86,821 answerable questions ) of the same answer text in the given paragraph . For long-text MRC , Gong et al . ( 2020 ) proposed recurrent chunking mechanisms by first employing reinforcement learning to centralize the candidate answer span in the segment and then building a recurrent network to transfer contextual information among segments . Considering that it is non-trivial of data-preparation and multi-turn reasoning for training and inferencing under a reinforcement learning framework , we propose a different solution in this paper . We build a hierarchical attention network ( HAN ) ( Yang et al. , 2016 ) on sentence-level , segment-level and finally paragraph-level cross-attentions to questions for extracting and verifying candidate answers . Since the HAN framework includes segment sequences in a recurrent way , Gong et al . ( 2020 ) ’ s recurrent chunking can be regarded as a special case of ours . We combine these two types of verifiers together into a pipeline , and apply it to three span-extraction MRC benchmark sets : SQuAD2.0 ( Rajpurkar et al. , 2018 ) , NewsQA ( Trischler et al. , 2017 ) , and TriviaQA ( Joshi et al. , 2017 ) ( wikipedia part ) . Our pipeline achieves significantly better improvements on both exact matching and F1 scores than state-of-the-art baselines . 2 ENHANCED LINGUISTIC VERIFIERS . 2.1 ANSWER-INJECTED REWRITING OF QUESTIONS . The overwhelming types of questions in span-extraction MRC datasets are in a scope of 5W1H , as listed in Table 1 . NewsQA ’ s statistical information comes from their website2 . We calculate the train and validation sets together for SQuAD2.0 and TriviaQA , using these 5W1H interrogatives and their extensions ( such as “ whom ” and “ whose ” are all who-style question indicators ) . 2https : //www.microsoft.com/en-us/research/project/newsqa-dataset There are nearly 5 % questions that contain multiple interrogatives , such as WhatWDT year and whereWRB was the first perfect score given ? , WhoWP gets to choose whereWRB a gymnast starts to run on the runway ? . In order to detect interrogatives , we utilize Stanford dependency parser V4.0.0 ( Chen & Manning , 2014 ) which outputs the dependency tree together with words ’ POS tags . We inject answer text to questions with one interrogative by simply replacing it with the answer text . For questions with multiple interrogatives , we first parse the answer text and obtain its POS tag sequence and then align the interrogatives with the words in the answer text through simple heuristic rules such as whoWP for personal names , whereWRB for spaces , whenWRB for time and date . In case we fail finding the alignment , we simply attach the answer text at the left-hand-side of the question . We count on multi-head self-attention mechanism ( Vaswani et al. , 2017 ) in CLMs as a linguistic scorer to score the linguistic likelihood of the sequence . 2.2 REWRITTEN QUESTION RELATED VERIFICATION . Figure 1 illustrates our answer verification framework . We propose two types of maximum likelihood losses to score the sequences of predicted answer text and answer-injected question text by tunable pretrained CLMs . In addition , inspired by ( Zhang et al. , 2020b ) , we adapt a cross-attention span loss on the segment and rewritten question . We first integrate a question ( with |q| tokens ) and a segment ( with |p| tokens ) of a paragraph in a standard format of “ [ CLS ] question [ SEP ] segment [ SEP ] ” . Here , [ CLS ] is a classification token which is recognized to contain information of the whole sequence with a length of ( |q|+ |p|+ 3 ) . There are two separation [ SEP ] tokens respectively follow the question and the segment . The whole sequence will be sent to tunable CLMs which first embed the sequence using token , position , and segment ( tokens in “ [ CLS ] question [ SEP ] ” are assigned value of 0 , otherwise 1 ) embedding networks . Then , Transformer ’ s encoder layers are employed to represent the sequence to finally output the H tensor . Suppose that each token in H is represented by a h-dimension vector ( e.g. , h=4,096 ) . H is sent to a linear layer which projects h-dim into 2-dim , i.e. , ( batch , |q|+ |p|+ 3 , 2 ) , standing for the start/end position scores of each token in the segment . Cross entropy loss is adapted to compute the span loss , numbered with l1 in Figure 1 . Simultaneously , the vector of the first position in a sequence , i.e. , [ CLS ] ’ s representation vector is sent to a dropout layer and then a linear layer that projects h-dim into 2-dim to score the answerability of the question , by employing cross entropy loss l2 . Our proposed losses are denoted by l3 ( phrase-level ) , l4 ( sentence-level ) and l5 ( question-segment level ) in Figure 1 . We give detailed ablation experiments of these three losses in the Appendix . Note that we focus on answerable questions , i.e. , we compute these losses only when the question is answerable annotated in the train/dev sets and predicted to be answerable by the “ binary classifier ” during training/testing . One motivation is that the best-reported exact matching score for answerable questions only achieved 83.1 % while the whole exact matching score was 90.9 % , reported in ( Zhang et al. , 2020b ) . This 7.8 % gap reflects the importance of verifying the linguistic correctness of predicted answer phrases to the answerable questions . In order to compute the “ linguistic likelihood ” of these two sequences , predicted answer text and rewritten question , we first attach a [ CLS ] token to each of them and then sent them to the same CLMs . Each [ CLS ] ’ s representative vector will be further sent to a h-to-1 linear layer . The second option of computing the likelihood of the predicted answer text is to compare a similarity score ( e.g. , cosine ) of between its [ CLS ] ’ s vector and the reference answer text ’ s [ CLS ] vector . | This work addresses two main challenges of span-extraction style machine reading comprehension (MRC) tasks: how to evaluate the syntactic completeness of predicted answers and how to utilize the rich context of long documents. To handle such challenges, Question Rewritten Verifier (QRV) and Hierarchical Attention Network (HAN) are proposed respectively. The former uses a question-rewritten method to replace the interrogatives in the question with the answer span for further verification. The latter adopts a hierarchical multi-granularity (sentence, segment, and paragraph) cross-attention to extract and utilize the context information of long paragraphs. Compared with the strong baselines, both the verifiers and their combination achieved relatively significant accuracy improvement on three mainstream span-extraction MRC tasks: SQuAD2.0, NewsQA, and TriviaQA. | SP:9b909cc1c71ca942c7b094c735181010d93a7d86 |
Machine Reading Comprehension with Enhanced Linguistic Verifiers | 1 INTRODUCTION . Teaching a machine to read and comprehend large-scale textual documents is a promising and longstanding goal of natural language understanding . This field , so called machine reading comprehension ( MRC ) ( Zhang et al. , 2019 ; 2020c ) , has achieved impressive milestones in recent years thanks to the releasing of large-scale benchmark datasets and pretrained contextualized language models ( CLM ) . For example , for the well-testified span-extraction style SQuAD2.0 dataset1 , current best results under the framework of pretraining+fine-tuning employing ALBERT ( Lan et al. , 2020 ) are 90.7 % of exact matching ( EM ) and 93.0 % of F1 score , exceeds their human-level scores of 86.8 % and 89.5 % ( Rajpurkar et al. , 2016 ; 2018 ) in a large margin . MRC is traditionally defined to be a question-answering task which outputs answers by given inputs of passage-question pairs . Considering the types of answers , Chen ( 2018 ) classified MRC ’ s tasks into four categories : cloze-filling of a question with gaps ( Ghaeini et al. , 2018 ) , multiple-choice from several options ( Zhang et al. , 2020a ) , span extraction of answer from the passage ( Rajpurkar et al. , 2016 ; 2018 ; Trischler et al. , 2017 ) and free-style answer generation and summarization from the passage ( Nguyen et al. , 2016 ) . MRC is regarded to be widely applicable to numerous applications that are rich of question-style queries , such as information retrieval and task-oriented conversations . For detailed survey of this field , please refer to ( Zhang et al. , 2020c ) for recent research roadmap , datasets and future directions . In this paper , we focus on span-extraction style MRC with unanswerable questions . Rajpurkar et al . ( 2018 ) introduced 50K+ unanswerable questions to construct the SQuAD2.0 dataset . Unanswerable questions include rewriting originally answerable questions through ways of negation word inserted or removed , antonym used , entity swap , mutual exclusion , and impossible condition . Plausible answers which correspond to spans in the given passage are attached to these unanswerable questions . Numerous verifiers have been proposed to score the answerability of questions . For example , Hu et al . ( 2019 ) proposed a read-then-verify system that explicitly verified the legitimacy of the predicted answer . An answer verifier was designed to decide whether or not the predicted answer is entailable by the input snippets ( i.e. , segments of the input passage ) . Their system achieved a F1 score of 74.8 % and 74.2 % respectively on the SQuAD2.0 ’ s dev and test sets . Zhang et al . ( 2020b ) proposed a 1https : //rajpurkar.github.io/SQuAD-explorer/ pipeline with two verifiers : a sketchy reading verifier that briefly investigates the overall interactions of between a segment and a question through a binary classification network following CLM , and an intensive reading module that includes a span extractor and an answerability verifier . These two verifiers are interpolated to yield the final decision of answerablility . This framework has achieved significant improvements ( F1 score of 90.9 % and 91.4 % , respectively on the dev and test sets of SQuAD2.0 ) than the strong ALBERT baseline ( Lan et al. , 2020 ) . Minimizing span losses of start and end positions of answers for answerable questions is overwhelming in current pretraining+fine-tuning frameworks . However , there are still requirements for designing fine-grained verifiers for predicting questions ’ answerabilities by utilizing the interaction of between answer-injected questions and passages . It is valuable for us to score the linguistic correctness of the predicted answer , through replacing the interrogatives in questions by their predicted answers to check out if it is a linguistically correct sentence and in addition if the given passage can entail that rewritten question . For example , there are two reference answers ( “ P is not equal to NP ” as a complete sentence , “ not equal ” as a verb phrase ) to a question “ What implication can be derived for P and NP if P and co-NP are established to be unequal ? ” . When a system predicts “ not equal to NP. ” with unbalanced arguments ( i.e. , containing objective argument NP yet missing subjective argument P ) , it is scored 0 in exact match and discounted in F1 score . Intuitively , “ P is not equal to NP/not equal implication ... ” should be scored higher than “ not equal to NP implication ... ” . This motivates our first position-sensitive question-rewritten verifier . That is , we score the correctness and completeness of the predicted answer and the rewritten question by the existing CLM models , and build an entailment network that takes cross-attention of between the rewritten question and passage as inputs . On the other hand , the original passage/document is frequently too long to be directly used in pretraining+tuning frameworks . For example , as reported in ( Gong et al. , 2020 ) , passages in TriviaQA dataset ( Joshi et al. , 2017 ) averagely contain 2,622 tokens generated by BERT tokenizer ( Kudo & Richardson , 2018 ) in their training set . Current CLMs are incapable of accepting arbitrarily long token sequences . Thus , we are forced to cut the passage into segments with fixed length ( e.g. , 512 tokens with strides such as 128 or 256 ) . Then , the reference input to MRC now is a fix-length segment instead of the whole passage . When the manually annotated answer to the question is out of the scope of the segment , the question will be annotated to be unanswerable regardless its answerability in the whole passage . This brings bias to answerable questions since one individual segment loses its context , and it is possible that this segment implicitly contain clues for correctly answering the question . For example , in SQuAD2.0 , only one answer span is provided for one question regardless of the multiple appearances ( 104,674 appearances of answer texts for the 86,821 answerable questions ) of the same answer text in the given paragraph . For long-text MRC , Gong et al . ( 2020 ) proposed recurrent chunking mechanisms by first employing reinforcement learning to centralize the candidate answer span in the segment and then building a recurrent network to transfer contextual information among segments . Considering that it is non-trivial of data-preparation and multi-turn reasoning for training and inferencing under a reinforcement learning framework , we propose a different solution in this paper . We build a hierarchical attention network ( HAN ) ( Yang et al. , 2016 ) on sentence-level , segment-level and finally paragraph-level cross-attentions to questions for extracting and verifying candidate answers . Since the HAN framework includes segment sequences in a recurrent way , Gong et al . ( 2020 ) ’ s recurrent chunking can be regarded as a special case of ours . We combine these two types of verifiers together into a pipeline , and apply it to three span-extraction MRC benchmark sets : SQuAD2.0 ( Rajpurkar et al. , 2018 ) , NewsQA ( Trischler et al. , 2017 ) , and TriviaQA ( Joshi et al. , 2017 ) ( wikipedia part ) . Our pipeline achieves significantly better improvements on both exact matching and F1 scores than state-of-the-art baselines . 2 ENHANCED LINGUISTIC VERIFIERS . 2.1 ANSWER-INJECTED REWRITING OF QUESTIONS . The overwhelming types of questions in span-extraction MRC datasets are in a scope of 5W1H , as listed in Table 1 . NewsQA ’ s statistical information comes from their website2 . We calculate the train and validation sets together for SQuAD2.0 and TriviaQA , using these 5W1H interrogatives and their extensions ( such as “ whom ” and “ whose ” are all who-style question indicators ) . 2https : //www.microsoft.com/en-us/research/project/newsqa-dataset There are nearly 5 % questions that contain multiple interrogatives , such as WhatWDT year and whereWRB was the first perfect score given ? , WhoWP gets to choose whereWRB a gymnast starts to run on the runway ? . In order to detect interrogatives , we utilize Stanford dependency parser V4.0.0 ( Chen & Manning , 2014 ) which outputs the dependency tree together with words ’ POS tags . We inject answer text to questions with one interrogative by simply replacing it with the answer text . For questions with multiple interrogatives , we first parse the answer text and obtain its POS tag sequence and then align the interrogatives with the words in the answer text through simple heuristic rules such as whoWP for personal names , whereWRB for spaces , whenWRB for time and date . In case we fail finding the alignment , we simply attach the answer text at the left-hand-side of the question . We count on multi-head self-attention mechanism ( Vaswani et al. , 2017 ) in CLMs as a linguistic scorer to score the linguistic likelihood of the sequence . 2.2 REWRITTEN QUESTION RELATED VERIFICATION . Figure 1 illustrates our answer verification framework . We propose two types of maximum likelihood losses to score the sequences of predicted answer text and answer-injected question text by tunable pretrained CLMs . In addition , inspired by ( Zhang et al. , 2020b ) , we adapt a cross-attention span loss on the segment and rewritten question . We first integrate a question ( with |q| tokens ) and a segment ( with |p| tokens ) of a paragraph in a standard format of “ [ CLS ] question [ SEP ] segment [ SEP ] ” . Here , [ CLS ] is a classification token which is recognized to contain information of the whole sequence with a length of ( |q|+ |p|+ 3 ) . There are two separation [ SEP ] tokens respectively follow the question and the segment . The whole sequence will be sent to tunable CLMs which first embed the sequence using token , position , and segment ( tokens in “ [ CLS ] question [ SEP ] ” are assigned value of 0 , otherwise 1 ) embedding networks . Then , Transformer ’ s encoder layers are employed to represent the sequence to finally output the H tensor . Suppose that each token in H is represented by a h-dimension vector ( e.g. , h=4,096 ) . H is sent to a linear layer which projects h-dim into 2-dim , i.e. , ( batch , |q|+ |p|+ 3 , 2 ) , standing for the start/end position scores of each token in the segment . Cross entropy loss is adapted to compute the span loss , numbered with l1 in Figure 1 . Simultaneously , the vector of the first position in a sequence , i.e. , [ CLS ] ’ s representation vector is sent to a dropout layer and then a linear layer that projects h-dim into 2-dim to score the answerability of the question , by employing cross entropy loss l2 . Our proposed losses are denoted by l3 ( phrase-level ) , l4 ( sentence-level ) and l5 ( question-segment level ) in Figure 1 . We give detailed ablation experiments of these three losses in the Appendix . Note that we focus on answerable questions , i.e. , we compute these losses only when the question is answerable annotated in the train/dev sets and predicted to be answerable by the “ binary classifier ” during training/testing . One motivation is that the best-reported exact matching score for answerable questions only achieved 83.1 % while the whole exact matching score was 90.9 % , reported in ( Zhang et al. , 2020b ) . This 7.8 % gap reflects the importance of verifying the linguistic correctness of predicted answer phrases to the answerable questions . In order to compute the “ linguistic likelihood ” of these two sequences , predicted answer text and rewritten question , we first attach a [ CLS ] token to each of them and then sent them to the same CLMs . Each [ CLS ] ’ s representative vector will be further sent to a h-to-1 linear layer . The second option of computing the likelihood of the predicted answer text is to compare a similarity score ( e.g. , cosine ) of between its [ CLS ] ’ s vector and the reference answer text ’ s [ CLS ] vector . | This paper proposes two types of linguistic verifiers for machine reading comprehension task in span extraction form. One is a rewritten question oriented verifier that checks the linguistic correctness of the extracted answers, and the other is based on a hierarchical attention network for answerability classification and boundary determination. The two verifiers are trained independently and then combined together via interpolation. Overall, the paper is well organized and easy to follow. | SP:9b909cc1c71ca942c7b094c735181010d93a7d86 |
Exploring the Potential of Low-Bit Training of Convolutional Neural Networks | 1 INTRODUCTION . Convolutional neural networks ( CNNs ) have achieved state-of-the-art performance in many computer vision tasks , such as image classification ( Krizhevsky et al. , 2012 ) and object detection ( Redmon et al. , 2016 ; Liu et al. , 2016 ) . However , deep CNNs are both computation and storage-intensive . The training process could consume up to hundreds of ExaFLOPs of computations and tens of GBytes of storage ( Simonyan & Zisserman , 2014 ) , thus posing a tremendous challenge for training in resource-constrained environments . At present , the most common training method is to use GPUs , but it consumes much energy . The power of a running GPU is about 250W , and it usually takes more than 10 GPU-days to train one CNN model on ImageNet ( Deng et al. , 2009 ) . It makes AI applications expensive and not environment-friendly . Reducing the precision of NNs has drawn great attention since it can reduce both the storage and computational complexity . It is pointed out that the power consumption and circuit area of fixed-point multiplication and addition units are greatly reduced compared with floating-point ones ( Horowitz , 2014 ) . Many studies ( Jacob et al. , 2017a ; Dong et al. , 2019 ; Banner et al. , 2018b ) focus on amending the training process to acquire a reduced-precision model with higher inference efficiency . Besides the studies on improving inference efficiency , there exist studies that accelerate the training process . Wang et al . ( 2018 ) and Sun et al . ( 2019 ) reduce the floating-point bit-width to 8 during the training process . Wu et al . ( 2018 ) implements a full-integer training procedure to reduce the cost but fails to get acceptable performance . As shown in Tab . 1 , Conv in the training process accounts for the majority of the operations . Therefore , this work aims at simplifying convolution to low-bit operations , while retaining a similar performance with the full-precision baseline . The contributions of this paper are : 1 . This paper proposes a low-bit training framework to improve the energy efficiency of CNN training . We design a low-bit tensor format with multi-level scaling ( MLS format ) , which can strike a better trade-off between the accuracy and bit-width , while taking the hardware efficiency into consideration . The multi-level scaling technique extracts the common exponent of tensor elements as much as possible to reduce the element-wise bitwidth , thus improving the energy efficiency . To leverage the MLS format efficiently , we develop the corresponding dynamic quantization and the MLS tensor convolution arithmetic . 2 . Extensive experiments demonstrate the effectiveness of our low-bit training framework . One only needs 1-bit mantissa and 2-bit exponent to train ResNet-20 on CIFAR-10 while retaining the same accuracy as the full-precision training . On ImageNet , using 4-bit mantissa and 2-bit exponent is enough for training ResNet-18 , with a precision loss within 1 % . Our method achieves higher energy efficiency using fewer bits than previous floating-point training methods and better accuracy than previous fixed-point training methods . 3 . We estimate the hardware energy that implements the MLS convolution arithmetic . Using our MLS tensor format , the energy efficiency of convolution can be improved by over 6.8× , than the full-precision training , and over 1.2× than previous low-bit training methods . 2 RELATED WORK . 2.1 POST-TRAINING QUANTIZATION . Earlier quantization methods like ( Han et al. , 2015 ) focused on the post-training quantization , and quantized the pre-trained full-precision model using the codebook generated by clustering or other criteria ( e.g. , SQNR Lin et al . ( 2015 ) , entropy Park et al . ( 2017 ) ) . Banner et al . ( 2018b ) selected the quantization bit-width and clipping value for each channel through the analytical investigation . Jacob et al . ( 2017b ) developed an integer arithmetic convolution for efficient inference , but it ’ s hard to be used in training because the scale of the output tensor should be known before calculation . These quantization methods need pretrained models , and can not accelerate the training process . 2.2 QUANTIZE-AWARE TRAINING . Quantize-aware training considered quantization effects in the training process . Some methods trained an ultra low-bit network like binary ( Rastegari et al. , 2016 ) or ternary ( Li et al. , 2016 ) networks , with a layer-wise scaling factor . Despite that the follow-up studies ( Liu et al. , 2020 ; Qin et al. , 2019 ) have been proposing training techniques to improve the performance of binary networks , the extremely low bit-width still causes notable performance degradation . Other methods sought to retain the accuracy with relatively higher precision , such as 8-bit ( Jacob et al. , 2017a ) . Gysel et al . ( 2018 ) developed a GPU-based training framework to get dynamic fixed-point models . These methods focus on accelerating the inference process and the training process is still using floating-point operations . 2.3 LOW-BIT TRAINING . To accelerate the training process , studies have been focusing on design a better floating-point data format . Dillon et al . ( 2017 ) proposed a novel 16-bit floating-point format that is more suitable for CNN training , while Köster et al . ( 2017 ) proposed the Flexpoint that contains 16-bit mantissa and 5-bit tensor-shared exponent ( scale ) , which is similar to the dynamic fixed-point format proposed by Gysel et al . ( 2018 ) . Recently , 8-bit floating-point ( Wang et al. , 2018 ; Sun et al. , 2019 ) was used with chunk-based accumulation and hybrid format to solve swamping . ...... Tensor Scale Group 0 Scale s Exp # Man # … … … s Exp # Man # Exp $ Man $ Exp % M Group 0 Group 1 Scale Exp % M Group 1 Group N Scale Exp % M Group N s Exp # Man # … … … s Exp # Man # s Exp # Man # … … … s Exp # Man # Figure 1 : Illustration of the multi-level scaling ( MLS ) low-bit tensor data format . Some studies used fixed-point in both the forward and backward processes ( Zhou et al. , 2016 ) .Wu et al . ( 2018 ) ; Yang et al . ( 2020 ) implemented a full-integer training framework for integer-arithmetic machines . However , their methods caused notable accuracy degradation . Banner et al . ( 2018a ) used 8-bit and 16-bit quantization based on integer arithmetic ( Jacob et al. , 2017b ) to achieve a comparable accuracy with the full-precision baseline . But it ’ s not very suitable for training as we discussed earlier . These methods reduced both the training and inference costs . In this paper , we seek to strike a better trade-off between accuracy and bit-width . 3 MULIT-LEVEL SCALING LOW-BIT TENSOR FORMAT . In this paper , we denote the filters and feature map of the convolution operation as weight ( W ) and activation ( A ) , respectively . In the back-propagation , the gradients of feature map and weights are denoted as error ( E ) and gradient ( G ) , respectively . 3.1 MAPPING FORMULA OF THE QUANTIZATION SCHEME . In quantized CNNs , floating-point values are quantized to use the fixed-point representation . In a commonly used scheme ( Jacob et al. , 2017b ) , the mapping function is float = scale× ( Fix+Bias ) , in which scale and Bias are shared in one tensor . However , since data distribution changes over time during training , one can not simplify the Bias calculation as Jacob et al . ( 2017b ) did . Thus , we adopt an unbiased quantization scheme , and extend the scaling factor to three levels for better representation ability . The mapping formula of our quantization scheme is X [ i , j , k , l ] = Ss [ i , j , k , l ] × St × Sg [ i , j ] × X̄ [ i , j , k , l ] ( 1 ) where [ · ] denotes the indexing operation , Ss is a sign tensor , St is a tensor-wise scaling factor shared in one tensor , and Sg is a group-wise scaling factor shared in one group , which is a structured subset of the tensor . Our paper considers three grouping dimensions : 1 ) grouping by the 1-st dimension of tensor , 2 ) the 2-nd dimension of tensor , or 3 ) the 1-st and the 2-nd dimensions simultaneously . St , Sg , and X̄ use the same format , which we refer to as 〈E , M〉 , a customized floating-point format with E-bit exponent and M-bit mantissa ( no sign bit ) . A value in the format 〈E , M〉 is float = I2F ( Man , Exp ) = Frac× 2−Exp = ( 1 + Man 2M ) × 2−Exp ( 2 ) where Man and Exp are the M-bit mantissa and E-bit exponent , and Frac ∈ [ 1 , 2 ) is a fraction . 3.2 DETAILS ON THE SCALING FACTORS . The first level tensor-wise scaling factor St is set to be an ordinary floating-point number ( 〈Et , Mt〉 = 〈8 , 23〉 ) , which is the same as unquantized data in training to retain the precision as much as possible . Considering the actual hardware implementation cost , there are some restrictions on the second level group-wise scaling factor Sg . Since calculation results using different tensor groups need to be aggregated , using Sg in an ordinary floating-point format will make more expensive conversions and operations necessary in the hardware implementation . We proposed two hardware-friendly group-wise scaling scheme , whose formats can be denoted as 〈Eg , 0〉 , and 〈Eg , 1〉 . The scaling factor in the 〈Eg , 0〉 format is simply a power of two , which can be implemented easily as shifting on the hardware . From Eq . 2 , a Sg = I2F ( Mang , Expg ) value in the 〈Eg , 1〉 format can be written as Sg = ( 1 + Mang 2 ) × 2−Expg = { 2−Expg + 2−Expg−1 Mang = 1 2−Expg Mang = 0 ( 3 ) which is a sum of two shifting , and can be implemented with small hardware overhead . The third level scaling factor Sx = I2F ( 0 , Expx ) = 2−Expx is the element-wise exponent in X̄ = Sx ( 1 + Manx 2 ) , and we can see that the elements of X̄ in Eq . 1 are in a 〈Ex , Mx〉 format . The specific values of Ex and Mx determine the type and the cost of the basic multiplication and accumulation ( MAC ) operation , which will be discussed later in Sec . 5.2 . 4 LOW-BIT TRAINING FRAMEWORK OF CNN . As shown in Fig . 2 , the convolution operation ( Conv ) is followed by batch normalization ( BN ) , nonlinear operations ( e.g . ReLU , pooling ) . Since Convs account for the majority computational cost , we apply quantization right before Convs in the training process , including three types : Conv ( W , A ) , Conv ( W , E ) , and Conv ( A , E ) . Note that the output data of Convs is in floating-point format , and other operations operate on floating-point numbers . An iteration of this low-bit training process is summarized in Appendix Alg . 2 , in which the major differences from the vanilla training process are the dynamic quantizaiton procedure DynamicQuantization and the low-bit tensor convolution arithmetic LowbitConv . | This paper investigated the low-bit training problem and proposed a novel method, which can reduce the element-wise bit-width to simplify floating-point computations to nearly fixed-point. The major contribution can be summarized as follows: a multi-level scaling (MLS) tensor format, a dynamic quantization and the low-bit tensor convolution arithmetic. Experiments show the proposed method could strike a good trade-off between the accuracy and bit-width, while taking the hardware efficiency into consideration. | SP:35c957dccdefe660923cac3ed68afbfdea37faf7 |
Exploring the Potential of Low-Bit Training of Convolutional Neural Networks | 1 INTRODUCTION . Convolutional neural networks ( CNNs ) have achieved state-of-the-art performance in many computer vision tasks , such as image classification ( Krizhevsky et al. , 2012 ) and object detection ( Redmon et al. , 2016 ; Liu et al. , 2016 ) . However , deep CNNs are both computation and storage-intensive . The training process could consume up to hundreds of ExaFLOPs of computations and tens of GBytes of storage ( Simonyan & Zisserman , 2014 ) , thus posing a tremendous challenge for training in resource-constrained environments . At present , the most common training method is to use GPUs , but it consumes much energy . The power of a running GPU is about 250W , and it usually takes more than 10 GPU-days to train one CNN model on ImageNet ( Deng et al. , 2009 ) . It makes AI applications expensive and not environment-friendly . Reducing the precision of NNs has drawn great attention since it can reduce both the storage and computational complexity . It is pointed out that the power consumption and circuit area of fixed-point multiplication and addition units are greatly reduced compared with floating-point ones ( Horowitz , 2014 ) . Many studies ( Jacob et al. , 2017a ; Dong et al. , 2019 ; Banner et al. , 2018b ) focus on amending the training process to acquire a reduced-precision model with higher inference efficiency . Besides the studies on improving inference efficiency , there exist studies that accelerate the training process . Wang et al . ( 2018 ) and Sun et al . ( 2019 ) reduce the floating-point bit-width to 8 during the training process . Wu et al . ( 2018 ) implements a full-integer training procedure to reduce the cost but fails to get acceptable performance . As shown in Tab . 1 , Conv in the training process accounts for the majority of the operations . Therefore , this work aims at simplifying convolution to low-bit operations , while retaining a similar performance with the full-precision baseline . The contributions of this paper are : 1 . This paper proposes a low-bit training framework to improve the energy efficiency of CNN training . We design a low-bit tensor format with multi-level scaling ( MLS format ) , which can strike a better trade-off between the accuracy and bit-width , while taking the hardware efficiency into consideration . The multi-level scaling technique extracts the common exponent of tensor elements as much as possible to reduce the element-wise bitwidth , thus improving the energy efficiency . To leverage the MLS format efficiently , we develop the corresponding dynamic quantization and the MLS tensor convolution arithmetic . 2 . Extensive experiments demonstrate the effectiveness of our low-bit training framework . One only needs 1-bit mantissa and 2-bit exponent to train ResNet-20 on CIFAR-10 while retaining the same accuracy as the full-precision training . On ImageNet , using 4-bit mantissa and 2-bit exponent is enough for training ResNet-18 , with a precision loss within 1 % . Our method achieves higher energy efficiency using fewer bits than previous floating-point training methods and better accuracy than previous fixed-point training methods . 3 . We estimate the hardware energy that implements the MLS convolution arithmetic . Using our MLS tensor format , the energy efficiency of convolution can be improved by over 6.8× , than the full-precision training , and over 1.2× than previous low-bit training methods . 2 RELATED WORK . 2.1 POST-TRAINING QUANTIZATION . Earlier quantization methods like ( Han et al. , 2015 ) focused on the post-training quantization , and quantized the pre-trained full-precision model using the codebook generated by clustering or other criteria ( e.g. , SQNR Lin et al . ( 2015 ) , entropy Park et al . ( 2017 ) ) . Banner et al . ( 2018b ) selected the quantization bit-width and clipping value for each channel through the analytical investigation . Jacob et al . ( 2017b ) developed an integer arithmetic convolution for efficient inference , but it ’ s hard to be used in training because the scale of the output tensor should be known before calculation . These quantization methods need pretrained models , and can not accelerate the training process . 2.2 QUANTIZE-AWARE TRAINING . Quantize-aware training considered quantization effects in the training process . Some methods trained an ultra low-bit network like binary ( Rastegari et al. , 2016 ) or ternary ( Li et al. , 2016 ) networks , with a layer-wise scaling factor . Despite that the follow-up studies ( Liu et al. , 2020 ; Qin et al. , 2019 ) have been proposing training techniques to improve the performance of binary networks , the extremely low bit-width still causes notable performance degradation . Other methods sought to retain the accuracy with relatively higher precision , such as 8-bit ( Jacob et al. , 2017a ) . Gysel et al . ( 2018 ) developed a GPU-based training framework to get dynamic fixed-point models . These methods focus on accelerating the inference process and the training process is still using floating-point operations . 2.3 LOW-BIT TRAINING . To accelerate the training process , studies have been focusing on design a better floating-point data format . Dillon et al . ( 2017 ) proposed a novel 16-bit floating-point format that is more suitable for CNN training , while Köster et al . ( 2017 ) proposed the Flexpoint that contains 16-bit mantissa and 5-bit tensor-shared exponent ( scale ) , which is similar to the dynamic fixed-point format proposed by Gysel et al . ( 2018 ) . Recently , 8-bit floating-point ( Wang et al. , 2018 ; Sun et al. , 2019 ) was used with chunk-based accumulation and hybrid format to solve swamping . ...... Tensor Scale Group 0 Scale s Exp # Man # … … … s Exp # Man # Exp $ Man $ Exp % M Group 0 Group 1 Scale Exp % M Group 1 Group N Scale Exp % M Group N s Exp # Man # … … … s Exp # Man # s Exp # Man # … … … s Exp # Man # Figure 1 : Illustration of the multi-level scaling ( MLS ) low-bit tensor data format . Some studies used fixed-point in both the forward and backward processes ( Zhou et al. , 2016 ) .Wu et al . ( 2018 ) ; Yang et al . ( 2020 ) implemented a full-integer training framework for integer-arithmetic machines . However , their methods caused notable accuracy degradation . Banner et al . ( 2018a ) used 8-bit and 16-bit quantization based on integer arithmetic ( Jacob et al. , 2017b ) to achieve a comparable accuracy with the full-precision baseline . But it ’ s not very suitable for training as we discussed earlier . These methods reduced both the training and inference costs . In this paper , we seek to strike a better trade-off between accuracy and bit-width . 3 MULIT-LEVEL SCALING LOW-BIT TENSOR FORMAT . In this paper , we denote the filters and feature map of the convolution operation as weight ( W ) and activation ( A ) , respectively . In the back-propagation , the gradients of feature map and weights are denoted as error ( E ) and gradient ( G ) , respectively . 3.1 MAPPING FORMULA OF THE QUANTIZATION SCHEME . In quantized CNNs , floating-point values are quantized to use the fixed-point representation . In a commonly used scheme ( Jacob et al. , 2017b ) , the mapping function is float = scale× ( Fix+Bias ) , in which scale and Bias are shared in one tensor . However , since data distribution changes over time during training , one can not simplify the Bias calculation as Jacob et al . ( 2017b ) did . Thus , we adopt an unbiased quantization scheme , and extend the scaling factor to three levels for better representation ability . The mapping formula of our quantization scheme is X [ i , j , k , l ] = Ss [ i , j , k , l ] × St × Sg [ i , j ] × X̄ [ i , j , k , l ] ( 1 ) where [ · ] denotes the indexing operation , Ss is a sign tensor , St is a tensor-wise scaling factor shared in one tensor , and Sg is a group-wise scaling factor shared in one group , which is a structured subset of the tensor . Our paper considers three grouping dimensions : 1 ) grouping by the 1-st dimension of tensor , 2 ) the 2-nd dimension of tensor , or 3 ) the 1-st and the 2-nd dimensions simultaneously . St , Sg , and X̄ use the same format , which we refer to as 〈E , M〉 , a customized floating-point format with E-bit exponent and M-bit mantissa ( no sign bit ) . A value in the format 〈E , M〉 is float = I2F ( Man , Exp ) = Frac× 2−Exp = ( 1 + Man 2M ) × 2−Exp ( 2 ) where Man and Exp are the M-bit mantissa and E-bit exponent , and Frac ∈ [ 1 , 2 ) is a fraction . 3.2 DETAILS ON THE SCALING FACTORS . The first level tensor-wise scaling factor St is set to be an ordinary floating-point number ( 〈Et , Mt〉 = 〈8 , 23〉 ) , which is the same as unquantized data in training to retain the precision as much as possible . Considering the actual hardware implementation cost , there are some restrictions on the second level group-wise scaling factor Sg . Since calculation results using different tensor groups need to be aggregated , using Sg in an ordinary floating-point format will make more expensive conversions and operations necessary in the hardware implementation . We proposed two hardware-friendly group-wise scaling scheme , whose formats can be denoted as 〈Eg , 0〉 , and 〈Eg , 1〉 . The scaling factor in the 〈Eg , 0〉 format is simply a power of two , which can be implemented easily as shifting on the hardware . From Eq . 2 , a Sg = I2F ( Mang , Expg ) value in the 〈Eg , 1〉 format can be written as Sg = ( 1 + Mang 2 ) × 2−Expg = { 2−Expg + 2−Expg−1 Mang = 1 2−Expg Mang = 0 ( 3 ) which is a sum of two shifting , and can be implemented with small hardware overhead . The third level scaling factor Sx = I2F ( 0 , Expx ) = 2−Expx is the element-wise exponent in X̄ = Sx ( 1 + Manx 2 ) , and we can see that the elements of X̄ in Eq . 1 are in a 〈Ex , Mx〉 format . The specific values of Ex and Mx determine the type and the cost of the basic multiplication and accumulation ( MAC ) operation , which will be discussed later in Sec . 5.2 . 4 LOW-BIT TRAINING FRAMEWORK OF CNN . As shown in Fig . 2 , the convolution operation ( Conv ) is followed by batch normalization ( BN ) , nonlinear operations ( e.g . ReLU , pooling ) . Since Convs account for the majority computational cost , we apply quantization right before Convs in the training process , including three types : Conv ( W , A ) , Conv ( W , E ) , and Conv ( A , E ) . Note that the output data of Convs is in floating-point format , and other operations operate on floating-point numbers . An iteration of this low-bit training process is summarized in Appendix Alg . 2 , in which the major differences from the vanilla training process are the dynamic quantizaiton procedure DynamicQuantization and the low-bit tensor convolution arithmetic LowbitConv . | Efficient training is becoming a crucial research topic as deep learning models get deeper and more complex to improve model accuracy. The authors propose a low-bit floating point quantization method to reduce energy and time consumption during training. To enhance training efficiency, the authors suggest multi-level scaling (MLS) tensor format that enables low-bit training. MLS is designed to compute complex operations with lower-cost operators (e.g., shift, add) or lower-bit operators that can be hardware-friendly. This reviewer considers the proposed hardware-friendly MLS format as the main contribution of the manuscript. | SP:35c957dccdefe660923cac3ed68afbfdea37faf7 |
Exploring the Potential of Low-Bit Training of Convolutional Neural Networks | 1 INTRODUCTION . Convolutional neural networks ( CNNs ) have achieved state-of-the-art performance in many computer vision tasks , such as image classification ( Krizhevsky et al. , 2012 ) and object detection ( Redmon et al. , 2016 ; Liu et al. , 2016 ) . However , deep CNNs are both computation and storage-intensive . The training process could consume up to hundreds of ExaFLOPs of computations and tens of GBytes of storage ( Simonyan & Zisserman , 2014 ) , thus posing a tremendous challenge for training in resource-constrained environments . At present , the most common training method is to use GPUs , but it consumes much energy . The power of a running GPU is about 250W , and it usually takes more than 10 GPU-days to train one CNN model on ImageNet ( Deng et al. , 2009 ) . It makes AI applications expensive and not environment-friendly . Reducing the precision of NNs has drawn great attention since it can reduce both the storage and computational complexity . It is pointed out that the power consumption and circuit area of fixed-point multiplication and addition units are greatly reduced compared with floating-point ones ( Horowitz , 2014 ) . Many studies ( Jacob et al. , 2017a ; Dong et al. , 2019 ; Banner et al. , 2018b ) focus on amending the training process to acquire a reduced-precision model with higher inference efficiency . Besides the studies on improving inference efficiency , there exist studies that accelerate the training process . Wang et al . ( 2018 ) and Sun et al . ( 2019 ) reduce the floating-point bit-width to 8 during the training process . Wu et al . ( 2018 ) implements a full-integer training procedure to reduce the cost but fails to get acceptable performance . As shown in Tab . 1 , Conv in the training process accounts for the majority of the operations . Therefore , this work aims at simplifying convolution to low-bit operations , while retaining a similar performance with the full-precision baseline . The contributions of this paper are : 1 . This paper proposes a low-bit training framework to improve the energy efficiency of CNN training . We design a low-bit tensor format with multi-level scaling ( MLS format ) , which can strike a better trade-off between the accuracy and bit-width , while taking the hardware efficiency into consideration . The multi-level scaling technique extracts the common exponent of tensor elements as much as possible to reduce the element-wise bitwidth , thus improving the energy efficiency . To leverage the MLS format efficiently , we develop the corresponding dynamic quantization and the MLS tensor convolution arithmetic . 2 . Extensive experiments demonstrate the effectiveness of our low-bit training framework . One only needs 1-bit mantissa and 2-bit exponent to train ResNet-20 on CIFAR-10 while retaining the same accuracy as the full-precision training . On ImageNet , using 4-bit mantissa and 2-bit exponent is enough for training ResNet-18 , with a precision loss within 1 % . Our method achieves higher energy efficiency using fewer bits than previous floating-point training methods and better accuracy than previous fixed-point training methods . 3 . We estimate the hardware energy that implements the MLS convolution arithmetic . Using our MLS tensor format , the energy efficiency of convolution can be improved by over 6.8× , than the full-precision training , and over 1.2× than previous low-bit training methods . 2 RELATED WORK . 2.1 POST-TRAINING QUANTIZATION . Earlier quantization methods like ( Han et al. , 2015 ) focused on the post-training quantization , and quantized the pre-trained full-precision model using the codebook generated by clustering or other criteria ( e.g. , SQNR Lin et al . ( 2015 ) , entropy Park et al . ( 2017 ) ) . Banner et al . ( 2018b ) selected the quantization bit-width and clipping value for each channel through the analytical investigation . Jacob et al . ( 2017b ) developed an integer arithmetic convolution for efficient inference , but it ’ s hard to be used in training because the scale of the output tensor should be known before calculation . These quantization methods need pretrained models , and can not accelerate the training process . 2.2 QUANTIZE-AWARE TRAINING . Quantize-aware training considered quantization effects in the training process . Some methods trained an ultra low-bit network like binary ( Rastegari et al. , 2016 ) or ternary ( Li et al. , 2016 ) networks , with a layer-wise scaling factor . Despite that the follow-up studies ( Liu et al. , 2020 ; Qin et al. , 2019 ) have been proposing training techniques to improve the performance of binary networks , the extremely low bit-width still causes notable performance degradation . Other methods sought to retain the accuracy with relatively higher precision , such as 8-bit ( Jacob et al. , 2017a ) . Gysel et al . ( 2018 ) developed a GPU-based training framework to get dynamic fixed-point models . These methods focus on accelerating the inference process and the training process is still using floating-point operations . 2.3 LOW-BIT TRAINING . To accelerate the training process , studies have been focusing on design a better floating-point data format . Dillon et al . ( 2017 ) proposed a novel 16-bit floating-point format that is more suitable for CNN training , while Köster et al . ( 2017 ) proposed the Flexpoint that contains 16-bit mantissa and 5-bit tensor-shared exponent ( scale ) , which is similar to the dynamic fixed-point format proposed by Gysel et al . ( 2018 ) . Recently , 8-bit floating-point ( Wang et al. , 2018 ; Sun et al. , 2019 ) was used with chunk-based accumulation and hybrid format to solve swamping . ...... Tensor Scale Group 0 Scale s Exp # Man # … … … s Exp # Man # Exp $ Man $ Exp % M Group 0 Group 1 Scale Exp % M Group 1 Group N Scale Exp % M Group N s Exp # Man # … … … s Exp # Man # s Exp # Man # … … … s Exp # Man # Figure 1 : Illustration of the multi-level scaling ( MLS ) low-bit tensor data format . Some studies used fixed-point in both the forward and backward processes ( Zhou et al. , 2016 ) .Wu et al . ( 2018 ) ; Yang et al . ( 2020 ) implemented a full-integer training framework for integer-arithmetic machines . However , their methods caused notable accuracy degradation . Banner et al . ( 2018a ) used 8-bit and 16-bit quantization based on integer arithmetic ( Jacob et al. , 2017b ) to achieve a comparable accuracy with the full-precision baseline . But it ’ s not very suitable for training as we discussed earlier . These methods reduced both the training and inference costs . In this paper , we seek to strike a better trade-off between accuracy and bit-width . 3 MULIT-LEVEL SCALING LOW-BIT TENSOR FORMAT . In this paper , we denote the filters and feature map of the convolution operation as weight ( W ) and activation ( A ) , respectively . In the back-propagation , the gradients of feature map and weights are denoted as error ( E ) and gradient ( G ) , respectively . 3.1 MAPPING FORMULA OF THE QUANTIZATION SCHEME . In quantized CNNs , floating-point values are quantized to use the fixed-point representation . In a commonly used scheme ( Jacob et al. , 2017b ) , the mapping function is float = scale× ( Fix+Bias ) , in which scale and Bias are shared in one tensor . However , since data distribution changes over time during training , one can not simplify the Bias calculation as Jacob et al . ( 2017b ) did . Thus , we adopt an unbiased quantization scheme , and extend the scaling factor to three levels for better representation ability . The mapping formula of our quantization scheme is X [ i , j , k , l ] = Ss [ i , j , k , l ] × St × Sg [ i , j ] × X̄ [ i , j , k , l ] ( 1 ) where [ · ] denotes the indexing operation , Ss is a sign tensor , St is a tensor-wise scaling factor shared in one tensor , and Sg is a group-wise scaling factor shared in one group , which is a structured subset of the tensor . Our paper considers three grouping dimensions : 1 ) grouping by the 1-st dimension of tensor , 2 ) the 2-nd dimension of tensor , or 3 ) the 1-st and the 2-nd dimensions simultaneously . St , Sg , and X̄ use the same format , which we refer to as 〈E , M〉 , a customized floating-point format with E-bit exponent and M-bit mantissa ( no sign bit ) . A value in the format 〈E , M〉 is float = I2F ( Man , Exp ) = Frac× 2−Exp = ( 1 + Man 2M ) × 2−Exp ( 2 ) where Man and Exp are the M-bit mantissa and E-bit exponent , and Frac ∈ [ 1 , 2 ) is a fraction . 3.2 DETAILS ON THE SCALING FACTORS . The first level tensor-wise scaling factor St is set to be an ordinary floating-point number ( 〈Et , Mt〉 = 〈8 , 23〉 ) , which is the same as unquantized data in training to retain the precision as much as possible . Considering the actual hardware implementation cost , there are some restrictions on the second level group-wise scaling factor Sg . Since calculation results using different tensor groups need to be aggregated , using Sg in an ordinary floating-point format will make more expensive conversions and operations necessary in the hardware implementation . We proposed two hardware-friendly group-wise scaling scheme , whose formats can be denoted as 〈Eg , 0〉 , and 〈Eg , 1〉 . The scaling factor in the 〈Eg , 0〉 format is simply a power of two , which can be implemented easily as shifting on the hardware . From Eq . 2 , a Sg = I2F ( Mang , Expg ) value in the 〈Eg , 1〉 format can be written as Sg = ( 1 + Mang 2 ) × 2−Expg = { 2−Expg + 2−Expg−1 Mang = 1 2−Expg Mang = 0 ( 3 ) which is a sum of two shifting , and can be implemented with small hardware overhead . The third level scaling factor Sx = I2F ( 0 , Expx ) = 2−Expx is the element-wise exponent in X̄ = Sx ( 1 + Manx 2 ) , and we can see that the elements of X̄ in Eq . 1 are in a 〈Ex , Mx〉 format . The specific values of Ex and Mx determine the type and the cost of the basic multiplication and accumulation ( MAC ) operation , which will be discussed later in Sec . 5.2 . 4 LOW-BIT TRAINING FRAMEWORK OF CNN . As shown in Fig . 2 , the convolution operation ( Conv ) is followed by batch normalization ( BN ) , nonlinear operations ( e.g . ReLU , pooling ) . Since Convs account for the majority computational cost , we apply quantization right before Convs in the training process , including three types : Conv ( W , A ) , Conv ( W , E ) , and Conv ( A , E ) . Note that the output data of Convs is in floating-point format , and other operations operate on floating-point numbers . An iteration of this low-bit training process is summarized in Appendix Alg . 2 , in which the major differences from the vanilla training process are the dynamic quantizaiton procedure DynamicQuantization and the low-bit tensor convolution arithmetic LowbitConv . | This manuscript describes a new low-bit training framework as well as a new low-bit format and shows promising accuracy-precision trade-offs and better energy efficiency. The proposed method achieves no accuracy drop with 3-bit training on CIFAR dataset and 1% accuracy drop with 6-bit training on ImageNet dataset. Although the results are comparable to state-of-art works like "Hybrid 8-bit Floating Point", this paper has several drawbacks. | SP:35c957dccdefe660923cac3ed68afbfdea37faf7 |
DARTS-: Robustly Stepping out of Performance Collapse Without Indicators | 1 INTRODUCTION . Recent studies ( Zela et al. , 2020 ; Liang et al. , 2019 ; Chu et al. , 2020b ) have shown that one critical issue for differentiable architecture search ( Liu et al. , 2019b ) regarding the performance collapse due to superfluous skip connections . Accordingly , some empirical indicators for detecting the occurrence of collapse have been produced . R-DARTS ( Zela et al. , 2020 ) shows that the loss landscape has more curvatures ( characterized by higher Hessian eigenvalues w.r.t . architectural weights ) when the derived architecture generalizes poorly . By regularizing for a lower Hessian eigenvalue , Zela et al . ( 2020 ) ; Chen & Hsieh ( 2020 ) attempt to stabilize the search process . Meanwhile , by directly constraining the number of skip connections to a fixed number ( typically 2 ) , the collapse issue becomes less pronounced ( Chen et al. , 2019b ; Liang et al. , 2019 ) . These indicator-based approaches have several main drawbacks . Firstly , robustness relies heavily on the quality of the indicator . An imprecise indicator either inevitably accepts poor models or mistakenly reject good ones . Secondly , indicators impose strong priors by directly manipulating the inferred model , which is somewhat suspicious , akin to touching the test set . Thirdly , extra computing cost ( Zela et al. , 2020 ) or careful tuning of hyper-parameters ( Chen et al. , 2019b ; Liang et al. , 2019 ) are required . Therefore , it ’ s natural to ask the following questions : • Can we resolve the collapse without handcrafted indicators and restrictions to interfere with the searching and/or discretization procedure ? • Is it possible to achieve robustness in DARTS without tuning extra hyper-parameters ? ∗Work done as an intern at Meituan Inc. †Correspondent Author . To answer the above questions , we propose an effective and efficient approach to stabilize DARTS . Our contributions can be summarized as follows : New Paradigm to Stabilize DARTS . While empirically observing that current indicators ( Zela et al. , 2020 ; Chen & Hsieh , 2020 ) can avoid performance collapse at a cost of reduced exploration coverage in the search space , we propose a novel indicator-free approach to stabilize DARTS , referred to as DARTS-1 , which involves an auxiliary skip connection ( see Figure 1 ) to remove the unfair advantage ( Chu et al. , 2020b ) in the searching phase . Strong Robustness and Stabilization . We conduct thorough experiments across seven search spaces and three datasets to demonstrate the effectiveness of our method . Specifically , our approach robustly obtains state-of-the-art results on 4 search space with 3× fewer search cost than R-DARTS ( Zela et al. , 2020 ) , which requires four independent runs to report the final performance . Seamless Plug-in Combination with DARTS Variants . We conduct experiments to demonstrate that our approach can work together seamlessly with other orthogonal DARTS variants by removing their handcrafted indicators without extra overhead . In particular , our approach is able to improve 0.8 % accuracy for P-DARTS , and 0.25 % accuracy for PC-DARTS on CIFAR-10 dataset . 2 RELATED WORK . Neural architecture search and DARTS variants . Over the years , researchers have sought to automatically discover neural architectures for various deep learning tasks to relieve human from the tedious effort , ranging from image classification ( Zoph et al. , 2018 ) , objection detection ( Ghiasi et al. , 2019 ) , image segmentation ( Liu et al. , 2019a ) to machine translation ( So et al. , 2019 ) etc . Among many proposed approaches , Differentiable Architecture Search ( Liu et al. , 2019b ) features weight-sharing and resolves the searching problem via gradient descent , which is very efficient and easy to generalize . A short description of DARTS can be found in A.1 . Since then , many subsequent works have been dedicated to accelerating the process ( Dong & Yang , 2019b ) , reducing memory cost ( Xu et al. , 2020 ) , or fostering its ability such as hardware-awareness ( Cai et al. , 2019 ; Wu et al. , 2019 ) , finer granularity ( Mei et al. , 2020 ) and so on . However , regardless of these endeavors , a fundamental issue of DARTS over its searching performance collapse remains not properly solved , which extremely prohibits its application . Robustifying DARTS . As DARTS ( Liu et al. , 2019b ) is known to be unstable as a result of performance collapse ( Chu et al. , 2020b ) , some recent works have devoted to resolving it by either designing indicators like Hessian eigenvalues for the collapse ( Zela et al. , 2020 ) or adding perturbations to regularize such an indicator ( Chen & Hsieh , 2020 ) . Both methods rely heavily on the indicator ’ s accurateness , i.e. , to what extent does the indicator correlate with the performance collapse ? Other methods like Progressive DARTS ( Chen et al. , 2019b ) and DARTS+ ( Liang et al. , 2019 ) employ a strong human prior , i.e. , limiting the number of skip-connections to be a fixed value . Fair DARTS ( Chu et al. , 2020b ) argues that the collapse results from the unfair advantage in an exclusive competitive environment , from which skip connections overly benefit to cause an abundant aggregation . To suppress such an advantage from overshooting , they convert the competition into collaboration where each operation is independent of others . It is however an indirect approach . SGAS ( Li et al. , 2020 ) , instead , circumvents the problem with a greedy strategy where the unfair advantage can be prevented from taking effect . Nevertheless , potentially good operations might be pruned out too early because of greedy underestimation . 1We name it so as we undertake an inward way , as opposed to those outward ones who design new indicators , add extra cost and introduce new hyper-parameters . 3 DARTS- . 3.1 MOTIVATION . We start from the detailed analysis of the role of skip connections . Skip connections were proposed to construct a residual block in ResNet ( He et al. , 2016 ) , which significantly improves training stability . It is even possible to deepen the network up to hundreds of layers without accuracy degradation by simply stacking them up . In contrast , stacking the plain blocks of VGG has degenerated performance when the network gets deeper . Besides , Ren et al . ( 2015 ) ; Wei et al . ( 2017 ) ; Tai et al . ( 2017 ) ; Li et al . ( 2018b ) also empirically demonstrate that deep residual network can achieve better performance on various tasks . From the gradient flow ’ s perspective , skip connection is able to alleviate the gradient vanishing problem . Given a stack of n residual blocks , the output of the ( i + 1 ) th residual block Xi+1 can be computed as Xi+1 = fi+1 ( Xi , Wi+1 ) + Xi , where fi+1 denotes the operations of the ( i + 1 ) th residual block with weights Wi+1 . Suppose the loss function of the model is L , and the gradient of Xi can be obtained as follows ( 1 denotes a tensor whose items are all ones ) : ∂L ∂Xi = ∂L ∂Xi+1 · ( ∂fi+1 ∂Xi + 1 ) = ∂L ∂Xi+j · j∏ k=1 ( ∂fi+k ∂Xi+k−1 + 1 ) ( 1 ) We observe that the gradient of shallow layers always includes the gradient of deep layers , which mitigates the gradient vanishing of Wi . Formally we have , ∂L ∂Wi = ∂L ∂Xi+j · j∏ k=1 ( ∂fi+k ∂Xi+k−1 + 1 ) · ∂fi ∂Wi ( 2 ) To analyze how skip connect affects the performance of residual networks , we introduce a trainable coefficient β on all skip connections in ResNet . Therefore , the gradient of Xi is converted to : ∂L ∂Xi = ∂L ∂Xi+1 · ( ∂fi+1 ∂Xi + β ) ( 3 ) Once β < 1 , gradients of deep layers gradually vanish during the back-propagation ( BP ) towards shallow layers . Here β controls the memory of gradients in BP to stabilize the training procedure . We conduct a confirmatory experiment on ResNet50 and show the result in Fig 2 . By initializing β with { 0 , 0.5 , 1.0 } , we can visualize the tendency of β along with training epochs . We observe that β converges towards 1 after 40 epochs no matter the initialization , which demonstrates that the residual structure learns to push β to a rather large value to alleviate gradient vanishing . Similarly , DARTS ( Liu et al. , 2019b ) utilizes a trainable parameter βskip to denote the importance of skip connection . However , In the search stage , βskip can generally increase and dominate the architecture parameters , and finally leads to performance collapse . We analyze that a large βskip in DARTS could result from two aspects : On the one hand , as the supernet automatically learns to alleviate gradient vanishing , it pushes βskip to a proper large value ; On the other hand , the skip connection is indeed an important connection for the target network , which should be selected in the discretization stage . As a consequence , the skip connection in DARTS plays two-fold roles : as an auxiliary connection to stabilize the supernet training , and as a candidate operation to build the final network . Inspired by the above observation and analysis , we propose to stabilize the search process by distinguishing the two roles of skip connection and handling the issue of gradient flow . 3.2 STEPPING OUT OF THE PERFORMANCE COLLAPSE . To distinguish the two roles , we introduce an auxiliary skip connection between every two nodes in a cell , see Fig . 1 ( b ) . On the one hand , the fixed auxiliary skip connection carries the function of stabilizing the supernet training , even when βskip is rather small . On the other hand , it also breaks the unfair advantage ( Chu et al. , 2020b ) as the advantageous contribution from the residual block is factored out . Consequently , the learned architectural parameter βskip can be freed from the role of controlling the memory of gradients , and is more precisely aimed to represent the relative importance of skip connection as a candidate operation . In contrast to Eq . 7 , the output feature map of edge e ( i , j ) can now be obtained by Eq . 4 , where βi , jo = exp ( α ( i , j ) o ) ∑ o′∈O exp ( α ( i , j ) o′ ) denotes the normalized importance , and β is a coefficient independent from the architecture parameters . Moreover , to eliminate the impact of auxiliary connection on the discretization procedure , we propose to decrease β to 0 in the search phase , and our method can be degenerated to standard DARTS at the end of the search . Note that our method is insensitive to the type of decay strategy , so we choose linear decay by default for simplicity . ō ( i , j ) ( x ) = βx+ ∑ o∈O β ( i , j ) o o ( x ) = ( β + β ( i , j ) skip ) x+ ∑ o 6=skip β ( i , j ) o o ( x ) ( 4 ) We then analyze how the auxiliary skip connection handles the issue of gradient flow . Referring to the theorem of a recent work by Zhou et al . ( 2020 ) , the convergence of network weight W in the supernet can heavily depend on βskip . Specifically , suppose only three operations ( none , skip connection , and convolution ) are included in the search space and MSE loss is utilized as training loss , when architecture parameters βoi , j are fixed to optimize W via gradient descent , training loss can decrease by ratio ( 1− ηλ/4 ) at one step with probability at least 1− δ , where η is the learning rate that should be bounded by δ , and λ follows Eq . 5. λ ∝ h−2∑ i=0 [ ( β ( i , h−1 ) conv ) 2 i−1∏ t=0 ( β ( t , i ) skip ) 2 ] ( 5 ) where h is the number of layers of the supernet . From Eq . 5 , we observe that λ relies much on βskip than βconv , which indicates that the network weights W can converge faster with a large βskip . However , by involving an auxiliary skip connection weighted as β , Eq . 5 can be refined as follows : λ ∝ h−2∑ i=0 [ ( β ( i , h−1 ) conv ) 2 i−1∏ t=0 ( β ( t , i ) skip + β ) 2 ] ( 6 ) Algorithm 1 DARTSRequire : Network weightsw ; Architecture parameters α ; Number of search epochs E ; Decay strategy for βe , e ∈ { 1 , 2 , ... , E } . Ensure : Searched architecture parameters α . 1 : Construct a super-network by stacking cells in which there is an auxiliary skip connection between every two nodes of choice 2 : for each e ∈ [ 1 , E ] do 3 : Update weights w by∇wLtrain ( w , α , βe ) 4 : Update parameters α by∇αLval ( w , α , βe ) 5 : end for 6 : Derive the final architecture based on learned α from the best validation supernet . where β βskip making λ insensitive to βskip , so that the convergence of network weights W depends more on βconv . In the beginning of the search , the common value for βskip is 0.15 while β is 1.0 . From the view of convergence theorem ( Zhou et al. , 2020 ) , the auxiliary skip connection alleviates the privilege of βskip and equalize the competition among architecture parameters . Even when β gradually decays , the fair competition still holds since network weights W have been converged to an optimal point . Consequently , DARTS- is able to stabilize the search stage of DARTS . Extensive experiments are performed to demonstrate the efficiency of the proposed auxiliary skip connection , and we emphasize that our method is flexible to combine with other methods to further improve the stabilization and searching performance . The overall algorithm is given in Alg . 1 . | This paper presents an interesting method to alleviate the mode collapse of DARTS (all operations degenerate to skip-connect). This is done by simply adding a skip-connect operation to complement the output of the cell function and making the coefficient of the auxiliary operation decay with time. The method is tested on a few benchmarks and settings. | SP:6ae92d42bc6c812252e46f6c1485b25ef6e2ef1e |
DARTS-: Robustly Stepping out of Performance Collapse Without Indicators | 1 INTRODUCTION . Recent studies ( Zela et al. , 2020 ; Liang et al. , 2019 ; Chu et al. , 2020b ) have shown that one critical issue for differentiable architecture search ( Liu et al. , 2019b ) regarding the performance collapse due to superfluous skip connections . Accordingly , some empirical indicators for detecting the occurrence of collapse have been produced . R-DARTS ( Zela et al. , 2020 ) shows that the loss landscape has more curvatures ( characterized by higher Hessian eigenvalues w.r.t . architectural weights ) when the derived architecture generalizes poorly . By regularizing for a lower Hessian eigenvalue , Zela et al . ( 2020 ) ; Chen & Hsieh ( 2020 ) attempt to stabilize the search process . Meanwhile , by directly constraining the number of skip connections to a fixed number ( typically 2 ) , the collapse issue becomes less pronounced ( Chen et al. , 2019b ; Liang et al. , 2019 ) . These indicator-based approaches have several main drawbacks . Firstly , robustness relies heavily on the quality of the indicator . An imprecise indicator either inevitably accepts poor models or mistakenly reject good ones . Secondly , indicators impose strong priors by directly manipulating the inferred model , which is somewhat suspicious , akin to touching the test set . Thirdly , extra computing cost ( Zela et al. , 2020 ) or careful tuning of hyper-parameters ( Chen et al. , 2019b ; Liang et al. , 2019 ) are required . Therefore , it ’ s natural to ask the following questions : • Can we resolve the collapse without handcrafted indicators and restrictions to interfere with the searching and/or discretization procedure ? • Is it possible to achieve robustness in DARTS without tuning extra hyper-parameters ? ∗Work done as an intern at Meituan Inc. †Correspondent Author . To answer the above questions , we propose an effective and efficient approach to stabilize DARTS . Our contributions can be summarized as follows : New Paradigm to Stabilize DARTS . While empirically observing that current indicators ( Zela et al. , 2020 ; Chen & Hsieh , 2020 ) can avoid performance collapse at a cost of reduced exploration coverage in the search space , we propose a novel indicator-free approach to stabilize DARTS , referred to as DARTS-1 , which involves an auxiliary skip connection ( see Figure 1 ) to remove the unfair advantage ( Chu et al. , 2020b ) in the searching phase . Strong Robustness and Stabilization . We conduct thorough experiments across seven search spaces and three datasets to demonstrate the effectiveness of our method . Specifically , our approach robustly obtains state-of-the-art results on 4 search space with 3× fewer search cost than R-DARTS ( Zela et al. , 2020 ) , which requires four independent runs to report the final performance . Seamless Plug-in Combination with DARTS Variants . We conduct experiments to demonstrate that our approach can work together seamlessly with other orthogonal DARTS variants by removing their handcrafted indicators without extra overhead . In particular , our approach is able to improve 0.8 % accuracy for P-DARTS , and 0.25 % accuracy for PC-DARTS on CIFAR-10 dataset . 2 RELATED WORK . Neural architecture search and DARTS variants . Over the years , researchers have sought to automatically discover neural architectures for various deep learning tasks to relieve human from the tedious effort , ranging from image classification ( Zoph et al. , 2018 ) , objection detection ( Ghiasi et al. , 2019 ) , image segmentation ( Liu et al. , 2019a ) to machine translation ( So et al. , 2019 ) etc . Among many proposed approaches , Differentiable Architecture Search ( Liu et al. , 2019b ) features weight-sharing and resolves the searching problem via gradient descent , which is very efficient and easy to generalize . A short description of DARTS can be found in A.1 . Since then , many subsequent works have been dedicated to accelerating the process ( Dong & Yang , 2019b ) , reducing memory cost ( Xu et al. , 2020 ) , or fostering its ability such as hardware-awareness ( Cai et al. , 2019 ; Wu et al. , 2019 ) , finer granularity ( Mei et al. , 2020 ) and so on . However , regardless of these endeavors , a fundamental issue of DARTS over its searching performance collapse remains not properly solved , which extremely prohibits its application . Robustifying DARTS . As DARTS ( Liu et al. , 2019b ) is known to be unstable as a result of performance collapse ( Chu et al. , 2020b ) , some recent works have devoted to resolving it by either designing indicators like Hessian eigenvalues for the collapse ( Zela et al. , 2020 ) or adding perturbations to regularize such an indicator ( Chen & Hsieh , 2020 ) . Both methods rely heavily on the indicator ’ s accurateness , i.e. , to what extent does the indicator correlate with the performance collapse ? Other methods like Progressive DARTS ( Chen et al. , 2019b ) and DARTS+ ( Liang et al. , 2019 ) employ a strong human prior , i.e. , limiting the number of skip-connections to be a fixed value . Fair DARTS ( Chu et al. , 2020b ) argues that the collapse results from the unfair advantage in an exclusive competitive environment , from which skip connections overly benefit to cause an abundant aggregation . To suppress such an advantage from overshooting , they convert the competition into collaboration where each operation is independent of others . It is however an indirect approach . SGAS ( Li et al. , 2020 ) , instead , circumvents the problem with a greedy strategy where the unfair advantage can be prevented from taking effect . Nevertheless , potentially good operations might be pruned out too early because of greedy underestimation . 1We name it so as we undertake an inward way , as opposed to those outward ones who design new indicators , add extra cost and introduce new hyper-parameters . 3 DARTS- . 3.1 MOTIVATION . We start from the detailed analysis of the role of skip connections . Skip connections were proposed to construct a residual block in ResNet ( He et al. , 2016 ) , which significantly improves training stability . It is even possible to deepen the network up to hundreds of layers without accuracy degradation by simply stacking them up . In contrast , stacking the plain blocks of VGG has degenerated performance when the network gets deeper . Besides , Ren et al . ( 2015 ) ; Wei et al . ( 2017 ) ; Tai et al . ( 2017 ) ; Li et al . ( 2018b ) also empirically demonstrate that deep residual network can achieve better performance on various tasks . From the gradient flow ’ s perspective , skip connection is able to alleviate the gradient vanishing problem . Given a stack of n residual blocks , the output of the ( i + 1 ) th residual block Xi+1 can be computed as Xi+1 = fi+1 ( Xi , Wi+1 ) + Xi , where fi+1 denotes the operations of the ( i + 1 ) th residual block with weights Wi+1 . Suppose the loss function of the model is L , and the gradient of Xi can be obtained as follows ( 1 denotes a tensor whose items are all ones ) : ∂L ∂Xi = ∂L ∂Xi+1 · ( ∂fi+1 ∂Xi + 1 ) = ∂L ∂Xi+j · j∏ k=1 ( ∂fi+k ∂Xi+k−1 + 1 ) ( 1 ) We observe that the gradient of shallow layers always includes the gradient of deep layers , which mitigates the gradient vanishing of Wi . Formally we have , ∂L ∂Wi = ∂L ∂Xi+j · j∏ k=1 ( ∂fi+k ∂Xi+k−1 + 1 ) · ∂fi ∂Wi ( 2 ) To analyze how skip connect affects the performance of residual networks , we introduce a trainable coefficient β on all skip connections in ResNet . Therefore , the gradient of Xi is converted to : ∂L ∂Xi = ∂L ∂Xi+1 · ( ∂fi+1 ∂Xi + β ) ( 3 ) Once β < 1 , gradients of deep layers gradually vanish during the back-propagation ( BP ) towards shallow layers . Here β controls the memory of gradients in BP to stabilize the training procedure . We conduct a confirmatory experiment on ResNet50 and show the result in Fig 2 . By initializing β with { 0 , 0.5 , 1.0 } , we can visualize the tendency of β along with training epochs . We observe that β converges towards 1 after 40 epochs no matter the initialization , which demonstrates that the residual structure learns to push β to a rather large value to alleviate gradient vanishing . Similarly , DARTS ( Liu et al. , 2019b ) utilizes a trainable parameter βskip to denote the importance of skip connection . However , In the search stage , βskip can generally increase and dominate the architecture parameters , and finally leads to performance collapse . We analyze that a large βskip in DARTS could result from two aspects : On the one hand , as the supernet automatically learns to alleviate gradient vanishing , it pushes βskip to a proper large value ; On the other hand , the skip connection is indeed an important connection for the target network , which should be selected in the discretization stage . As a consequence , the skip connection in DARTS plays two-fold roles : as an auxiliary connection to stabilize the supernet training , and as a candidate operation to build the final network . Inspired by the above observation and analysis , we propose to stabilize the search process by distinguishing the two roles of skip connection and handling the issue of gradient flow . 3.2 STEPPING OUT OF THE PERFORMANCE COLLAPSE . To distinguish the two roles , we introduce an auxiliary skip connection between every two nodes in a cell , see Fig . 1 ( b ) . On the one hand , the fixed auxiliary skip connection carries the function of stabilizing the supernet training , even when βskip is rather small . On the other hand , it also breaks the unfair advantage ( Chu et al. , 2020b ) as the advantageous contribution from the residual block is factored out . Consequently , the learned architectural parameter βskip can be freed from the role of controlling the memory of gradients , and is more precisely aimed to represent the relative importance of skip connection as a candidate operation . In contrast to Eq . 7 , the output feature map of edge e ( i , j ) can now be obtained by Eq . 4 , where βi , jo = exp ( α ( i , j ) o ) ∑ o′∈O exp ( α ( i , j ) o′ ) denotes the normalized importance , and β is a coefficient independent from the architecture parameters . Moreover , to eliminate the impact of auxiliary connection on the discretization procedure , we propose to decrease β to 0 in the search phase , and our method can be degenerated to standard DARTS at the end of the search . Note that our method is insensitive to the type of decay strategy , so we choose linear decay by default for simplicity . ō ( i , j ) ( x ) = βx+ ∑ o∈O β ( i , j ) o o ( x ) = ( β + β ( i , j ) skip ) x+ ∑ o 6=skip β ( i , j ) o o ( x ) ( 4 ) We then analyze how the auxiliary skip connection handles the issue of gradient flow . Referring to the theorem of a recent work by Zhou et al . ( 2020 ) , the convergence of network weight W in the supernet can heavily depend on βskip . Specifically , suppose only three operations ( none , skip connection , and convolution ) are included in the search space and MSE loss is utilized as training loss , when architecture parameters βoi , j are fixed to optimize W via gradient descent , training loss can decrease by ratio ( 1− ηλ/4 ) at one step with probability at least 1− δ , where η is the learning rate that should be bounded by δ , and λ follows Eq . 5. λ ∝ h−2∑ i=0 [ ( β ( i , h−1 ) conv ) 2 i−1∏ t=0 ( β ( t , i ) skip ) 2 ] ( 5 ) where h is the number of layers of the supernet . From Eq . 5 , we observe that λ relies much on βskip than βconv , which indicates that the network weights W can converge faster with a large βskip . However , by involving an auxiliary skip connection weighted as β , Eq . 5 can be refined as follows : λ ∝ h−2∑ i=0 [ ( β ( i , h−1 ) conv ) 2 i−1∏ t=0 ( β ( t , i ) skip + β ) 2 ] ( 6 ) Algorithm 1 DARTSRequire : Network weightsw ; Architecture parameters α ; Number of search epochs E ; Decay strategy for βe , e ∈ { 1 , 2 , ... , E } . Ensure : Searched architecture parameters α . 1 : Construct a super-network by stacking cells in which there is an auxiliary skip connection between every two nodes of choice 2 : for each e ∈ [ 1 , E ] do 3 : Update weights w by∇wLtrain ( w , α , βe ) 4 : Update parameters α by∇αLval ( w , α , βe ) 5 : end for 6 : Derive the final architecture based on learned α from the best validation supernet . where β βskip making λ insensitive to βskip , so that the convergence of network weights W depends more on βconv . In the beginning of the search , the common value for βskip is 0.15 while β is 1.0 . From the view of convergence theorem ( Zhou et al. , 2020 ) , the auxiliary skip connection alleviates the privilege of βskip and equalize the competition among architecture parameters . Even when β gradually decays , the fair competition still holds since network weights W have been converged to an optimal point . Consequently , DARTS- is able to stabilize the search stage of DARTS . Extensive experiments are performed to demonstrate the efficiency of the proposed auxiliary skip connection , and we emphasize that our method is flexible to combine with other methods to further improve the stabilization and searching performance . The overall algorithm is given in Alg . 1 . | This paper aims to improve the robustness of DARTS, and proposes to add an auxiliary skip connection branch to the “mixOp” in cells. The authors also analyze the effect of auxiliary branch on residual block from the view of gradient flow. Additionally, this paper refers to the theory of the work [1] and demonstrate that the auxiliary branch is able to reduce the dependence of the convergence of network weight on $\beta_{skip}$ so as to disentangle the “two-fold role” of skip connection: “as an auxiliary connection to stabilize the supernet training, and as a candidate operation to build the final network”. Moreover, extensive experiments on multiple search spaces and datasets are conducted, showing the effectiveness of this method. They also illustrate the accuracy landscape w.r.t the architecture parameters to demonstrate that the auxiliary branch is able to smoothen the landscape, making DARTS- less sensitive to the perturbation than DARTS | SP:6ae92d42bc6c812252e46f6c1485b25ef6e2ef1e |
DARTS-: Robustly Stepping out of Performance Collapse Without Indicators | 1 INTRODUCTION . Recent studies ( Zela et al. , 2020 ; Liang et al. , 2019 ; Chu et al. , 2020b ) have shown that one critical issue for differentiable architecture search ( Liu et al. , 2019b ) regarding the performance collapse due to superfluous skip connections . Accordingly , some empirical indicators for detecting the occurrence of collapse have been produced . R-DARTS ( Zela et al. , 2020 ) shows that the loss landscape has more curvatures ( characterized by higher Hessian eigenvalues w.r.t . architectural weights ) when the derived architecture generalizes poorly . By regularizing for a lower Hessian eigenvalue , Zela et al . ( 2020 ) ; Chen & Hsieh ( 2020 ) attempt to stabilize the search process . Meanwhile , by directly constraining the number of skip connections to a fixed number ( typically 2 ) , the collapse issue becomes less pronounced ( Chen et al. , 2019b ; Liang et al. , 2019 ) . These indicator-based approaches have several main drawbacks . Firstly , robustness relies heavily on the quality of the indicator . An imprecise indicator either inevitably accepts poor models or mistakenly reject good ones . Secondly , indicators impose strong priors by directly manipulating the inferred model , which is somewhat suspicious , akin to touching the test set . Thirdly , extra computing cost ( Zela et al. , 2020 ) or careful tuning of hyper-parameters ( Chen et al. , 2019b ; Liang et al. , 2019 ) are required . Therefore , it ’ s natural to ask the following questions : • Can we resolve the collapse without handcrafted indicators and restrictions to interfere with the searching and/or discretization procedure ? • Is it possible to achieve robustness in DARTS without tuning extra hyper-parameters ? ∗Work done as an intern at Meituan Inc. †Correspondent Author . To answer the above questions , we propose an effective and efficient approach to stabilize DARTS . Our contributions can be summarized as follows : New Paradigm to Stabilize DARTS . While empirically observing that current indicators ( Zela et al. , 2020 ; Chen & Hsieh , 2020 ) can avoid performance collapse at a cost of reduced exploration coverage in the search space , we propose a novel indicator-free approach to stabilize DARTS , referred to as DARTS-1 , which involves an auxiliary skip connection ( see Figure 1 ) to remove the unfair advantage ( Chu et al. , 2020b ) in the searching phase . Strong Robustness and Stabilization . We conduct thorough experiments across seven search spaces and three datasets to demonstrate the effectiveness of our method . Specifically , our approach robustly obtains state-of-the-art results on 4 search space with 3× fewer search cost than R-DARTS ( Zela et al. , 2020 ) , which requires four independent runs to report the final performance . Seamless Plug-in Combination with DARTS Variants . We conduct experiments to demonstrate that our approach can work together seamlessly with other orthogonal DARTS variants by removing their handcrafted indicators without extra overhead . In particular , our approach is able to improve 0.8 % accuracy for P-DARTS , and 0.25 % accuracy for PC-DARTS on CIFAR-10 dataset . 2 RELATED WORK . Neural architecture search and DARTS variants . Over the years , researchers have sought to automatically discover neural architectures for various deep learning tasks to relieve human from the tedious effort , ranging from image classification ( Zoph et al. , 2018 ) , objection detection ( Ghiasi et al. , 2019 ) , image segmentation ( Liu et al. , 2019a ) to machine translation ( So et al. , 2019 ) etc . Among many proposed approaches , Differentiable Architecture Search ( Liu et al. , 2019b ) features weight-sharing and resolves the searching problem via gradient descent , which is very efficient and easy to generalize . A short description of DARTS can be found in A.1 . Since then , many subsequent works have been dedicated to accelerating the process ( Dong & Yang , 2019b ) , reducing memory cost ( Xu et al. , 2020 ) , or fostering its ability such as hardware-awareness ( Cai et al. , 2019 ; Wu et al. , 2019 ) , finer granularity ( Mei et al. , 2020 ) and so on . However , regardless of these endeavors , a fundamental issue of DARTS over its searching performance collapse remains not properly solved , which extremely prohibits its application . Robustifying DARTS . As DARTS ( Liu et al. , 2019b ) is known to be unstable as a result of performance collapse ( Chu et al. , 2020b ) , some recent works have devoted to resolving it by either designing indicators like Hessian eigenvalues for the collapse ( Zela et al. , 2020 ) or adding perturbations to regularize such an indicator ( Chen & Hsieh , 2020 ) . Both methods rely heavily on the indicator ’ s accurateness , i.e. , to what extent does the indicator correlate with the performance collapse ? Other methods like Progressive DARTS ( Chen et al. , 2019b ) and DARTS+ ( Liang et al. , 2019 ) employ a strong human prior , i.e. , limiting the number of skip-connections to be a fixed value . Fair DARTS ( Chu et al. , 2020b ) argues that the collapse results from the unfair advantage in an exclusive competitive environment , from which skip connections overly benefit to cause an abundant aggregation . To suppress such an advantage from overshooting , they convert the competition into collaboration where each operation is independent of others . It is however an indirect approach . SGAS ( Li et al. , 2020 ) , instead , circumvents the problem with a greedy strategy where the unfair advantage can be prevented from taking effect . Nevertheless , potentially good operations might be pruned out too early because of greedy underestimation . 1We name it so as we undertake an inward way , as opposed to those outward ones who design new indicators , add extra cost and introduce new hyper-parameters . 3 DARTS- . 3.1 MOTIVATION . We start from the detailed analysis of the role of skip connections . Skip connections were proposed to construct a residual block in ResNet ( He et al. , 2016 ) , which significantly improves training stability . It is even possible to deepen the network up to hundreds of layers without accuracy degradation by simply stacking them up . In contrast , stacking the plain blocks of VGG has degenerated performance when the network gets deeper . Besides , Ren et al . ( 2015 ) ; Wei et al . ( 2017 ) ; Tai et al . ( 2017 ) ; Li et al . ( 2018b ) also empirically demonstrate that deep residual network can achieve better performance on various tasks . From the gradient flow ’ s perspective , skip connection is able to alleviate the gradient vanishing problem . Given a stack of n residual blocks , the output of the ( i + 1 ) th residual block Xi+1 can be computed as Xi+1 = fi+1 ( Xi , Wi+1 ) + Xi , where fi+1 denotes the operations of the ( i + 1 ) th residual block with weights Wi+1 . Suppose the loss function of the model is L , and the gradient of Xi can be obtained as follows ( 1 denotes a tensor whose items are all ones ) : ∂L ∂Xi = ∂L ∂Xi+1 · ( ∂fi+1 ∂Xi + 1 ) = ∂L ∂Xi+j · j∏ k=1 ( ∂fi+k ∂Xi+k−1 + 1 ) ( 1 ) We observe that the gradient of shallow layers always includes the gradient of deep layers , which mitigates the gradient vanishing of Wi . Formally we have , ∂L ∂Wi = ∂L ∂Xi+j · j∏ k=1 ( ∂fi+k ∂Xi+k−1 + 1 ) · ∂fi ∂Wi ( 2 ) To analyze how skip connect affects the performance of residual networks , we introduce a trainable coefficient β on all skip connections in ResNet . Therefore , the gradient of Xi is converted to : ∂L ∂Xi = ∂L ∂Xi+1 · ( ∂fi+1 ∂Xi + β ) ( 3 ) Once β < 1 , gradients of deep layers gradually vanish during the back-propagation ( BP ) towards shallow layers . Here β controls the memory of gradients in BP to stabilize the training procedure . We conduct a confirmatory experiment on ResNet50 and show the result in Fig 2 . By initializing β with { 0 , 0.5 , 1.0 } , we can visualize the tendency of β along with training epochs . We observe that β converges towards 1 after 40 epochs no matter the initialization , which demonstrates that the residual structure learns to push β to a rather large value to alleviate gradient vanishing . Similarly , DARTS ( Liu et al. , 2019b ) utilizes a trainable parameter βskip to denote the importance of skip connection . However , In the search stage , βskip can generally increase and dominate the architecture parameters , and finally leads to performance collapse . We analyze that a large βskip in DARTS could result from two aspects : On the one hand , as the supernet automatically learns to alleviate gradient vanishing , it pushes βskip to a proper large value ; On the other hand , the skip connection is indeed an important connection for the target network , which should be selected in the discretization stage . As a consequence , the skip connection in DARTS plays two-fold roles : as an auxiliary connection to stabilize the supernet training , and as a candidate operation to build the final network . Inspired by the above observation and analysis , we propose to stabilize the search process by distinguishing the two roles of skip connection and handling the issue of gradient flow . 3.2 STEPPING OUT OF THE PERFORMANCE COLLAPSE . To distinguish the two roles , we introduce an auxiliary skip connection between every two nodes in a cell , see Fig . 1 ( b ) . On the one hand , the fixed auxiliary skip connection carries the function of stabilizing the supernet training , even when βskip is rather small . On the other hand , it also breaks the unfair advantage ( Chu et al. , 2020b ) as the advantageous contribution from the residual block is factored out . Consequently , the learned architectural parameter βskip can be freed from the role of controlling the memory of gradients , and is more precisely aimed to represent the relative importance of skip connection as a candidate operation . In contrast to Eq . 7 , the output feature map of edge e ( i , j ) can now be obtained by Eq . 4 , where βi , jo = exp ( α ( i , j ) o ) ∑ o′∈O exp ( α ( i , j ) o′ ) denotes the normalized importance , and β is a coefficient independent from the architecture parameters . Moreover , to eliminate the impact of auxiliary connection on the discretization procedure , we propose to decrease β to 0 in the search phase , and our method can be degenerated to standard DARTS at the end of the search . Note that our method is insensitive to the type of decay strategy , so we choose linear decay by default for simplicity . ō ( i , j ) ( x ) = βx+ ∑ o∈O β ( i , j ) o o ( x ) = ( β + β ( i , j ) skip ) x+ ∑ o 6=skip β ( i , j ) o o ( x ) ( 4 ) We then analyze how the auxiliary skip connection handles the issue of gradient flow . Referring to the theorem of a recent work by Zhou et al . ( 2020 ) , the convergence of network weight W in the supernet can heavily depend on βskip . Specifically , suppose only three operations ( none , skip connection , and convolution ) are included in the search space and MSE loss is utilized as training loss , when architecture parameters βoi , j are fixed to optimize W via gradient descent , training loss can decrease by ratio ( 1− ηλ/4 ) at one step with probability at least 1− δ , where η is the learning rate that should be bounded by δ , and λ follows Eq . 5. λ ∝ h−2∑ i=0 [ ( β ( i , h−1 ) conv ) 2 i−1∏ t=0 ( β ( t , i ) skip ) 2 ] ( 5 ) where h is the number of layers of the supernet . From Eq . 5 , we observe that λ relies much on βskip than βconv , which indicates that the network weights W can converge faster with a large βskip . However , by involving an auxiliary skip connection weighted as β , Eq . 5 can be refined as follows : λ ∝ h−2∑ i=0 [ ( β ( i , h−1 ) conv ) 2 i−1∏ t=0 ( β ( t , i ) skip + β ) 2 ] ( 6 ) Algorithm 1 DARTSRequire : Network weightsw ; Architecture parameters α ; Number of search epochs E ; Decay strategy for βe , e ∈ { 1 , 2 , ... , E } . Ensure : Searched architecture parameters α . 1 : Construct a super-network by stacking cells in which there is an auxiliary skip connection between every two nodes of choice 2 : for each e ∈ [ 1 , E ] do 3 : Update weights w by∇wLtrain ( w , α , βe ) 4 : Update parameters α by∇αLval ( w , α , βe ) 5 : end for 6 : Derive the final architecture based on learned α from the best validation supernet . where β βskip making λ insensitive to βskip , so that the convergence of network weights W depends more on βconv . In the beginning of the search , the common value for βskip is 0.15 while β is 1.0 . From the view of convergence theorem ( Zhou et al. , 2020 ) , the auxiliary skip connection alleviates the privilege of βskip and equalize the competition among architecture parameters . Even when β gradually decays , the fair competition still holds since network weights W have been converged to an optimal point . Consequently , DARTS- is able to stabilize the search stage of DARTS . Extensive experiments are performed to demonstrate the efficiency of the proposed auxiliary skip connection , and we emphasize that our method is flexible to combine with other methods to further improve the stabilization and searching performance . The overall algorithm is given in Alg . 1 . | The paper reveals two roles of skip connection to prevent model collapse: stabilize the supernet training, and as a candidate operation to build the final network. Intuitively, the skip connection playing the first role should only be there during the training phase. Therefore, the authors propose to add an auxiliary skip connection to play that role. This auxiliary skip connection is decayed gradually during training. The paper provides an interesting theoretical analysis that this can help prevent the gradient vanishing problem. | SP:6ae92d42bc6c812252e46f6c1485b25ef6e2ef1e |
Distributed Training of Graph Convolutional Networks using Subgraph Approximation | 1 INTRODUCTION . Graphs are used to model data in a diverse range of applications such as social networks ( Hamilton et al. , 2017a ) , biological networks ( Fout et al. , 2017 ) and e-commerce interactions ( Yang , 2019 ) . Recently , there has been an increased interest in applying machine learning techniques to graph data . A breakthrough was the development of Graph Convolutional Networks ( GCNs ) , which generalize the function of Convolutional Neural Networks ( CNNs ) , to operate on graphs ( Kipf & Welling , 2017 ) . Training GCNs , much like training CNNs , is a memory and computationally demanding task and may take days or weeks to train on large graphs . GCNs are particularly memory demanding since processing a single vertex may require accessing a large number of neighbors . If the GCN algorithm accesses neighbors which are multiple hops away , it may need to traverse disparate sections of the graph with no locality . This requirement poses challenges when the graph does not fit in memory , which is often the case for large graph representations . Previous approaches to alleviate issues of memory and performance seeks to constrain the number of dependent vertices by employing sampling-based methods ( Hamilton et al. , 2017b ; Chen et al. , 2018 ; Huang et al. , 2018 ; Chiang et al. , 2019 ) . However , sampling the graph may limit the achievable accuracy ( Jia et al. , 2020 ) . CNN training turned to data parallel distributed training to alleviate the memory size constraints and the computing capacity of a single machine . Here , a number of machines independently train the same neural network model but on an assigned chunk of the input data . To construct a single global model , the gradients or parameters are aggregated at regular intervals , such as at the completion of a batch ( Dean et al. , 2012 ) . While this approach works well for CNNs , it is more challenging for GCNs due to the nature of the input data . If the training input is a set of images , each image is independent . Hence , when the dataset is split into chunks of images , no information is directly carried between the chunks . In contrast , if the input is a graph , the equivalent of splitting the dataset into chunks is to divide the large graph into a number of subgraphs . However , GCNs train on graphs which rely not only on information inherent to a vertex but also information from its neighbors . When a GCN trains on one subgraph and needs information from a neighbor in another subgraph , the information from the edges that span across machines creates a communication bottleneck . For example , in our experimental evaluations we note that when the Reddit dataset ( Hamilton et al. , 2017b ) is partitioned into five subgraphs , there are about 1.3 million ( bidirectional ) edges that span across machines . If each edge is followed , 2.6 million messages would be sent , each containing a feature vector of 602 single-precision floats , summing up to about 6.3 GB of data transferred each epoch , where one epoch traverses the entire graph . Each training typically requires many epochs . In our experiments running distributed training on the GCN proposed by Kipf & Welling ( 2017 ) one epoch takes about one second . Thus the bandwidth required is enormous . This is a serious scalability issue : since the time it takes to finish one epoch decreases when the training is scaled out on more machines , the required bandwidth increases . Even with optimizations such as caching that might be possible ( e.g . vertex caching ( Yang , 2019 ) ) , the amount of communication is significant . Alternatively , instead of communicating between subgraphs , a GCN may ignore any information that spans multiple machines ( Jia et al. , 2020 ) . However , we observe that this approach results in accuracy loss due to suboptimal training . For example , when distributed on five compute nodes and ignoring edges that span across machines , we note in our evaluations that the accuracy of GraphSAGE trained on the Reddit dataset drops from 94.94 % to 89.95 % , a substantial loss in accuracy . To mitigate this problem , we present a distributed training approach of GCNs which reaches an accuracy comparable with training on a single-machine system , while keeping the communication overhead low . This allows for GCNs to train on very large graphs using a distributed system where each machine has limited memory , since the memory usage on each machine scales with the size of its allotted ( local ) subgraph . We achieve this by approximating the non-local subgraphs and making the approximations available in the local machine . We show that , by incurring a small vertex overhead in each local machine , a high accuracy can be achieved . Our contributions in this paper are : • A novel subgraph approximation scheme to enable distributed training of GCNs on large graphs using memory-constrained machines , while reaching an accuracy comparable to that achieved on a single machine . • An evaluation of the approach on two GCNs and two datasets , showing that it considerably increases convergence accuracy , and allows for faster training while keeping the memory overhead low . The rest of the paper is organized as follows . Section 2 walks through the necessary background and presents experimental data that motivates our approach . Section 3 describes our approach to efficiently distribute GCNs . Section 4 describes our evaluation methodology , while Section 5 presents the results of our evaluation . Section 6 discusses related work before we conclude in Section 7 . 2 BACKGROUND AND MOTIVATION . In this section we first describe GCNs . Then , we show that GCNs are resilient to approximations in the input graph , and describe how that motivates our approach in Section 3 . 2.1 GRAPH CONVOLUTIONAL NETWORKS . GCNs are neural networks that operate directly on graphs as the input data structure . A GCN aims to define an operation similar to a convolutional layer in CNNs , where a parameterized filter is applied to a pixel and its neighbors in an image ( Fig 1 ) . In the graph setting , the pixel corresponds to a vertex , and the edges from the vertex point out its neighbors ( Fig 2 ) . Early approaches to define this operation used graph convolutions from spectral graph theory ( Bruna et al. , 2014 ; Henaff et al. , 2015 ) . While theoretically sound , these approaches are difficult to scale to large graphs . ( Wu et al. , 2020 ) . Recent research ( e.g . ( Hamilton et al. , 2017b ; Chen et al. , 2018 ) ) instead takes a spatial-based approach , which enables computation in batches of vertices . The goal of a GCN is to learn the parameters of a neural network given a graph G = ( V , E ) where V is a set of vertices and E is a set of edges . The input is a feature matrix X , where each row represents the feature vector xv for every vertex v ∈ V , and an adjacency matrix A which represents the edges e ∈ E. Each layer in can be described as Hi = f ( Hi−1 , A ) , H0 = X , where i is the layer order and f is a propagation rule ( Kipf & Welling , 2017 ) . The number of layers and the propagation rule differ between GCNs . While our proposal is general to all GCNs of this type , we evaluate it on the GCN proposed by Kipf & Welling ( 2017 ) , which we call KW-GCN , and GraphSAGE proposed by Hamilton et al . ( 2017b ) . Both GCNs are described in more detail in Section 4.1 . Figure 1 : Image convolution . Figure 2 : Graph convolution . 2.2 LIMITATIONS TO INPUT APPROXIMATIONS . Our proposal builds upon the observation that GCNs may be resilient to approximations in the input graph . To investigate the extent of resilience , we trained both KW-GCN and GraphSAGE on the Reddit dataset ( Hamilton et al. , 2017b ) , described in Section 4.2 , for the task of vertex classification . To introduce approximations in the input graph , we randomly select an increasingly larger fraction of the training vertices to be deleted . We then use the approximated graph to train each GCN and compute the micro F1 score ( the micro-averaged harmonic mean of precision and recall , which we call accuracy ) on the complete test set . Figure 3 shows the results . We make the following qualitative observation : while GraphSAGE and KW-GCN are not equivalent in their resiliency towards vertex deletion , both networks demonstrate that up until a certain point it is possible to delete vertices without a large accuracy drop . While this might seem like a trivial but promising approach to train more efficiently by simply dropping vertices , in practice the threshold for deletion must be large to make a significant impact on the memory footprint : 50 % of the vertices has to be removed to reduce the memory footprints by 2X . Such a high deletion fraction incurs an unacceptable accuracy penalty . In this work , we instead leverage this observation to gain partial knowledge about non-local subgraphs in a distributed setting . While this approach increases the total workload by introducing redundancy , we show in Section 5 that only a small overhead is needed to substantially increase accuracy . In the next section we describe our proposed solution that exploits the approximation resilience property . 3 DISTRIBUTED TRAINING OF GCNS USING SUBGRAPH APPROXIMATION . A common approach to achieve distributed training is to leverage data parallelism : the training data is divided into mutually exclusive sets , and each machine is assigned one of these sets . Aside from decreasing training time , data parallelism also reduces memory footprint by lowering the amount of data each machine has to handle . If the graph does not fit in memory , the performance will be significantly impacted due to storage access time ( Ham et al. , 2016 ; Ahn et al. , 2015 ) . The main challenge of distributed subgraph training is accuracy . Each machine has only knowledge about the graph structure in its own partition . The result is that important information embedded in other parts of the graph is not captured in local subgraphs . Therefore , the local neural network may not learn global patterns . This is a unique problem to graph data structures . If the input to the neural network consists of images , no information is lost when the dataset is distributed , since each image is an independent data element . If the input is a graph , some edges that span the partitions are essentially unaccounted for during training . If the convolution operator ( Figure 2 ) targets a vertex at the edge of the subgraph , the neighbor data needed is not available in the local machine . A choice has to be made : either acknowledge the edge by trying to fetch the missing data from the non-local machine , or ignore the edge . Both approaches introduce inefficiencies . If the edge is acknowledged , there is a risk of overflowing the network with communication calls , since the machine that holds the neighboring vertex first has to be identified , and then that machine has to send out its data . The number of communication calls grows with the number of machines . However , if the edge is ignored , the execution time of each machine decreases since the communication overhead is minimized , but information is lost : the convolution will be approximate . Algorithm 1 : Breadth-first random sampling of vertices Input : Np : number of vertices in partition p ; M : number of partitions ; P : partitions ; O : overlap Output : Po : Partitions with overlap O 1 for p in P do 2 nts = O·Np M−1 ; Po [ p ] = p 3 for op in P \ p do 4 sample ( Po [ p ] , p , op , nts ) 5 Function sample ( Po [ p ] , p , op , nts ) : 6 selection = neighbors ( p , op ) 7 if size of selection > = nts then 8 sn = random ( selection , nts ) ; Po [ p ] = sn ∪ Po [ p ] 9 else 10 Po [ p ] = selection ∪ Po [ p ] 11 hop = neighbors ( selection , op ) \ selection 12 if ! hop is empty then sample ( Po [ p ] , hop , op , nts - size of selection ) ; | Graph Convolutional Networks (GCNs) have inspired state-of-the-art methods for learning representations on graphs. However, training GCNs for very large graphs remains an issue because of their memory, computation demands. Towards addressing this issue, the paper proposes a distributed GCN training scheme based on subgraph approximation, and demonstrates its empirical effectiveness on medium-to-large datasets. | SP:b7fdf5984d0bd1e4caff646d1a403b18c854e7bd |
Distributed Training of Graph Convolutional Networks using Subgraph Approximation | 1 INTRODUCTION . Graphs are used to model data in a diverse range of applications such as social networks ( Hamilton et al. , 2017a ) , biological networks ( Fout et al. , 2017 ) and e-commerce interactions ( Yang , 2019 ) . Recently , there has been an increased interest in applying machine learning techniques to graph data . A breakthrough was the development of Graph Convolutional Networks ( GCNs ) , which generalize the function of Convolutional Neural Networks ( CNNs ) , to operate on graphs ( Kipf & Welling , 2017 ) . Training GCNs , much like training CNNs , is a memory and computationally demanding task and may take days or weeks to train on large graphs . GCNs are particularly memory demanding since processing a single vertex may require accessing a large number of neighbors . If the GCN algorithm accesses neighbors which are multiple hops away , it may need to traverse disparate sections of the graph with no locality . This requirement poses challenges when the graph does not fit in memory , which is often the case for large graph representations . Previous approaches to alleviate issues of memory and performance seeks to constrain the number of dependent vertices by employing sampling-based methods ( Hamilton et al. , 2017b ; Chen et al. , 2018 ; Huang et al. , 2018 ; Chiang et al. , 2019 ) . However , sampling the graph may limit the achievable accuracy ( Jia et al. , 2020 ) . CNN training turned to data parallel distributed training to alleviate the memory size constraints and the computing capacity of a single machine . Here , a number of machines independently train the same neural network model but on an assigned chunk of the input data . To construct a single global model , the gradients or parameters are aggregated at regular intervals , such as at the completion of a batch ( Dean et al. , 2012 ) . While this approach works well for CNNs , it is more challenging for GCNs due to the nature of the input data . If the training input is a set of images , each image is independent . Hence , when the dataset is split into chunks of images , no information is directly carried between the chunks . In contrast , if the input is a graph , the equivalent of splitting the dataset into chunks is to divide the large graph into a number of subgraphs . However , GCNs train on graphs which rely not only on information inherent to a vertex but also information from its neighbors . When a GCN trains on one subgraph and needs information from a neighbor in another subgraph , the information from the edges that span across machines creates a communication bottleneck . For example , in our experimental evaluations we note that when the Reddit dataset ( Hamilton et al. , 2017b ) is partitioned into five subgraphs , there are about 1.3 million ( bidirectional ) edges that span across machines . If each edge is followed , 2.6 million messages would be sent , each containing a feature vector of 602 single-precision floats , summing up to about 6.3 GB of data transferred each epoch , where one epoch traverses the entire graph . Each training typically requires many epochs . In our experiments running distributed training on the GCN proposed by Kipf & Welling ( 2017 ) one epoch takes about one second . Thus the bandwidth required is enormous . This is a serious scalability issue : since the time it takes to finish one epoch decreases when the training is scaled out on more machines , the required bandwidth increases . Even with optimizations such as caching that might be possible ( e.g . vertex caching ( Yang , 2019 ) ) , the amount of communication is significant . Alternatively , instead of communicating between subgraphs , a GCN may ignore any information that spans multiple machines ( Jia et al. , 2020 ) . However , we observe that this approach results in accuracy loss due to suboptimal training . For example , when distributed on five compute nodes and ignoring edges that span across machines , we note in our evaluations that the accuracy of GraphSAGE trained on the Reddit dataset drops from 94.94 % to 89.95 % , a substantial loss in accuracy . To mitigate this problem , we present a distributed training approach of GCNs which reaches an accuracy comparable with training on a single-machine system , while keeping the communication overhead low . This allows for GCNs to train on very large graphs using a distributed system where each machine has limited memory , since the memory usage on each machine scales with the size of its allotted ( local ) subgraph . We achieve this by approximating the non-local subgraphs and making the approximations available in the local machine . We show that , by incurring a small vertex overhead in each local machine , a high accuracy can be achieved . Our contributions in this paper are : • A novel subgraph approximation scheme to enable distributed training of GCNs on large graphs using memory-constrained machines , while reaching an accuracy comparable to that achieved on a single machine . • An evaluation of the approach on two GCNs and two datasets , showing that it considerably increases convergence accuracy , and allows for faster training while keeping the memory overhead low . The rest of the paper is organized as follows . Section 2 walks through the necessary background and presents experimental data that motivates our approach . Section 3 describes our approach to efficiently distribute GCNs . Section 4 describes our evaluation methodology , while Section 5 presents the results of our evaluation . Section 6 discusses related work before we conclude in Section 7 . 2 BACKGROUND AND MOTIVATION . In this section we first describe GCNs . Then , we show that GCNs are resilient to approximations in the input graph , and describe how that motivates our approach in Section 3 . 2.1 GRAPH CONVOLUTIONAL NETWORKS . GCNs are neural networks that operate directly on graphs as the input data structure . A GCN aims to define an operation similar to a convolutional layer in CNNs , where a parameterized filter is applied to a pixel and its neighbors in an image ( Fig 1 ) . In the graph setting , the pixel corresponds to a vertex , and the edges from the vertex point out its neighbors ( Fig 2 ) . Early approaches to define this operation used graph convolutions from spectral graph theory ( Bruna et al. , 2014 ; Henaff et al. , 2015 ) . While theoretically sound , these approaches are difficult to scale to large graphs . ( Wu et al. , 2020 ) . Recent research ( e.g . ( Hamilton et al. , 2017b ; Chen et al. , 2018 ) ) instead takes a spatial-based approach , which enables computation in batches of vertices . The goal of a GCN is to learn the parameters of a neural network given a graph G = ( V , E ) where V is a set of vertices and E is a set of edges . The input is a feature matrix X , where each row represents the feature vector xv for every vertex v ∈ V , and an adjacency matrix A which represents the edges e ∈ E. Each layer in can be described as Hi = f ( Hi−1 , A ) , H0 = X , where i is the layer order and f is a propagation rule ( Kipf & Welling , 2017 ) . The number of layers and the propagation rule differ between GCNs . While our proposal is general to all GCNs of this type , we evaluate it on the GCN proposed by Kipf & Welling ( 2017 ) , which we call KW-GCN , and GraphSAGE proposed by Hamilton et al . ( 2017b ) . Both GCNs are described in more detail in Section 4.1 . Figure 1 : Image convolution . Figure 2 : Graph convolution . 2.2 LIMITATIONS TO INPUT APPROXIMATIONS . Our proposal builds upon the observation that GCNs may be resilient to approximations in the input graph . To investigate the extent of resilience , we trained both KW-GCN and GraphSAGE on the Reddit dataset ( Hamilton et al. , 2017b ) , described in Section 4.2 , for the task of vertex classification . To introduce approximations in the input graph , we randomly select an increasingly larger fraction of the training vertices to be deleted . We then use the approximated graph to train each GCN and compute the micro F1 score ( the micro-averaged harmonic mean of precision and recall , which we call accuracy ) on the complete test set . Figure 3 shows the results . We make the following qualitative observation : while GraphSAGE and KW-GCN are not equivalent in their resiliency towards vertex deletion , both networks demonstrate that up until a certain point it is possible to delete vertices without a large accuracy drop . While this might seem like a trivial but promising approach to train more efficiently by simply dropping vertices , in practice the threshold for deletion must be large to make a significant impact on the memory footprint : 50 % of the vertices has to be removed to reduce the memory footprints by 2X . Such a high deletion fraction incurs an unacceptable accuracy penalty . In this work , we instead leverage this observation to gain partial knowledge about non-local subgraphs in a distributed setting . While this approach increases the total workload by introducing redundancy , we show in Section 5 that only a small overhead is needed to substantially increase accuracy . In the next section we describe our proposed solution that exploits the approximation resilience property . 3 DISTRIBUTED TRAINING OF GCNS USING SUBGRAPH APPROXIMATION . A common approach to achieve distributed training is to leverage data parallelism : the training data is divided into mutually exclusive sets , and each machine is assigned one of these sets . Aside from decreasing training time , data parallelism also reduces memory footprint by lowering the amount of data each machine has to handle . If the graph does not fit in memory , the performance will be significantly impacted due to storage access time ( Ham et al. , 2016 ; Ahn et al. , 2015 ) . The main challenge of distributed subgraph training is accuracy . Each machine has only knowledge about the graph structure in its own partition . The result is that important information embedded in other parts of the graph is not captured in local subgraphs . Therefore , the local neural network may not learn global patterns . This is a unique problem to graph data structures . If the input to the neural network consists of images , no information is lost when the dataset is distributed , since each image is an independent data element . If the input is a graph , some edges that span the partitions are essentially unaccounted for during training . If the convolution operator ( Figure 2 ) targets a vertex at the edge of the subgraph , the neighbor data needed is not available in the local machine . A choice has to be made : either acknowledge the edge by trying to fetch the missing data from the non-local machine , or ignore the edge . Both approaches introduce inefficiencies . If the edge is acknowledged , there is a risk of overflowing the network with communication calls , since the machine that holds the neighboring vertex first has to be identified , and then that machine has to send out its data . The number of communication calls grows with the number of machines . However , if the edge is ignored , the execution time of each machine decreases since the communication overhead is minimized , but information is lost : the convolution will be approximate . Algorithm 1 : Breadth-first random sampling of vertices Input : Np : number of vertices in partition p ; M : number of partitions ; P : partitions ; O : overlap Output : Po : Partitions with overlap O 1 for p in P do 2 nts = O·Np M−1 ; Po [ p ] = p 3 for op in P \ p do 4 sample ( Po [ p ] , p , op , nts ) 5 Function sample ( Po [ p ] , p , op , nts ) : 6 selection = neighbors ( p , op ) 7 if size of selection > = nts then 8 sn = random ( selection , nts ) ; Po [ p ] = sn ∪ Po [ p ] 9 else 10 Po [ p ] = selection ∪ Po [ p ] 11 hop = neighbors ( selection , op ) \ selection 12 if ! hop is empty then sample ( Po [ p ] , hop , op , nts - size of selection ) ; | This paper studies how to do distributed training for GNNs. For GNNs, nodes are connected so that it is not trivial to do distributed training, because it needs message passing across machines, incurring communication costs. If no message passing across machines, the performance will be bad. To address this problem, this paper stores a subset of the neighbors from other machines to reduce the cost for message passing across machines. The experimental results show improvement to some extent. | SP:b7fdf5984d0bd1e4caff646d1a403b18c854e7bd |
Distributed Training of Graph Convolutional Networks using Subgraph Approximation | 1 INTRODUCTION . Graphs are used to model data in a diverse range of applications such as social networks ( Hamilton et al. , 2017a ) , biological networks ( Fout et al. , 2017 ) and e-commerce interactions ( Yang , 2019 ) . Recently , there has been an increased interest in applying machine learning techniques to graph data . A breakthrough was the development of Graph Convolutional Networks ( GCNs ) , which generalize the function of Convolutional Neural Networks ( CNNs ) , to operate on graphs ( Kipf & Welling , 2017 ) . Training GCNs , much like training CNNs , is a memory and computationally demanding task and may take days or weeks to train on large graphs . GCNs are particularly memory demanding since processing a single vertex may require accessing a large number of neighbors . If the GCN algorithm accesses neighbors which are multiple hops away , it may need to traverse disparate sections of the graph with no locality . This requirement poses challenges when the graph does not fit in memory , which is often the case for large graph representations . Previous approaches to alleviate issues of memory and performance seeks to constrain the number of dependent vertices by employing sampling-based methods ( Hamilton et al. , 2017b ; Chen et al. , 2018 ; Huang et al. , 2018 ; Chiang et al. , 2019 ) . However , sampling the graph may limit the achievable accuracy ( Jia et al. , 2020 ) . CNN training turned to data parallel distributed training to alleviate the memory size constraints and the computing capacity of a single machine . Here , a number of machines independently train the same neural network model but on an assigned chunk of the input data . To construct a single global model , the gradients or parameters are aggregated at regular intervals , such as at the completion of a batch ( Dean et al. , 2012 ) . While this approach works well for CNNs , it is more challenging for GCNs due to the nature of the input data . If the training input is a set of images , each image is independent . Hence , when the dataset is split into chunks of images , no information is directly carried between the chunks . In contrast , if the input is a graph , the equivalent of splitting the dataset into chunks is to divide the large graph into a number of subgraphs . However , GCNs train on graphs which rely not only on information inherent to a vertex but also information from its neighbors . When a GCN trains on one subgraph and needs information from a neighbor in another subgraph , the information from the edges that span across machines creates a communication bottleneck . For example , in our experimental evaluations we note that when the Reddit dataset ( Hamilton et al. , 2017b ) is partitioned into five subgraphs , there are about 1.3 million ( bidirectional ) edges that span across machines . If each edge is followed , 2.6 million messages would be sent , each containing a feature vector of 602 single-precision floats , summing up to about 6.3 GB of data transferred each epoch , where one epoch traverses the entire graph . Each training typically requires many epochs . In our experiments running distributed training on the GCN proposed by Kipf & Welling ( 2017 ) one epoch takes about one second . Thus the bandwidth required is enormous . This is a serious scalability issue : since the time it takes to finish one epoch decreases when the training is scaled out on more machines , the required bandwidth increases . Even with optimizations such as caching that might be possible ( e.g . vertex caching ( Yang , 2019 ) ) , the amount of communication is significant . Alternatively , instead of communicating between subgraphs , a GCN may ignore any information that spans multiple machines ( Jia et al. , 2020 ) . However , we observe that this approach results in accuracy loss due to suboptimal training . For example , when distributed on five compute nodes and ignoring edges that span across machines , we note in our evaluations that the accuracy of GraphSAGE trained on the Reddit dataset drops from 94.94 % to 89.95 % , a substantial loss in accuracy . To mitigate this problem , we present a distributed training approach of GCNs which reaches an accuracy comparable with training on a single-machine system , while keeping the communication overhead low . This allows for GCNs to train on very large graphs using a distributed system where each machine has limited memory , since the memory usage on each machine scales with the size of its allotted ( local ) subgraph . We achieve this by approximating the non-local subgraphs and making the approximations available in the local machine . We show that , by incurring a small vertex overhead in each local machine , a high accuracy can be achieved . Our contributions in this paper are : • A novel subgraph approximation scheme to enable distributed training of GCNs on large graphs using memory-constrained machines , while reaching an accuracy comparable to that achieved on a single machine . • An evaluation of the approach on two GCNs and two datasets , showing that it considerably increases convergence accuracy , and allows for faster training while keeping the memory overhead low . The rest of the paper is organized as follows . Section 2 walks through the necessary background and presents experimental data that motivates our approach . Section 3 describes our approach to efficiently distribute GCNs . Section 4 describes our evaluation methodology , while Section 5 presents the results of our evaluation . Section 6 discusses related work before we conclude in Section 7 . 2 BACKGROUND AND MOTIVATION . In this section we first describe GCNs . Then , we show that GCNs are resilient to approximations in the input graph , and describe how that motivates our approach in Section 3 . 2.1 GRAPH CONVOLUTIONAL NETWORKS . GCNs are neural networks that operate directly on graphs as the input data structure . A GCN aims to define an operation similar to a convolutional layer in CNNs , where a parameterized filter is applied to a pixel and its neighbors in an image ( Fig 1 ) . In the graph setting , the pixel corresponds to a vertex , and the edges from the vertex point out its neighbors ( Fig 2 ) . Early approaches to define this operation used graph convolutions from spectral graph theory ( Bruna et al. , 2014 ; Henaff et al. , 2015 ) . While theoretically sound , these approaches are difficult to scale to large graphs . ( Wu et al. , 2020 ) . Recent research ( e.g . ( Hamilton et al. , 2017b ; Chen et al. , 2018 ) ) instead takes a spatial-based approach , which enables computation in batches of vertices . The goal of a GCN is to learn the parameters of a neural network given a graph G = ( V , E ) where V is a set of vertices and E is a set of edges . The input is a feature matrix X , where each row represents the feature vector xv for every vertex v ∈ V , and an adjacency matrix A which represents the edges e ∈ E. Each layer in can be described as Hi = f ( Hi−1 , A ) , H0 = X , where i is the layer order and f is a propagation rule ( Kipf & Welling , 2017 ) . The number of layers and the propagation rule differ between GCNs . While our proposal is general to all GCNs of this type , we evaluate it on the GCN proposed by Kipf & Welling ( 2017 ) , which we call KW-GCN , and GraphSAGE proposed by Hamilton et al . ( 2017b ) . Both GCNs are described in more detail in Section 4.1 . Figure 1 : Image convolution . Figure 2 : Graph convolution . 2.2 LIMITATIONS TO INPUT APPROXIMATIONS . Our proposal builds upon the observation that GCNs may be resilient to approximations in the input graph . To investigate the extent of resilience , we trained both KW-GCN and GraphSAGE on the Reddit dataset ( Hamilton et al. , 2017b ) , described in Section 4.2 , for the task of vertex classification . To introduce approximations in the input graph , we randomly select an increasingly larger fraction of the training vertices to be deleted . We then use the approximated graph to train each GCN and compute the micro F1 score ( the micro-averaged harmonic mean of precision and recall , which we call accuracy ) on the complete test set . Figure 3 shows the results . We make the following qualitative observation : while GraphSAGE and KW-GCN are not equivalent in their resiliency towards vertex deletion , both networks demonstrate that up until a certain point it is possible to delete vertices without a large accuracy drop . While this might seem like a trivial but promising approach to train more efficiently by simply dropping vertices , in practice the threshold for deletion must be large to make a significant impact on the memory footprint : 50 % of the vertices has to be removed to reduce the memory footprints by 2X . Such a high deletion fraction incurs an unacceptable accuracy penalty . In this work , we instead leverage this observation to gain partial knowledge about non-local subgraphs in a distributed setting . While this approach increases the total workload by introducing redundancy , we show in Section 5 that only a small overhead is needed to substantially increase accuracy . In the next section we describe our proposed solution that exploits the approximation resilience property . 3 DISTRIBUTED TRAINING OF GCNS USING SUBGRAPH APPROXIMATION . A common approach to achieve distributed training is to leverage data parallelism : the training data is divided into mutually exclusive sets , and each machine is assigned one of these sets . Aside from decreasing training time , data parallelism also reduces memory footprint by lowering the amount of data each machine has to handle . If the graph does not fit in memory , the performance will be significantly impacted due to storage access time ( Ham et al. , 2016 ; Ahn et al. , 2015 ) . The main challenge of distributed subgraph training is accuracy . Each machine has only knowledge about the graph structure in its own partition . The result is that important information embedded in other parts of the graph is not captured in local subgraphs . Therefore , the local neural network may not learn global patterns . This is a unique problem to graph data structures . If the input to the neural network consists of images , no information is lost when the dataset is distributed , since each image is an independent data element . If the input is a graph , some edges that span the partitions are essentially unaccounted for during training . If the convolution operator ( Figure 2 ) targets a vertex at the edge of the subgraph , the neighbor data needed is not available in the local machine . A choice has to be made : either acknowledge the edge by trying to fetch the missing data from the non-local machine , or ignore the edge . Both approaches introduce inefficiencies . If the edge is acknowledged , there is a risk of overflowing the network with communication calls , since the machine that holds the neighboring vertex first has to be identified , and then that machine has to send out its data . The number of communication calls grows with the number of machines . However , if the edge is ignored , the execution time of each machine decreases since the communication overhead is minimized , but information is lost : the convolution will be approximate . Algorithm 1 : Breadth-first random sampling of vertices Input : Np : number of vertices in partition p ; M : number of partitions ; P : partitions ; O : overlap Output : Po : Partitions with overlap O 1 for p in P do 2 nts = O·Np M−1 ; Po [ p ] = p 3 for op in P \ p do 4 sample ( Po [ p ] , p , op , nts ) 5 Function sample ( Po [ p ] , p , op , nts ) : 6 selection = neighbors ( p , op ) 7 if size of selection > = nts then 8 sn = random ( selection , nts ) ; Po [ p ] = sn ∪ Po [ p ] 9 else 10 Po [ p ] = selection ∪ Po [ p ] 11 hop = neighbors ( selection , op ) \ selection 12 if ! hop is empty then sample ( Po [ p ] , hop , op , nts - size of selection ) ; | The paper presents a subgraph approximation method to reduce communication in distributed GCN training. The authors observe that up until a certain point it is possible to delete vertices in a graph without a large accuracy loss for GCN training. Based on the observation, the authors propose the subgraph approximation idea. They claim that if the subgraph on each machine has additional information of 1 or 2 hop neighbors, the accuracy of GCN training can be maintained. | SP:b7fdf5984d0bd1e4caff646d1a403b18c854e7bd |
Long-tail learning via logit adjustment | 1 INTRODUCTION . Real-world classification problems typically exhibit a long-tailed label distribution , wherein most labels are associated with only a few samples ( Van Horn & Perona , 2017 ; Buda et al. , 2017 ; Liu et al. , 2019 ) . Owing to this paucity of samples , generalisation on such labels is challenging ; moreover , naïve learning on such data is susceptible to an undesirable bias towards dominant labels . This problem has been widely studied in the literature on learning under class imbalance ( Kubat et al. , 1997 ; Chawla et al. , 2002 ; He & Garcia , 2009 ) , and the related problem of cost-sensitive learning ( Elkan , 2001 ) . Recently , long-tail learning has received renewed interest in the context of neural networks . Two active strands of work involve post-hoc normalisation of the classification weights ( Zhang et al. , 2019 ; Kim & Kim , 2019 ; Kang et al. , 2020 ; Ye et al. , 2020 ) , and modification of the underlying loss to account for varying class penalties ( Zhang et al. , 2017 ; Cui et al. , 2019 ; Cao et al. , 2019 ; Tan et al. , 2020 ) . Each of these strands are intuitive , and have proven empirically successful . However , they are not without limitation : e.g. , weight normalisation crucially relies on the weight norms being smaller for rare classes ; however , this assumption is sensitive to the choice of optimiser ( see §2.1 ) . On the other hand , loss modification sacrifices the consistency that underpins the canonical softmax cross-entropy ( see §5.1 ) . Consequently , such techniques may prove suboptimal even in simple settings ( see §6.1 ) . In this paper , we establish a statistical framework for long-tail learning that offers a unified view of post-hoc normalisation and loss modification techniques , while overcoming their limitations . Our framework revisits the classic idea of logit adjustment based on label frequencies ( Provost , 2000 ; Zhou & Liu , 2006 ; Collell et al. , 2016 ) , which encourages a large relative margin between a pair of rare positive and dominant negative labels . Such adjustment can be achieved by shifting the learned logits post-hoc , or augmenting the softmax cross-entropy with a pairwise label margin ( cf . ( 11 ) ) . While similar in nature to recent techniques , our logit adjustment approaches additionally have a firm statistical grounding : they are Fisher consistent for minimising the balanced error ( cf . ( 2 ) ) , a common metric in long-tail settings which averages the per-class errors . This statistical grounding translates into strong empirical performance on four real-world datasets with long-tailed label distributions . In summary , our contributions are : ( i ) we establish a statistical framework for long-tail learning ( §3 ) based on logit adjustment that provides a unified view of post-hoc correction and loss modification 2 PROBLEM SETUP AND RELATED WORK . Consider a multiclass classification problem with instances X and labels Y = [ L ] .= { 1 , 2 , . . . , L } . Given a sample S = { ( xn , yn ) } Nn=1 ∼ PN for unknown distribution P over X × Y , our goal is to learn a scorer f : X→ RL that minimises the misclassification error Px , y ( y /∈ argmaxy′∈Y fy′ ( x ) ) . Typically , one minimises a surrogate loss ` : Y× RL → R such as the softmax cross-entropy , ` ( y , f ( x ) ) = log [ ∑ y′∈ [ L ] efy′ ( x ) ] − fy ( x ) = log [ 1 + ∑ y′ 6=y efy′ ( x ) −fy ( x ) ] . ( 1 ) We may view the resulting softmax probabilities py ( x ) ∝ efy ( x ) as estimates of P ( y | x ) . The setting of learning under class imbalance or long-tail learning is where the distribution P ( y ) is highly skewed , so that many rare ( or “ tail ” ) labels have a low probability of occurrence . Here , the misclassification error is not a suitable measure of performance : a trivial predictor which classifies every instance to the majority label will attain a low misclassification error . To cope with this , a natural alternative is the balanced error ( Chan & Stolfo , 1998 ; Brodersen et al. , 2010 ; Menon et al. , 2013 ) , which averages each of the per-class error rates : under a uniform label distribution BER ( f ) . = 1 L ∑ y∈ [ L ] Px|y ( y /∈ argmaxy′∈Y fy′ ( x ) ) . ( 2 ) This can be seen as implicitly using a balanced class-probability function Pbal ( y | x ) ∝ 1L ·P ( x | y ) , as opposed to the native P ( y | x ) ∝ P ( y ) · P ( x | y ) that is employed in the misclassification error.1 Broadly , extant approaches to coping with class imbalance modify : ( i ) the inputs to a model , for example by over- or under-sampling ( Kubat & Matwin , 1997 ; Chawla et al. , 2002 ; Wallace et al. , 2011 ; Mikolov et al. , 2013 ; Mahajan et al. , 2018 ; Yin et al. , 2018 ) ; ( ii ) the outputs of a model , for example by post-hoc correction of the decision threshold ( Fawcett & Provost , 1996 ; Collell et al. , 2016 ) or weights ( Kim & Kim , 2019 ; Kang et al. , 2020 ) ; or ( iii ) the training procedure of a model , for example by modifying the loss function ( Zhang et al. , 2017 ; Cui et al. , 2019 ; Cao et al. , 2019 ; Tan et al. , 2020 ; Jamal et al. , 2020 ) . One may easily combine approaches from the first stream with those from the latter two . Consequently , we focus on the latter two in this work , and describe some representative recent examples from each . Post-hoc weight normalisation . Suppose fy ( x ) = w > y Φ ( x ) for classification weights wy ∈ RD and representations Φ : X→ RD , as learned by a neural network . ( We may add per-label bias terms 1Both the misclassification and balanced error compare the top-1 predicted versus true label . One may analogously define a balanced top-k error ( Lapin et al. , 2018 ) , which may be useful in retrieval settings . to fy by adding a constant feature to Φ . ) A fruitful avenue of exploration involves decoupling of representation and classifier learning ( Zhang et al. , 2019 ) . Concretely , we first learn { wy , Φ } via standard training on the long-tailed training sample S , and then for x ∈ X predict the label argmaxy∈ [ L ] w > y Φ ( x ) /ν τ y = argmaxy∈ [ L ] fy ( x ) /ν τ y , ( 3 ) for τ > 0 , where νy = P ( y ) in Kim & Kim ( 2019 ) ; Ye et al . ( 2020 ) and νy = ‖wy‖2 in Kang et al . ( 2020 ) . Intuitively , either choice of νy upweights the contribution of rare labels through weight normalisation . The choice νy = ‖wy‖2 is motivated by the observations that ‖wy‖2 tends to correlate with P ( y ) . Further to the above , one may enforce ‖wy‖2 = 1 during training ( Kim & Kim , 2019 ) . Loss modification . A classic means of coping with class imbalance is to balance the loss , wherein ` ( y , f ( x ) ) is weighted by P ( y ) −1 ( Xie & Manski , 1989 ; Morik et al. , 1999 ) : e.g. , applied to ( 1 ) , ` ( y , f ( x ) ) = 1 P ( y ) · log [ 1 + ∑ y′ 6=y efy′ ( x ) −fy ( x ) ] . ( 4 ) While intuitive , balancing has minimal effect in separable settings : solutions that achieve zero training loss will necessarily remain optimal even under weighting ( Byrd & Lipton , 2019 ) . Intuitively , one would instead like to shift the separator closer to a dominant class . Li et al . ( 2002 ) ; Wu et al . ( 2008 ) ; Masnadi-Shirazi & Vasconcelos ( 2010 ) thus proposed to add per-class margins into the hinge loss . Cao et al . ( 2019 ) similarly proposed to add a per-class margin into the softmax cross-entropy : ` ( y , f ( x ) ) = log [ 1 + ∑ y′ 6=y eδy · efy′ ( x ) −fy ( x ) ] , ( 5 ) where δy ∝ P ( y ) −1/4 . This upweights rare “ positive ” y to encourage a larger gap fy ( x ) − fy′ ( x ) , i.e. , the margin between y and any “ negative ” y′ 6= y . Separately , Tan et al . ( 2020 ) proposed ` ( y , f ( x ) ) = log [ 1 + ∑ y′ 6=y eδy′ · efy′ ( x ) −fy ( x ) ] , ( 6 ) where δy′ ≤ 0 is a non-decreasing transform of P ( y′ ) . Note that in the original softmax cross-entropy with δy′ = 0 , a rare label often receives a strong inhibitory gradient signal as it disproportionately appear as a negative for dominant labels . This can be modulated by letting δy′ 0 . 2.1 LIMITATIONS OF EXISTING APPROACHES . Each of the above methods are intuitive , and have shown strong empirical performance . However , a closer analysis identifies some subtle limitations . Limitations of weight normalisation . Post-hoc weight normalisation with νy = ‖wy‖2 per Kang et al . ( 2020 ) is motivated by the observation that the weight norm ‖wy‖2 tends to correlate with P ( y ) . However , this assumption is highly dependent on the choice of optimiser , as Figure 1 illustrates : for ResNet-32 models trained on long-tailed versions of CIFAR-10 and CIFAR-100 , when using the Adam optimiser , the norms are either anti-correlated or independent of P ( y ) . Weight normalisation thus can not achieve the desired effect of boosting rare labels ’ scores . One may hope to side-step this by simply using νy = P ( y ) ; unfortunately , this choice has more subtle limitations ( see §4.2 ) . Limitations of loss modification . Enforcing a per-label margin per ( 5 ) and ( 6 ) is intuitive , as it allows for shifting the decision boundary away from rare classes . However , when doing so , it is important to ensure Fisher consistency ( Lin , 2004 ) ( or classification calibration ( Bartlett et al. , 2006 ) ) of the resulting loss for the balanced error . That is , the minimiser of the expected loss ( equally , the empirical risk in the infinite sample limit ) should result in a minimal balanced error . Unfortunately , both ( 5 ) and ( 6 ) are not consistent in this sense , even for binary problems ; see §5.1 , §6.1 for details . | This well-written paper re-visits the idea of logit adjustment to tackle long-tailed problems. The paper begins by setting up a statistical framework and use that to deliver two ways of realizing the logits adjustment effectively. They further prove the potential of such an approach by benchmarking it with several related baselines on both synthetic and natural long-tailed datasets. | SP:49f0ff35a1d39031bc13b793b04f9d3c84fbfb6e |
Long-tail learning via logit adjustment | 1 INTRODUCTION . Real-world classification problems typically exhibit a long-tailed label distribution , wherein most labels are associated with only a few samples ( Van Horn & Perona , 2017 ; Buda et al. , 2017 ; Liu et al. , 2019 ) . Owing to this paucity of samples , generalisation on such labels is challenging ; moreover , naïve learning on such data is susceptible to an undesirable bias towards dominant labels . This problem has been widely studied in the literature on learning under class imbalance ( Kubat et al. , 1997 ; Chawla et al. , 2002 ; He & Garcia , 2009 ) , and the related problem of cost-sensitive learning ( Elkan , 2001 ) . Recently , long-tail learning has received renewed interest in the context of neural networks . Two active strands of work involve post-hoc normalisation of the classification weights ( Zhang et al. , 2019 ; Kim & Kim , 2019 ; Kang et al. , 2020 ; Ye et al. , 2020 ) , and modification of the underlying loss to account for varying class penalties ( Zhang et al. , 2017 ; Cui et al. , 2019 ; Cao et al. , 2019 ; Tan et al. , 2020 ) . Each of these strands are intuitive , and have proven empirically successful . However , they are not without limitation : e.g. , weight normalisation crucially relies on the weight norms being smaller for rare classes ; however , this assumption is sensitive to the choice of optimiser ( see §2.1 ) . On the other hand , loss modification sacrifices the consistency that underpins the canonical softmax cross-entropy ( see §5.1 ) . Consequently , such techniques may prove suboptimal even in simple settings ( see §6.1 ) . In this paper , we establish a statistical framework for long-tail learning that offers a unified view of post-hoc normalisation and loss modification techniques , while overcoming their limitations . Our framework revisits the classic idea of logit adjustment based on label frequencies ( Provost , 2000 ; Zhou & Liu , 2006 ; Collell et al. , 2016 ) , which encourages a large relative margin between a pair of rare positive and dominant negative labels . Such adjustment can be achieved by shifting the learned logits post-hoc , or augmenting the softmax cross-entropy with a pairwise label margin ( cf . ( 11 ) ) . While similar in nature to recent techniques , our logit adjustment approaches additionally have a firm statistical grounding : they are Fisher consistent for minimising the balanced error ( cf . ( 2 ) ) , a common metric in long-tail settings which averages the per-class errors . This statistical grounding translates into strong empirical performance on four real-world datasets with long-tailed label distributions . In summary , our contributions are : ( i ) we establish a statistical framework for long-tail learning ( §3 ) based on logit adjustment that provides a unified view of post-hoc correction and loss modification 2 PROBLEM SETUP AND RELATED WORK . Consider a multiclass classification problem with instances X and labels Y = [ L ] .= { 1 , 2 , . . . , L } . Given a sample S = { ( xn , yn ) } Nn=1 ∼ PN for unknown distribution P over X × Y , our goal is to learn a scorer f : X→ RL that minimises the misclassification error Px , y ( y /∈ argmaxy′∈Y fy′ ( x ) ) . Typically , one minimises a surrogate loss ` : Y× RL → R such as the softmax cross-entropy , ` ( y , f ( x ) ) = log [ ∑ y′∈ [ L ] efy′ ( x ) ] − fy ( x ) = log [ 1 + ∑ y′ 6=y efy′ ( x ) −fy ( x ) ] . ( 1 ) We may view the resulting softmax probabilities py ( x ) ∝ efy ( x ) as estimates of P ( y | x ) . The setting of learning under class imbalance or long-tail learning is where the distribution P ( y ) is highly skewed , so that many rare ( or “ tail ” ) labels have a low probability of occurrence . Here , the misclassification error is not a suitable measure of performance : a trivial predictor which classifies every instance to the majority label will attain a low misclassification error . To cope with this , a natural alternative is the balanced error ( Chan & Stolfo , 1998 ; Brodersen et al. , 2010 ; Menon et al. , 2013 ) , which averages each of the per-class error rates : under a uniform label distribution BER ( f ) . = 1 L ∑ y∈ [ L ] Px|y ( y /∈ argmaxy′∈Y fy′ ( x ) ) . ( 2 ) This can be seen as implicitly using a balanced class-probability function Pbal ( y | x ) ∝ 1L ·P ( x | y ) , as opposed to the native P ( y | x ) ∝ P ( y ) · P ( x | y ) that is employed in the misclassification error.1 Broadly , extant approaches to coping with class imbalance modify : ( i ) the inputs to a model , for example by over- or under-sampling ( Kubat & Matwin , 1997 ; Chawla et al. , 2002 ; Wallace et al. , 2011 ; Mikolov et al. , 2013 ; Mahajan et al. , 2018 ; Yin et al. , 2018 ) ; ( ii ) the outputs of a model , for example by post-hoc correction of the decision threshold ( Fawcett & Provost , 1996 ; Collell et al. , 2016 ) or weights ( Kim & Kim , 2019 ; Kang et al. , 2020 ) ; or ( iii ) the training procedure of a model , for example by modifying the loss function ( Zhang et al. , 2017 ; Cui et al. , 2019 ; Cao et al. , 2019 ; Tan et al. , 2020 ; Jamal et al. , 2020 ) . One may easily combine approaches from the first stream with those from the latter two . Consequently , we focus on the latter two in this work , and describe some representative recent examples from each . Post-hoc weight normalisation . Suppose fy ( x ) = w > y Φ ( x ) for classification weights wy ∈ RD and representations Φ : X→ RD , as learned by a neural network . ( We may add per-label bias terms 1Both the misclassification and balanced error compare the top-1 predicted versus true label . One may analogously define a balanced top-k error ( Lapin et al. , 2018 ) , which may be useful in retrieval settings . to fy by adding a constant feature to Φ . ) A fruitful avenue of exploration involves decoupling of representation and classifier learning ( Zhang et al. , 2019 ) . Concretely , we first learn { wy , Φ } via standard training on the long-tailed training sample S , and then for x ∈ X predict the label argmaxy∈ [ L ] w > y Φ ( x ) /ν τ y = argmaxy∈ [ L ] fy ( x ) /ν τ y , ( 3 ) for τ > 0 , where νy = P ( y ) in Kim & Kim ( 2019 ) ; Ye et al . ( 2020 ) and νy = ‖wy‖2 in Kang et al . ( 2020 ) . Intuitively , either choice of νy upweights the contribution of rare labels through weight normalisation . The choice νy = ‖wy‖2 is motivated by the observations that ‖wy‖2 tends to correlate with P ( y ) . Further to the above , one may enforce ‖wy‖2 = 1 during training ( Kim & Kim , 2019 ) . Loss modification . A classic means of coping with class imbalance is to balance the loss , wherein ` ( y , f ( x ) ) is weighted by P ( y ) −1 ( Xie & Manski , 1989 ; Morik et al. , 1999 ) : e.g. , applied to ( 1 ) , ` ( y , f ( x ) ) = 1 P ( y ) · log [ 1 + ∑ y′ 6=y efy′ ( x ) −fy ( x ) ] . ( 4 ) While intuitive , balancing has minimal effect in separable settings : solutions that achieve zero training loss will necessarily remain optimal even under weighting ( Byrd & Lipton , 2019 ) . Intuitively , one would instead like to shift the separator closer to a dominant class . Li et al . ( 2002 ) ; Wu et al . ( 2008 ) ; Masnadi-Shirazi & Vasconcelos ( 2010 ) thus proposed to add per-class margins into the hinge loss . Cao et al . ( 2019 ) similarly proposed to add a per-class margin into the softmax cross-entropy : ` ( y , f ( x ) ) = log [ 1 + ∑ y′ 6=y eδy · efy′ ( x ) −fy ( x ) ] , ( 5 ) where δy ∝ P ( y ) −1/4 . This upweights rare “ positive ” y to encourage a larger gap fy ( x ) − fy′ ( x ) , i.e. , the margin between y and any “ negative ” y′ 6= y . Separately , Tan et al . ( 2020 ) proposed ` ( y , f ( x ) ) = log [ 1 + ∑ y′ 6=y eδy′ · efy′ ( x ) −fy ( x ) ] , ( 6 ) where δy′ ≤ 0 is a non-decreasing transform of P ( y′ ) . Note that in the original softmax cross-entropy with δy′ = 0 , a rare label often receives a strong inhibitory gradient signal as it disproportionately appear as a negative for dominant labels . This can be modulated by letting δy′ 0 . 2.1 LIMITATIONS OF EXISTING APPROACHES . Each of the above methods are intuitive , and have shown strong empirical performance . However , a closer analysis identifies some subtle limitations . Limitations of weight normalisation . Post-hoc weight normalisation with νy = ‖wy‖2 per Kang et al . ( 2020 ) is motivated by the observation that the weight norm ‖wy‖2 tends to correlate with P ( y ) . However , this assumption is highly dependent on the choice of optimiser , as Figure 1 illustrates : for ResNet-32 models trained on long-tailed versions of CIFAR-10 and CIFAR-100 , when using the Adam optimiser , the norms are either anti-correlated or independent of P ( y ) . Weight normalisation thus can not achieve the desired effect of boosting rare labels ’ scores . One may hope to side-step this by simply using νy = P ( y ) ; unfortunately , this choice has more subtle limitations ( see §4.2 ) . Limitations of loss modification . Enforcing a per-label margin per ( 5 ) and ( 6 ) is intuitive , as it allows for shifting the decision boundary away from rare classes . However , when doing so , it is important to ensure Fisher consistency ( Lin , 2004 ) ( or classification calibration ( Bartlett et al. , 2006 ) ) of the resulting loss for the balanced error . That is , the minimiser of the expected loss ( equally , the empirical risk in the infinite sample limit ) should result in a minimal balanced error . Unfortunately , both ( 5 ) and ( 6 ) are not consistent in this sense , even for binary problems ; see §5.1 , §6.1 for details . | This paper proposes an unifying statistical framework for imbalanced or long-tailed data, where the number of samples for some of the classes may be extremely small compared with other classes. Previous methods work empirically well, but was not consistent, meaning that even in the infinite sample limit, the minimiser doesn't result in a minimal balanced error. The paper proposes a framework based on logit adjustment in two ways: a post-hoc logit adjustment way and another way that injects the logit adjustment to the softmax cross-entropy loss function directly. The paper shows that they are both consistent. Experiments show that the proposed methods work better than previous methods. | SP:49f0ff35a1d39031bc13b793b04f9d3c84fbfb6e |
Long-tail learning via logit adjustment | 1 INTRODUCTION . Real-world classification problems typically exhibit a long-tailed label distribution , wherein most labels are associated with only a few samples ( Van Horn & Perona , 2017 ; Buda et al. , 2017 ; Liu et al. , 2019 ) . Owing to this paucity of samples , generalisation on such labels is challenging ; moreover , naïve learning on such data is susceptible to an undesirable bias towards dominant labels . This problem has been widely studied in the literature on learning under class imbalance ( Kubat et al. , 1997 ; Chawla et al. , 2002 ; He & Garcia , 2009 ) , and the related problem of cost-sensitive learning ( Elkan , 2001 ) . Recently , long-tail learning has received renewed interest in the context of neural networks . Two active strands of work involve post-hoc normalisation of the classification weights ( Zhang et al. , 2019 ; Kim & Kim , 2019 ; Kang et al. , 2020 ; Ye et al. , 2020 ) , and modification of the underlying loss to account for varying class penalties ( Zhang et al. , 2017 ; Cui et al. , 2019 ; Cao et al. , 2019 ; Tan et al. , 2020 ) . Each of these strands are intuitive , and have proven empirically successful . However , they are not without limitation : e.g. , weight normalisation crucially relies on the weight norms being smaller for rare classes ; however , this assumption is sensitive to the choice of optimiser ( see §2.1 ) . On the other hand , loss modification sacrifices the consistency that underpins the canonical softmax cross-entropy ( see §5.1 ) . Consequently , such techniques may prove suboptimal even in simple settings ( see §6.1 ) . In this paper , we establish a statistical framework for long-tail learning that offers a unified view of post-hoc normalisation and loss modification techniques , while overcoming their limitations . Our framework revisits the classic idea of logit adjustment based on label frequencies ( Provost , 2000 ; Zhou & Liu , 2006 ; Collell et al. , 2016 ) , which encourages a large relative margin between a pair of rare positive and dominant negative labels . Such adjustment can be achieved by shifting the learned logits post-hoc , or augmenting the softmax cross-entropy with a pairwise label margin ( cf . ( 11 ) ) . While similar in nature to recent techniques , our logit adjustment approaches additionally have a firm statistical grounding : they are Fisher consistent for minimising the balanced error ( cf . ( 2 ) ) , a common metric in long-tail settings which averages the per-class errors . This statistical grounding translates into strong empirical performance on four real-world datasets with long-tailed label distributions . In summary , our contributions are : ( i ) we establish a statistical framework for long-tail learning ( §3 ) based on logit adjustment that provides a unified view of post-hoc correction and loss modification 2 PROBLEM SETUP AND RELATED WORK . Consider a multiclass classification problem with instances X and labels Y = [ L ] .= { 1 , 2 , . . . , L } . Given a sample S = { ( xn , yn ) } Nn=1 ∼ PN for unknown distribution P over X × Y , our goal is to learn a scorer f : X→ RL that minimises the misclassification error Px , y ( y /∈ argmaxy′∈Y fy′ ( x ) ) . Typically , one minimises a surrogate loss ` : Y× RL → R such as the softmax cross-entropy , ` ( y , f ( x ) ) = log [ ∑ y′∈ [ L ] efy′ ( x ) ] − fy ( x ) = log [ 1 + ∑ y′ 6=y efy′ ( x ) −fy ( x ) ] . ( 1 ) We may view the resulting softmax probabilities py ( x ) ∝ efy ( x ) as estimates of P ( y | x ) . The setting of learning under class imbalance or long-tail learning is where the distribution P ( y ) is highly skewed , so that many rare ( or “ tail ” ) labels have a low probability of occurrence . Here , the misclassification error is not a suitable measure of performance : a trivial predictor which classifies every instance to the majority label will attain a low misclassification error . To cope with this , a natural alternative is the balanced error ( Chan & Stolfo , 1998 ; Brodersen et al. , 2010 ; Menon et al. , 2013 ) , which averages each of the per-class error rates : under a uniform label distribution BER ( f ) . = 1 L ∑ y∈ [ L ] Px|y ( y /∈ argmaxy′∈Y fy′ ( x ) ) . ( 2 ) This can be seen as implicitly using a balanced class-probability function Pbal ( y | x ) ∝ 1L ·P ( x | y ) , as opposed to the native P ( y | x ) ∝ P ( y ) · P ( x | y ) that is employed in the misclassification error.1 Broadly , extant approaches to coping with class imbalance modify : ( i ) the inputs to a model , for example by over- or under-sampling ( Kubat & Matwin , 1997 ; Chawla et al. , 2002 ; Wallace et al. , 2011 ; Mikolov et al. , 2013 ; Mahajan et al. , 2018 ; Yin et al. , 2018 ) ; ( ii ) the outputs of a model , for example by post-hoc correction of the decision threshold ( Fawcett & Provost , 1996 ; Collell et al. , 2016 ) or weights ( Kim & Kim , 2019 ; Kang et al. , 2020 ) ; or ( iii ) the training procedure of a model , for example by modifying the loss function ( Zhang et al. , 2017 ; Cui et al. , 2019 ; Cao et al. , 2019 ; Tan et al. , 2020 ; Jamal et al. , 2020 ) . One may easily combine approaches from the first stream with those from the latter two . Consequently , we focus on the latter two in this work , and describe some representative recent examples from each . Post-hoc weight normalisation . Suppose fy ( x ) = w > y Φ ( x ) for classification weights wy ∈ RD and representations Φ : X→ RD , as learned by a neural network . ( We may add per-label bias terms 1Both the misclassification and balanced error compare the top-1 predicted versus true label . One may analogously define a balanced top-k error ( Lapin et al. , 2018 ) , which may be useful in retrieval settings . to fy by adding a constant feature to Φ . ) A fruitful avenue of exploration involves decoupling of representation and classifier learning ( Zhang et al. , 2019 ) . Concretely , we first learn { wy , Φ } via standard training on the long-tailed training sample S , and then for x ∈ X predict the label argmaxy∈ [ L ] w > y Φ ( x ) /ν τ y = argmaxy∈ [ L ] fy ( x ) /ν τ y , ( 3 ) for τ > 0 , where νy = P ( y ) in Kim & Kim ( 2019 ) ; Ye et al . ( 2020 ) and νy = ‖wy‖2 in Kang et al . ( 2020 ) . Intuitively , either choice of νy upweights the contribution of rare labels through weight normalisation . The choice νy = ‖wy‖2 is motivated by the observations that ‖wy‖2 tends to correlate with P ( y ) . Further to the above , one may enforce ‖wy‖2 = 1 during training ( Kim & Kim , 2019 ) . Loss modification . A classic means of coping with class imbalance is to balance the loss , wherein ` ( y , f ( x ) ) is weighted by P ( y ) −1 ( Xie & Manski , 1989 ; Morik et al. , 1999 ) : e.g. , applied to ( 1 ) , ` ( y , f ( x ) ) = 1 P ( y ) · log [ 1 + ∑ y′ 6=y efy′ ( x ) −fy ( x ) ] . ( 4 ) While intuitive , balancing has minimal effect in separable settings : solutions that achieve zero training loss will necessarily remain optimal even under weighting ( Byrd & Lipton , 2019 ) . Intuitively , one would instead like to shift the separator closer to a dominant class . Li et al . ( 2002 ) ; Wu et al . ( 2008 ) ; Masnadi-Shirazi & Vasconcelos ( 2010 ) thus proposed to add per-class margins into the hinge loss . Cao et al . ( 2019 ) similarly proposed to add a per-class margin into the softmax cross-entropy : ` ( y , f ( x ) ) = log [ 1 + ∑ y′ 6=y eδy · efy′ ( x ) −fy ( x ) ] , ( 5 ) where δy ∝ P ( y ) −1/4 . This upweights rare “ positive ” y to encourage a larger gap fy ( x ) − fy′ ( x ) , i.e. , the margin between y and any “ negative ” y′ 6= y . Separately , Tan et al . ( 2020 ) proposed ` ( y , f ( x ) ) = log [ 1 + ∑ y′ 6=y eδy′ · efy′ ( x ) −fy ( x ) ] , ( 6 ) where δy′ ≤ 0 is a non-decreasing transform of P ( y′ ) . Note that in the original softmax cross-entropy with δy′ = 0 , a rare label often receives a strong inhibitory gradient signal as it disproportionately appear as a negative for dominant labels . This can be modulated by letting δy′ 0 . 2.1 LIMITATIONS OF EXISTING APPROACHES . Each of the above methods are intuitive , and have shown strong empirical performance . However , a closer analysis identifies some subtle limitations . Limitations of weight normalisation . Post-hoc weight normalisation with νy = ‖wy‖2 per Kang et al . ( 2020 ) is motivated by the observation that the weight norm ‖wy‖2 tends to correlate with P ( y ) . However , this assumption is highly dependent on the choice of optimiser , as Figure 1 illustrates : for ResNet-32 models trained on long-tailed versions of CIFAR-10 and CIFAR-100 , when using the Adam optimiser , the norms are either anti-correlated or independent of P ( y ) . Weight normalisation thus can not achieve the desired effect of boosting rare labels ’ scores . One may hope to side-step this by simply using νy = P ( y ) ; unfortunately , this choice has more subtle limitations ( see §4.2 ) . Limitations of loss modification . Enforcing a per-label margin per ( 5 ) and ( 6 ) is intuitive , as it allows for shifting the decision boundary away from rare classes . However , when doing so , it is important to ensure Fisher consistency ( Lin , 2004 ) ( or classification calibration ( Bartlett et al. , 2006 ) ) of the resulting loss for the balanced error . That is , the minimiser of the expected loss ( equally , the empirical risk in the infinite sample limit ) should result in a minimal balanced error . Unfortunately , both ( 5 ) and ( 6 ) are not consistent in this sense , even for binary problems ; see §5.1 , §6.1 for details . | This paper provides a statistical framework for long-tail learning by revisiting the idea of logit adjustment based on the label frequencies. The proposed framework then yields two variant techniques that follow the paradigm of weight normalization or loss modification. Compared with the existing methods, the proposed methods are generalized and Fisher consistent for minimizing the balanced error. Finally, empirical results on four real-world datasets validate the effectiveness and statistical grounding of the proposed methods. | SP:49f0ff35a1d39031bc13b793b04f9d3c84fbfb6e |
Disentangling Representations of Text by Masking Transformers | 1 INTRODUCTION AND MOTIVATION . Large-scale pretrained models such as ELMo ( Peters et al. , 2018 ) , BERT ( Devlin et al. , 2018 ) , and XLNet ( Yang et al. , 2019 ) have come to dominate in modern natural language processing ( NLP ) . Such models rely on self-supervision over large datasets to learn general-purpose representations of text that achieve competitive predictive performance across a spectrum of downstream tasks ( Liu et al. , 2019 ) . A downside of such learned representations is that it is not obvious what information they are encoding , which hinders model robustness and interpretability . The opacity of representations produced by models such as BERT has motivated a line of NLP research on designing probing tasks as a means of uncovering what properties of input texts are encoded into token- and sentencelevel representations ( Rogers et al. , 2020 ; Linzen et al. , 2019 ; Tenney et al. , 2019 ) . In this paper we investigate whether we can uncover disentangled representations from pretrained models . That is , rather than mapping inputs onto a single vector that captures arbitrary combinations of features , our aim is to extract a representation that factorizes into distinct , complementary properties of the input . An advantage of explicitly factorizing representations is that it aids interpretability , in the sense that it becomes more straightforward to determine what factors of variation inform predictions in downstream tasks . Further , disentangled representations may facilitate increased robustness under distributional shifts by capturing a notion of invariance : If syntactic changes in a sentence do not affect the representation of semantic features , and vice versa , then we can hope to learn models that are less sensitive to any incidental correlations between these factors . A general motivation for learning disentangled representations is to try and minimize — or at least expose — model reliance on spurious correlations , i.e. , relationships between ( potentially sensitive ) attributes and labels that exist in the training data but which are not casually linked ( Kaushik et al. , 2020 ) . This is particularly relevant in the context of large pretrained models like BERT , as we do not know what the representations produced by such models encode . To date , most research on disentangled representations has focused on applications in computer vision ( Locatello et al. , 2019b ; Kulkarni et al. , 2015 ; Chen et al. , 2016 ; Higgins et al. , 2016 ) , where there exist comparatively clear independent factors of variation such as size , position , color , and orientation , which have physical grounding and can be formalized in terms of actions of symmetry subgroups ( Higgins et al. , 2018 ) . A challenge in learning disentangled representations of text is that it is more ambiguous what factors of variation should admit invariance . Still , we may hope to disentangle particular properties for certain applications ( e.g. , sentiment , or perhaps protected demographic information ( Elazar & Goldberg , 2018 ) ) , and there are also general properties of language that we might hope to disentangle , e.g. , syntax and semantics ( Chen et al. , 2019 ) . In this paper we ask whether complementary factors of variation might already be captured by pretrained models , and whether it is possible to uncover these by identifying appropriate “ subnetworks ” . The intuition for this hypothesis is that generalization across a sufficiently large and diverse training set may implicitly necessitate representations that admit some notion of invariance , as the many factors of variation in the training data give rise to a combinatorial explosion of possible inputs . Intriguing prior work ( Radford et al. , 2017 ) examining the correlation between sentiment and individual nodes within pretrained networks offers some additional support for this intuition . To test this hypothesis , we propose to use masking as a mechanism to isolate representations of individual factors . Recent work on lottery tickets ( Frankle & Carbin , 2018 ) suggest that overparameterized networks are redundant , in that a network reduced to a small subset of weights set to “ winning ” initial values can achieve predictive performance similar to the full network . Building on this intuition , we hypothesize that it might be possible to uncover a representation for a factor of interest by starting with a pretrained representation and simply masking out weights or hidden units that correlate with other factors of variation . We use BERT ( Devlin et al. , 2018 ) as an archetypal pretrained transformer to test two variants of this basic idea . In the first variant we learn binary masks for all weight matrices in the model ; in the second we derive masks for all hidden units ( intermediate representations ) . To learn these masks we minimize a triplet loss that encourages the resultant representations for instances that are similar with respect to an aspect of interest to be relatively near to one another , independent of other factors . Our approach of uncovering existing subnetworks within pretrained models that yield disentangled representations differs substantially from prior work on disentangling representations in NLP , which have either relied on adversarial debiasing approaches ( Elazar & Goldberg , 2018 ; Barrett et al. , 2019 ) or variational auto-encoders ( Chen et al. , 2019 ; Esmaeili et al. , 2019 ) . We evaluate masking in the context of two tasks . The first is a setting in which we aim to disentangle a representation of features for a target task from that of information encoding a secondary , non-target attribute ( e.g. , this might be sensitive information , or simply an unrelated factor ) . In the second we follow prior work in attempting to induce representations of semantics and syntax , respectively . In both settings , our surprising finding is that masking alone often outperforms previously proposed approaches ( which learn or finetune networks in their entirety ) . While a small amount of masking generally suffices to achieve disentanglement , we can further increase sparsity by combining masking with weight pruning . The main contributions of this paper are as follows . ( 1 ) We propose a novel method of disentangling representations in NLP : Masking weights or hidden units within pretrained transformers ( here , BERT ) . ( 2 ) We empirically demonstrate that we are indeed able to identify sub-networks within pretrained transformers that yield disentangled representations that outperform existing approaches ( which finetune all model weights ) . ( 3 ) We show that masking can be combined with weight-pruning techniques to learn sparse subnetworks for each factor of interest . 2 METHODS . We are interested in learning a disentangled representation that maps inputs x ( text ) onto vectors z ( a ) and z ( b ) that encode two distinct factors of variation . To do so , we will learn two sets of masks M ( a ) and M ( b ) that can be applied to either the weights or the intermediate representations in a pretrained model ( in our case , BERT ) . We estimate only the mask parameters and do not finetune the weights of the pretrained model . To learn the masks M ( a ) and M ( b ) , we assume access to triplets ( x0 , x1 , x2 ) in which x0 and x1 are similar with respect to aspect a but dissimilar with respect to aspect b , whereas x0 and x2 are similar with respect to aspect b but dissimilar with respect to aspect a . In some of our experiments ( i.e. , when disentangling the sentiment from the genre in movie reviews ) we further assume that we have access to class labels y ( a ) ∈ { 0 , 1 } and y ( b ) ∈ { 0 , 1 } for the aspects of interest . 2.1 MASKING WEIGHTS AND HIDDEN ACTIVATIONS . Figure 1 illustrates the two forms of masking that we consider in our approach . We depict a single linear layer of the model , h = ( h ( a ) , h ( b ) ) are the input activations , W are the weights in the pretrained model,1 and h′ = ( h′ ( a ) , h′ ( b ) ) are the output activations . We augment each layer of the original network with two masks M = ( M ( a ) , M ( b ) ) , applied in two ways : 1 . Masking Weights When training BERT with masked weights , masks M ( a ) and M ( b ) have the same shape as weights W , and output activations are computed using the masked tensor of weights h′ = h · ( W ◦M ) . ( 1 ) 2 . Masking Hidden Activations When training BERT with masked hidden units , the masksM ( a ) and M ( b ) have the same shape as the intermediate ( hidden ) activations h ( a ) and h ( b ) . Output activations are computed by applying the original weights W to masked inputs h′ = ( h ◦M ) ·W . ( 2 ) In both methods , we follow Zhao et al . ( 2020 ) and only mask the last several layers of BERT , leaving the bottom layers ( including the embedding layer ) unchanged . In practice we find masking the last 9 layers to work the best . 2.2 TRIPLET LOSS . To learn the masks , we assume that we have access to supervision in the form of triplets , as introduced above . Passing ( x0 , x1 , x2 ) through our model yields two representations of each instance : ( z ( a ) 0 , z ( b ) 0 ) , ( z ( a ) 1 , z ( b ) 1 ) , ( z ( a ) 2 , z ( b ) 2 ) , for which we define the loss L ( a ) triplet = max ( ‖z ( a ) 0 − z ( a ) 1 ‖ − ‖z ( a ) 0 − z ( a ) 2 ‖+ , 0 ) , ( 3 ) L ( b ) triplet = max ( ‖z ( b ) 0 − z ( b ) 2 ‖ − ‖z ( b ) 0 − z ( b ) 1 ‖+ , 0 ) , ( 4 ) Ltriplet = 1 2 ( L ( a ) triplet + L ( b ) triplet ) . ( 5 ) Here is a hyperparameter specifying a margin for the loss , which we set to = 2 in all experiments . 2.3 SUPERVISED LOSS . In some settings we may have access to more direct forms of supervision . For example , when learning representations for the genre and sentiment in a movie review , we have access to class 1We omit the bias term in the linear layer , for which no masking is performed . labels y ( a ) and y ( b ) for each aspect . To make full use of such supervision when available , we add two linear classification layers C ( a ) and C ( b ) to our model and compute the classification losses L ( a ) cls = CrossEntropy ( C ( a ) ( z ( a ) ) , y ( a ) ) , L ( b ) cls = CrossEntropy ( C ( b ) ( z ( b ) ) , y ( b ) ) , ( 6 ) Lcls = 1 2 ( L ( a ) cls + L ( b ) cls ) . ( 7 ) | This paper proposes a masking strategy to identify subnetworks within language models responsible for predicting different text features. This approach requires no fine-tuning of model parameters and still achieves better results compared to previous approaches. Their experimental results on the movie domain show some level of disentanglement is achieved between sentiment and genre. Disentanglement capabilities of their model between sentence semantics and structure, are also tested on four tasks. | SP:2cfbc8524de28aae401ef94e47d242b3997c07c1 |
Disentangling Representations of Text by Masking Transformers | 1 INTRODUCTION AND MOTIVATION . Large-scale pretrained models such as ELMo ( Peters et al. , 2018 ) , BERT ( Devlin et al. , 2018 ) , and XLNet ( Yang et al. , 2019 ) have come to dominate in modern natural language processing ( NLP ) . Such models rely on self-supervision over large datasets to learn general-purpose representations of text that achieve competitive predictive performance across a spectrum of downstream tasks ( Liu et al. , 2019 ) . A downside of such learned representations is that it is not obvious what information they are encoding , which hinders model robustness and interpretability . The opacity of representations produced by models such as BERT has motivated a line of NLP research on designing probing tasks as a means of uncovering what properties of input texts are encoded into token- and sentencelevel representations ( Rogers et al. , 2020 ; Linzen et al. , 2019 ; Tenney et al. , 2019 ) . In this paper we investigate whether we can uncover disentangled representations from pretrained models . That is , rather than mapping inputs onto a single vector that captures arbitrary combinations of features , our aim is to extract a representation that factorizes into distinct , complementary properties of the input . An advantage of explicitly factorizing representations is that it aids interpretability , in the sense that it becomes more straightforward to determine what factors of variation inform predictions in downstream tasks . Further , disentangled representations may facilitate increased robustness under distributional shifts by capturing a notion of invariance : If syntactic changes in a sentence do not affect the representation of semantic features , and vice versa , then we can hope to learn models that are less sensitive to any incidental correlations between these factors . A general motivation for learning disentangled representations is to try and minimize — or at least expose — model reliance on spurious correlations , i.e. , relationships between ( potentially sensitive ) attributes and labels that exist in the training data but which are not casually linked ( Kaushik et al. , 2020 ) . This is particularly relevant in the context of large pretrained models like BERT , as we do not know what the representations produced by such models encode . To date , most research on disentangled representations has focused on applications in computer vision ( Locatello et al. , 2019b ; Kulkarni et al. , 2015 ; Chen et al. , 2016 ; Higgins et al. , 2016 ) , where there exist comparatively clear independent factors of variation such as size , position , color , and orientation , which have physical grounding and can be formalized in terms of actions of symmetry subgroups ( Higgins et al. , 2018 ) . A challenge in learning disentangled representations of text is that it is more ambiguous what factors of variation should admit invariance . Still , we may hope to disentangle particular properties for certain applications ( e.g. , sentiment , or perhaps protected demographic information ( Elazar & Goldberg , 2018 ) ) , and there are also general properties of language that we might hope to disentangle , e.g. , syntax and semantics ( Chen et al. , 2019 ) . In this paper we ask whether complementary factors of variation might already be captured by pretrained models , and whether it is possible to uncover these by identifying appropriate “ subnetworks ” . The intuition for this hypothesis is that generalization across a sufficiently large and diverse training set may implicitly necessitate representations that admit some notion of invariance , as the many factors of variation in the training data give rise to a combinatorial explosion of possible inputs . Intriguing prior work ( Radford et al. , 2017 ) examining the correlation between sentiment and individual nodes within pretrained networks offers some additional support for this intuition . To test this hypothesis , we propose to use masking as a mechanism to isolate representations of individual factors . Recent work on lottery tickets ( Frankle & Carbin , 2018 ) suggest that overparameterized networks are redundant , in that a network reduced to a small subset of weights set to “ winning ” initial values can achieve predictive performance similar to the full network . Building on this intuition , we hypothesize that it might be possible to uncover a representation for a factor of interest by starting with a pretrained representation and simply masking out weights or hidden units that correlate with other factors of variation . We use BERT ( Devlin et al. , 2018 ) as an archetypal pretrained transformer to test two variants of this basic idea . In the first variant we learn binary masks for all weight matrices in the model ; in the second we derive masks for all hidden units ( intermediate representations ) . To learn these masks we minimize a triplet loss that encourages the resultant representations for instances that are similar with respect to an aspect of interest to be relatively near to one another , independent of other factors . Our approach of uncovering existing subnetworks within pretrained models that yield disentangled representations differs substantially from prior work on disentangling representations in NLP , which have either relied on adversarial debiasing approaches ( Elazar & Goldberg , 2018 ; Barrett et al. , 2019 ) or variational auto-encoders ( Chen et al. , 2019 ; Esmaeili et al. , 2019 ) . We evaluate masking in the context of two tasks . The first is a setting in which we aim to disentangle a representation of features for a target task from that of information encoding a secondary , non-target attribute ( e.g. , this might be sensitive information , or simply an unrelated factor ) . In the second we follow prior work in attempting to induce representations of semantics and syntax , respectively . In both settings , our surprising finding is that masking alone often outperforms previously proposed approaches ( which learn or finetune networks in their entirety ) . While a small amount of masking generally suffices to achieve disentanglement , we can further increase sparsity by combining masking with weight pruning . The main contributions of this paper are as follows . ( 1 ) We propose a novel method of disentangling representations in NLP : Masking weights or hidden units within pretrained transformers ( here , BERT ) . ( 2 ) We empirically demonstrate that we are indeed able to identify sub-networks within pretrained transformers that yield disentangled representations that outperform existing approaches ( which finetune all model weights ) . ( 3 ) We show that masking can be combined with weight-pruning techniques to learn sparse subnetworks for each factor of interest . 2 METHODS . We are interested in learning a disentangled representation that maps inputs x ( text ) onto vectors z ( a ) and z ( b ) that encode two distinct factors of variation . To do so , we will learn two sets of masks M ( a ) and M ( b ) that can be applied to either the weights or the intermediate representations in a pretrained model ( in our case , BERT ) . We estimate only the mask parameters and do not finetune the weights of the pretrained model . To learn the masks M ( a ) and M ( b ) , we assume access to triplets ( x0 , x1 , x2 ) in which x0 and x1 are similar with respect to aspect a but dissimilar with respect to aspect b , whereas x0 and x2 are similar with respect to aspect b but dissimilar with respect to aspect a . In some of our experiments ( i.e. , when disentangling the sentiment from the genre in movie reviews ) we further assume that we have access to class labels y ( a ) ∈ { 0 , 1 } and y ( b ) ∈ { 0 , 1 } for the aspects of interest . 2.1 MASKING WEIGHTS AND HIDDEN ACTIVATIONS . Figure 1 illustrates the two forms of masking that we consider in our approach . We depict a single linear layer of the model , h = ( h ( a ) , h ( b ) ) are the input activations , W are the weights in the pretrained model,1 and h′ = ( h′ ( a ) , h′ ( b ) ) are the output activations . We augment each layer of the original network with two masks M = ( M ( a ) , M ( b ) ) , applied in two ways : 1 . Masking Weights When training BERT with masked weights , masks M ( a ) and M ( b ) have the same shape as weights W , and output activations are computed using the masked tensor of weights h′ = h · ( W ◦M ) . ( 1 ) 2 . Masking Hidden Activations When training BERT with masked hidden units , the masksM ( a ) and M ( b ) have the same shape as the intermediate ( hidden ) activations h ( a ) and h ( b ) . Output activations are computed by applying the original weights W to masked inputs h′ = ( h ◦M ) ·W . ( 2 ) In both methods , we follow Zhao et al . ( 2020 ) and only mask the last several layers of BERT , leaving the bottom layers ( including the embedding layer ) unchanged . In practice we find masking the last 9 layers to work the best . 2.2 TRIPLET LOSS . To learn the masks , we assume that we have access to supervision in the form of triplets , as introduced above . Passing ( x0 , x1 , x2 ) through our model yields two representations of each instance : ( z ( a ) 0 , z ( b ) 0 ) , ( z ( a ) 1 , z ( b ) 1 ) , ( z ( a ) 2 , z ( b ) 2 ) , for which we define the loss L ( a ) triplet = max ( ‖z ( a ) 0 − z ( a ) 1 ‖ − ‖z ( a ) 0 − z ( a ) 2 ‖+ , 0 ) , ( 3 ) L ( b ) triplet = max ( ‖z ( b ) 0 − z ( b ) 2 ‖ − ‖z ( b ) 0 − z ( b ) 1 ‖+ , 0 ) , ( 4 ) Ltriplet = 1 2 ( L ( a ) triplet + L ( b ) triplet ) . ( 5 ) Here is a hyperparameter specifying a margin for the loss , which we set to = 2 in all experiments . 2.3 SUPERVISED LOSS . In some settings we may have access to more direct forms of supervision . For example , when learning representations for the genre and sentiment in a movie review , we have access to class 1We omit the bias term in the linear layer , for which no masking is performed . labels y ( a ) and y ( b ) for each aspect . To make full use of such supervision when available , we add two linear classification layers C ( a ) and C ( b ) to our model and compute the classification losses L ( a ) cls = CrossEntropy ( C ( a ) ( z ( a ) ) , y ( a ) ) , L ( b ) cls = CrossEntropy ( C ( b ) ( z ( b ) ) , y ( b ) ) , ( 6 ) Lcls = 1 2 ( L ( a ) cls + L ( b ) cls ) . ( 7 ) | The paper presents a way to learn disentangled representations with respect to target attributes of interest by learning to mask weights or activations. A particular piece of text is encoded into distinct vectors that capture different factors of variation in the data. The method involves learning masks for each factor of variation while keeping the pre-trained model parameters fixed. The masks for every layer are trained using a combination of a triplet-loss, attribute classification loss, and one that encourages masks for different factors to be different across all layers. The triplet loss forces representations of examples that are similar with respect to a particular attribute to be closer than one that are similar based on another attribute. | SP:2cfbc8524de28aae401ef94e47d242b3997c07c1 |
Disentangling Representations of Text by Masking Transformers | 1 INTRODUCTION AND MOTIVATION . Large-scale pretrained models such as ELMo ( Peters et al. , 2018 ) , BERT ( Devlin et al. , 2018 ) , and XLNet ( Yang et al. , 2019 ) have come to dominate in modern natural language processing ( NLP ) . Such models rely on self-supervision over large datasets to learn general-purpose representations of text that achieve competitive predictive performance across a spectrum of downstream tasks ( Liu et al. , 2019 ) . A downside of such learned representations is that it is not obvious what information they are encoding , which hinders model robustness and interpretability . The opacity of representations produced by models such as BERT has motivated a line of NLP research on designing probing tasks as a means of uncovering what properties of input texts are encoded into token- and sentencelevel representations ( Rogers et al. , 2020 ; Linzen et al. , 2019 ; Tenney et al. , 2019 ) . In this paper we investigate whether we can uncover disentangled representations from pretrained models . That is , rather than mapping inputs onto a single vector that captures arbitrary combinations of features , our aim is to extract a representation that factorizes into distinct , complementary properties of the input . An advantage of explicitly factorizing representations is that it aids interpretability , in the sense that it becomes more straightforward to determine what factors of variation inform predictions in downstream tasks . Further , disentangled representations may facilitate increased robustness under distributional shifts by capturing a notion of invariance : If syntactic changes in a sentence do not affect the representation of semantic features , and vice versa , then we can hope to learn models that are less sensitive to any incidental correlations between these factors . A general motivation for learning disentangled representations is to try and minimize — or at least expose — model reliance on spurious correlations , i.e. , relationships between ( potentially sensitive ) attributes and labels that exist in the training data but which are not casually linked ( Kaushik et al. , 2020 ) . This is particularly relevant in the context of large pretrained models like BERT , as we do not know what the representations produced by such models encode . To date , most research on disentangled representations has focused on applications in computer vision ( Locatello et al. , 2019b ; Kulkarni et al. , 2015 ; Chen et al. , 2016 ; Higgins et al. , 2016 ) , where there exist comparatively clear independent factors of variation such as size , position , color , and orientation , which have physical grounding and can be formalized in terms of actions of symmetry subgroups ( Higgins et al. , 2018 ) . A challenge in learning disentangled representations of text is that it is more ambiguous what factors of variation should admit invariance . Still , we may hope to disentangle particular properties for certain applications ( e.g. , sentiment , or perhaps protected demographic information ( Elazar & Goldberg , 2018 ) ) , and there are also general properties of language that we might hope to disentangle , e.g. , syntax and semantics ( Chen et al. , 2019 ) . In this paper we ask whether complementary factors of variation might already be captured by pretrained models , and whether it is possible to uncover these by identifying appropriate “ subnetworks ” . The intuition for this hypothesis is that generalization across a sufficiently large and diverse training set may implicitly necessitate representations that admit some notion of invariance , as the many factors of variation in the training data give rise to a combinatorial explosion of possible inputs . Intriguing prior work ( Radford et al. , 2017 ) examining the correlation between sentiment and individual nodes within pretrained networks offers some additional support for this intuition . To test this hypothesis , we propose to use masking as a mechanism to isolate representations of individual factors . Recent work on lottery tickets ( Frankle & Carbin , 2018 ) suggest that overparameterized networks are redundant , in that a network reduced to a small subset of weights set to “ winning ” initial values can achieve predictive performance similar to the full network . Building on this intuition , we hypothesize that it might be possible to uncover a representation for a factor of interest by starting with a pretrained representation and simply masking out weights or hidden units that correlate with other factors of variation . We use BERT ( Devlin et al. , 2018 ) as an archetypal pretrained transformer to test two variants of this basic idea . In the first variant we learn binary masks for all weight matrices in the model ; in the second we derive masks for all hidden units ( intermediate representations ) . To learn these masks we minimize a triplet loss that encourages the resultant representations for instances that are similar with respect to an aspect of interest to be relatively near to one another , independent of other factors . Our approach of uncovering existing subnetworks within pretrained models that yield disentangled representations differs substantially from prior work on disentangling representations in NLP , which have either relied on adversarial debiasing approaches ( Elazar & Goldberg , 2018 ; Barrett et al. , 2019 ) or variational auto-encoders ( Chen et al. , 2019 ; Esmaeili et al. , 2019 ) . We evaluate masking in the context of two tasks . The first is a setting in which we aim to disentangle a representation of features for a target task from that of information encoding a secondary , non-target attribute ( e.g. , this might be sensitive information , or simply an unrelated factor ) . In the second we follow prior work in attempting to induce representations of semantics and syntax , respectively . In both settings , our surprising finding is that masking alone often outperforms previously proposed approaches ( which learn or finetune networks in their entirety ) . While a small amount of masking generally suffices to achieve disentanglement , we can further increase sparsity by combining masking with weight pruning . The main contributions of this paper are as follows . ( 1 ) We propose a novel method of disentangling representations in NLP : Masking weights or hidden units within pretrained transformers ( here , BERT ) . ( 2 ) We empirically demonstrate that we are indeed able to identify sub-networks within pretrained transformers that yield disentangled representations that outperform existing approaches ( which finetune all model weights ) . ( 3 ) We show that masking can be combined with weight-pruning techniques to learn sparse subnetworks for each factor of interest . 2 METHODS . We are interested in learning a disentangled representation that maps inputs x ( text ) onto vectors z ( a ) and z ( b ) that encode two distinct factors of variation . To do so , we will learn two sets of masks M ( a ) and M ( b ) that can be applied to either the weights or the intermediate representations in a pretrained model ( in our case , BERT ) . We estimate only the mask parameters and do not finetune the weights of the pretrained model . To learn the masks M ( a ) and M ( b ) , we assume access to triplets ( x0 , x1 , x2 ) in which x0 and x1 are similar with respect to aspect a but dissimilar with respect to aspect b , whereas x0 and x2 are similar with respect to aspect b but dissimilar with respect to aspect a . In some of our experiments ( i.e. , when disentangling the sentiment from the genre in movie reviews ) we further assume that we have access to class labels y ( a ) ∈ { 0 , 1 } and y ( b ) ∈ { 0 , 1 } for the aspects of interest . 2.1 MASKING WEIGHTS AND HIDDEN ACTIVATIONS . Figure 1 illustrates the two forms of masking that we consider in our approach . We depict a single linear layer of the model , h = ( h ( a ) , h ( b ) ) are the input activations , W are the weights in the pretrained model,1 and h′ = ( h′ ( a ) , h′ ( b ) ) are the output activations . We augment each layer of the original network with two masks M = ( M ( a ) , M ( b ) ) , applied in two ways : 1 . Masking Weights When training BERT with masked weights , masks M ( a ) and M ( b ) have the same shape as weights W , and output activations are computed using the masked tensor of weights h′ = h · ( W ◦M ) . ( 1 ) 2 . Masking Hidden Activations When training BERT with masked hidden units , the masksM ( a ) and M ( b ) have the same shape as the intermediate ( hidden ) activations h ( a ) and h ( b ) . Output activations are computed by applying the original weights W to masked inputs h′ = ( h ◦M ) ·W . ( 2 ) In both methods , we follow Zhao et al . ( 2020 ) and only mask the last several layers of BERT , leaving the bottom layers ( including the embedding layer ) unchanged . In practice we find masking the last 9 layers to work the best . 2.2 TRIPLET LOSS . To learn the masks , we assume that we have access to supervision in the form of triplets , as introduced above . Passing ( x0 , x1 , x2 ) through our model yields two representations of each instance : ( z ( a ) 0 , z ( b ) 0 ) , ( z ( a ) 1 , z ( b ) 1 ) , ( z ( a ) 2 , z ( b ) 2 ) , for which we define the loss L ( a ) triplet = max ( ‖z ( a ) 0 − z ( a ) 1 ‖ − ‖z ( a ) 0 − z ( a ) 2 ‖+ , 0 ) , ( 3 ) L ( b ) triplet = max ( ‖z ( b ) 0 − z ( b ) 2 ‖ − ‖z ( b ) 0 − z ( b ) 1 ‖+ , 0 ) , ( 4 ) Ltriplet = 1 2 ( L ( a ) triplet + L ( b ) triplet ) . ( 5 ) Here is a hyperparameter specifying a margin for the loss , which we set to = 2 in all experiments . 2.3 SUPERVISED LOSS . In some settings we may have access to more direct forms of supervision . For example , when learning representations for the genre and sentiment in a movie review , we have access to class 1We omit the bias term in the linear layer , for which no masking is performed . labels y ( a ) and y ( b ) for each aspect . To make full use of such supervision when available , we add two linear classification layers C ( a ) and C ( b ) to our model and compute the classification losses L ( a ) cls = CrossEntropy ( C ( a ) ( z ( a ) ) , y ( a ) ) , L ( b ) cls = CrossEntropy ( C ( b ) ( z ( b ) ) , y ( b ) ) , ( 6 ) Lcls = 1 2 ( L ( a ) cls + L ( b ) cls ) . ( 7 ) | The paper proposes a procedure to extract disentangled representations from pretrained BERT models. In particular, the paper proposes learning binary masks over BERT weights (or, as an alternative, over BERT activations) such that the resulting representations correspond to the desired aspect representations. The model requires additional supervision (binary labels or example triplets) and training (for the masks but not the BERT weights). The experiments aim to perform disentangling to ensure that (1) the learned representation does not “leak” a potentially sensitive attribute, and (2) the downstream classifier’s performance is good across all subgroups formed by the attributes. The experiments show that the proposed method outperforms baselines such as unmasked BERT, unmasked-but-finetuned BERT, and unmasked-but-adversarially-finetuned BERT. | SP:2cfbc8524de28aae401ef94e47d242b3997c07c1 |
Contextual Transformation Networks for Online Continual Learning | Continual learning methods with fixed architectures rely on a single network to learn models that can perform well on all tasks . As a result , they often only accommodate common features of those tasks but neglect each task ’ s specific features . On the other hand , dynamic architecture methods can have a separate network for each task , but they are too expensive to train and not scalable in practice , especially in online settings . To address this problem , we propose a novel online continual learning method named “ Contextual Transformation Networks ” ( CTN ) to efficiently model the task-specific features while enjoying neglectable complexity overhead compared to other fixed architecture methods . Moreover , inspired by the Complementary Learning Systems ( CLS ) theory , we propose a novel dual memory design and an objective to train CTN that can address both catastrophic forgetting and knowledge transfer simultaneously . Our extensive experiments show that CTN is competitive with a large scale dynamic architecture network and consistently outperforms other fixed architecture methods under the same standard backbone . Our implementation can be found at https : //github . com/phquang/Contextual-Transformation-Network . 1 INTRODUCTION . Continual learning is a promising framework towards building AI models that can learn continuously through time , acquire new knowledge while being able to perform its already learned skills ( French , 1999 ; 1992 ; Parisi et al. , 2019 ; Ring , 1997 ) . On top of that , online continual learning is particularly interesting because it resembles the real world and the model has to quickly obtain new knowledge on the fly by levering its learned skills . This problem is important for deep neural networks because optimizing them in the online setting has been shown to be challenging ( Sahoo et al. , 2018 ; Aljundi et al. , 2019a ) . Moreover , while it is crucial to obtain new information , the model must be able to perform its acquired skills . Balancing between preventing catastrophic forgetting and facilitating knowledge transfer is imperative when learning on a stream of tasks , which is ubiquitous in realistic scenarios . Thus , in this work , we focus on the continual learning setting in an online learning fashion , where both tasks and data of each task arrive sequentially ( Lopez-Paz & Ranzato , 2017 ) . In the literature , fixed architecture methods employ a shared feature extractor and a set of classifiers , one for each task ( Lopez-Paz & Ranzato , 2017 ; Chaudhry et al. , 2019a ; b ; Aljundi et al. , 2019a ) . Although using a shared feature extractor has achieved promising results , the common and global features are rather generic and not well-tailored towards each specific task . This problem is even more severe when old data are limited while learning new tasks . As a result , the common feature extractor loses its ability to extract previous tasks ’ features , resulting in catastrophic forgetting . On the other hand , while dynamic architecture methods such as Rusu et al . ( 2016 ) ; Li et al . ( 2019 ) ; Xu & Zhu ( 2018 ) alleviate this problem by having a separate network for each task , they suffer from the unbounded growth of the parameters . Moreover , the subnetworks ’ design is not trivial and requires extensive resource usage ( Rusu et al. , 2016 ; Li et al. , 2019 ) , which is not practical in many applications . These limitations motivated us to develop a novel method that can facilitate continual learning with a fixed architecture by modeling the task-specific features . To achieve this goal , we first revisit a popular result in learning multiple tasks that each task ’ s features are centered around a common vector ( Evgeniou & Pontil , 2004 ; Aytar & Zisserman , 2011 ; Pentina & Lampert , 2014 ; Liu et al. , 2019b ) . This result motivates us to develop a novel framework of Contextual Transformation Networks ( CTN ) , which consists of a base network that learns the common features of a given input and a controller that efficiently transforms the common features to become task-specific , given a task identifier . While one can train CTN using experience replay , it does not explicitly aim at achieving a good trade-off between stability and plasticity . Therefore , we propose a novel dual memory system and a learning method that encapsulate alleviating forgetting and facilitating knowledge transfer simultaneously . Particularly , we propose two distinct memories : the episodic memory and the semantic memory associated with the base model and the controller , respectively . Then , the base model is trained by experience replay on the episodic memory while the controllers is trained to learn task-specific features that can generalize to the semantic memory . As a result , CTN achieves a good trade-off between preventing catastrophic forgetting and facilitating knowledge transfer because the task-specific features can generalize well to all past and current tasks . Figure 1 gives an overview of the proposed Contextual Transformation Network ( CTN ) . Interestingly , the designs of our CTN and dual memory are partially related to the Complementary Learning Systems ( CLS ) theory in neuroscience ( McClelland et al. , 1995 ; Kumaran et al. , 2016 ) . Particularly , the controller acts as a neocortex that learns the structured knowledge of each task . In contrast , the base model acts as a hippocampus that performs rapid learning to acquire new information from the current task ’ s training data . Following the naming convention of memory in neuroscience , our CTN is equipped with two replay memory types . ( i ) the episodic memory ( associated with the hippocampus ) caches a small amount of past tasks ’ training data , which will be replayed when training the base networks . ( ii ) the semantic memory ( associated with the neocortex ) stores another distinct set of old data only used to train the controller such that the task-specific features can generalize well across tasks . Moreover , the CLS theory also suggests that the interplay between the neocortex and the hippocampus attributes to the ability to recall knowledge and generalize to novel experiences ( Kumaran & McClelland , 2012 ) . Our proposed learning approach closely characterizes such properties : the base model focuses on acquiring new knowledge from the current task while the controller uses the base model ’ s knowledge to generalize to novel samples . In summary , our work makes the following contributions . First , we propose CTN , a novel continual learning method that can model task-specific features while enjoying neglectable complexity overhead compared to fixed architecture methods ( please refer to Table 4 ) . Second , we propose a novel objective that can improve the trade-off between alleviating forgetting and facilitating knowledge transfer to train CTN . Third , we conduct extensive experiments on continual learning benchmarks to demonstrate the efficacy of CTN compared to a suite of baselines . Finally , we provide a comprehensive analysis to investigate the complementarity of each CTN ’ s component . 2 METHOD . Notations . We denote φ as parameter of the base model that extracts global features from the input and θ as the parameter of the controller which modifies the features from φ given a task identifier t. The task identifier can be a set of semantic attributes about objects of that task ( Lampert et al. , 2009 ) or simply an index of the task , which we use in this work as a one-hot vector . A prediction is given as gϕt ( hφ , θ ( x , t ) ) , where gϕt ( · ) is the task Tt ’ s classifier with parameter ϕt such as a fully connected layer with softmax activation . And hφ , θ ( x , t ) is the final feature after transformed by the controller . We denoteDtrt as the training data of task Tt , Memt andMsmt as the episodic memory and the semantic memory of task Tt respectively . The episodic memory and semantic memory maintains two distinct sets of data obtained from task Tt . The episodic memory of task T1 , . . . , Tt−1 is denoted asMem < t ; similarly , Msm < t denotes the semantic memory of the first t− 1 tasks . Remark . Both theMemt andMsmt are obtained from Dtrt through the learner ’ s internal memory management strategy and contains distinct samples from each other such that their combined sizes do not exceed a pre-defined budget . 2.1 LEARNING TASK-SPECIFIC FEATURES FOR CONTINUAL LEARNING . Given a backbone network , one can implement the task-specific features by employing a set of task-specific filters and applying them to the backbone ’ s output . However , this trivial approach is not scalable , even for small networks . In the worst case , it results in storing an additional network per task , which violates the fixed architecture constraint . Since we want to obtain task-specific features with minimal parameter overhead , we propose to use a feature-wise transformation ( Perez et al. , 2018 ) to efficiently extract the task-specific features h̃ ( x , t ) from the common features ĥ ( x ) as follows : h̃ ( x ; t ) = γt ‖γt‖2 ⊗ ĥ ( x ) + βt ‖βt‖2 and { γt , βt } = cθ ( t ) , ( 1 ) where ⊗ denotes the element-wise multiplication operator , and cθ ( t ) is the controller implemented as a linear layer with parameter θ that predicts the transformation coefficients { γt , βt } given the task identifier t. Since the task identifiers are one-hot vectors , which are sparse and make training the controller difficult , we also introduce an embedding layer to map the task identifiers to dense , low dimensional vectors . For simplicity , we will use θ to refer to both the embedding and the linear layer parameters . In addition , instead of storing a set of coefficients { γt , βt } for each task , we only need a fixed set of parameter θ to predict these coefficients , which results in the fixed parameters in the controller . The coefficients { γt , βt } are ` 2-normalized and then transforms the common features ĥ ( x , t ) to become task-specific features h̃ ( x ; t ) . Finally , both feature types are combined by a residual connection before passing to the corresponding classifier gt ( · ) to make the final prediction : gϕt ( σ ( h ( x , t ) ) ) , and h ( x , t ) = ĥ ( x , t ) + h̃ ( x , t ) , ( 2 ) where σ ( · ) is a nonlinear activation function such as ReLU . Importantly , when the task-specific features are removed , i.e. , h̃ ( x , t ) = 0 , Eq . 2 reduces to the traditional experience replay . Lastly , for each incoming task , CTN has to allocate a new classifier , which is the same for all continual learning methods , and a new embedding vector , which is usually low dimensional , e.g . 32 or 64 . Therefore , CTN enjoys almost the same parameter growth as existing continual learning methods . 2.2 TRAINING THE CONTROLLER . While one can train CTN with experience replay ( ER ) , it does not explicitly address the trade-off between facilitating knowledge transfer and alleviating catastrophic forgetting . This motivates us to develop a novel training method that can simultaneously address both problems by leveraging the controller ’ s task-specific features . First , we introduce a dual memory system consisting of the semantic memoryMsmt associated with the controller and the episodic memoryMemt associated with the base model . We propose to train only the base model using experience replay with the episodic memory to obtain new knowledge from incoming tasks . The controller is also trained so that the task-specific features can generalize to unseen samples to the base model stored in the semantic memory . As a result , the task-specific features can generalize to both previous and current tasks , which simultaneously encapsulate both alleviating forgetting and facilitating knowledge transfer . Formally , given the current batch of data for task Tt as Bt , the training of CTN can be formulated as the following bilevel optimization problem ( Colson et al. , 2007 ) : Outer problem : minθ Lctrl ( { φ∗ , θ } ; Msm < t+1 ) Inner problem : s.t φ∗ = arg min φ Ltr ( { φ , θ } , Bt ∪Mem < t ) , ( 3 ) where φ∗ denotes the optimal base model corresponding to the current controller θ . Since every CTN ’ s prediction always involves both the controller and the base model , we use Ltr ( { φ , θ } , Bt ∪Mem < t ) to denote the training loss of the pair { φ , θ } on the data Bt ∪Mem < t . Similarly , Lctrl ( · ) denotes the controller ’ s loss . For simplicity , we omitted the dependency of the the loss on the classifiers ’ parameters and imply that the classifiers are jointly updated with the base model . Since we do not know the optimal transformation coefficients of any task , the controller is trained to minimize the classification loss of the samples via φ . We implement both the training and controller ’ s losses as the cross-entropy loss . Notably , Eq . 3 characterizes two nested optimization problems : the outer problem , which trains the controller to generalize , and each controller parameter θ parameterizes an inner problem that trains the base model to acquire new knowledge via experience replay . Moreover , only φ is trained in the inner problem , while only θ is updated in the outer problem . The bilevel optimization objective such as Eq . 3 has been successfully applied in other machine learning disciplines such as hyperparameter optimization , meta learning ( Franceschi et al. , 2018 ; Finn et al. , 2017 ) , and AutoML ( Liu et al. , 2019a ) . In this work , we extend this framework to continual learning to train the controller . However , unlike existing works ( Franceschi et al. , 2018 ; Finn et al. , 2017 ; Liu et al. , 2019a ) , our Eq . 3 has to be solved incrementally when a new data sample arrives . Therefore , we consider Eq . 3 as an online learning problem and optimize it using the follow the leader principle ( Hannan , 1957 ) . Particularly , we relax the optimal solutions of both the inner and outer problems to be solutions from a few gradient steps . When a new training data arrives , we first train the base model φ using experience replay for a few SGD steps with an inner learning rate α , each of which is implemented as : φ← φ− α∇φLtr ( { φ , θ } , Bt ∪Mem < t ) , ( 4 ) Then , we optimize the controller θ such that it can improve φ ’ s performance on the semantic memory : θ ← θ − β∇θLctrl ( { φ , θ } , Msm < t+1 ) , ( 5 ) where β is the outer learning rate . As a result , Eq . 3 is implemented as an alternative update procedure involving several outer updates to train θ , each of which includes an inner update to trainφ . Moreover , performing several updates per incoming sample does not violate the online assumption since we will not revisit that sample in the future , unless it is stored in the memories . | This paper introduces a continual learning method called Contextual Transformation Networks (CTNs). CTNs consist of a base network and a controller, which outputs task-specific feature modulators. Both these have independent memories used to reduce forgetting. Additionally, the base network has an additional regularisation term. These two networks are trained together (formulated as a bi-level optimisation problem). Experiments on many different benchmarks are provided, with CTNs outperforming competing baselines on different metrics, often by large amounts. Some good additional experiments are also provided (different memory sizes, smaller datasets, ablations of the three major parts of CTNs). | SP:f39013d44b9908838bbd3d71564dac2ed4b55564 |
Contextual Transformation Networks for Online Continual Learning | Continual learning methods with fixed architectures rely on a single network to learn models that can perform well on all tasks . As a result , they often only accommodate common features of those tasks but neglect each task ’ s specific features . On the other hand , dynamic architecture methods can have a separate network for each task , but they are too expensive to train and not scalable in practice , especially in online settings . To address this problem , we propose a novel online continual learning method named “ Contextual Transformation Networks ” ( CTN ) to efficiently model the task-specific features while enjoying neglectable complexity overhead compared to other fixed architecture methods . Moreover , inspired by the Complementary Learning Systems ( CLS ) theory , we propose a novel dual memory design and an objective to train CTN that can address both catastrophic forgetting and knowledge transfer simultaneously . Our extensive experiments show that CTN is competitive with a large scale dynamic architecture network and consistently outperforms other fixed architecture methods under the same standard backbone . Our implementation can be found at https : //github . com/phquang/Contextual-Transformation-Network . 1 INTRODUCTION . Continual learning is a promising framework towards building AI models that can learn continuously through time , acquire new knowledge while being able to perform its already learned skills ( French , 1999 ; 1992 ; Parisi et al. , 2019 ; Ring , 1997 ) . On top of that , online continual learning is particularly interesting because it resembles the real world and the model has to quickly obtain new knowledge on the fly by levering its learned skills . This problem is important for deep neural networks because optimizing them in the online setting has been shown to be challenging ( Sahoo et al. , 2018 ; Aljundi et al. , 2019a ) . Moreover , while it is crucial to obtain new information , the model must be able to perform its acquired skills . Balancing between preventing catastrophic forgetting and facilitating knowledge transfer is imperative when learning on a stream of tasks , which is ubiquitous in realistic scenarios . Thus , in this work , we focus on the continual learning setting in an online learning fashion , where both tasks and data of each task arrive sequentially ( Lopez-Paz & Ranzato , 2017 ) . In the literature , fixed architecture methods employ a shared feature extractor and a set of classifiers , one for each task ( Lopez-Paz & Ranzato , 2017 ; Chaudhry et al. , 2019a ; b ; Aljundi et al. , 2019a ) . Although using a shared feature extractor has achieved promising results , the common and global features are rather generic and not well-tailored towards each specific task . This problem is even more severe when old data are limited while learning new tasks . As a result , the common feature extractor loses its ability to extract previous tasks ’ features , resulting in catastrophic forgetting . On the other hand , while dynamic architecture methods such as Rusu et al . ( 2016 ) ; Li et al . ( 2019 ) ; Xu & Zhu ( 2018 ) alleviate this problem by having a separate network for each task , they suffer from the unbounded growth of the parameters . Moreover , the subnetworks ’ design is not trivial and requires extensive resource usage ( Rusu et al. , 2016 ; Li et al. , 2019 ) , which is not practical in many applications . These limitations motivated us to develop a novel method that can facilitate continual learning with a fixed architecture by modeling the task-specific features . To achieve this goal , we first revisit a popular result in learning multiple tasks that each task ’ s features are centered around a common vector ( Evgeniou & Pontil , 2004 ; Aytar & Zisserman , 2011 ; Pentina & Lampert , 2014 ; Liu et al. , 2019b ) . This result motivates us to develop a novel framework of Contextual Transformation Networks ( CTN ) , which consists of a base network that learns the common features of a given input and a controller that efficiently transforms the common features to become task-specific , given a task identifier . While one can train CTN using experience replay , it does not explicitly aim at achieving a good trade-off between stability and plasticity . Therefore , we propose a novel dual memory system and a learning method that encapsulate alleviating forgetting and facilitating knowledge transfer simultaneously . Particularly , we propose two distinct memories : the episodic memory and the semantic memory associated with the base model and the controller , respectively . Then , the base model is trained by experience replay on the episodic memory while the controllers is trained to learn task-specific features that can generalize to the semantic memory . As a result , CTN achieves a good trade-off between preventing catastrophic forgetting and facilitating knowledge transfer because the task-specific features can generalize well to all past and current tasks . Figure 1 gives an overview of the proposed Contextual Transformation Network ( CTN ) . Interestingly , the designs of our CTN and dual memory are partially related to the Complementary Learning Systems ( CLS ) theory in neuroscience ( McClelland et al. , 1995 ; Kumaran et al. , 2016 ) . Particularly , the controller acts as a neocortex that learns the structured knowledge of each task . In contrast , the base model acts as a hippocampus that performs rapid learning to acquire new information from the current task ’ s training data . Following the naming convention of memory in neuroscience , our CTN is equipped with two replay memory types . ( i ) the episodic memory ( associated with the hippocampus ) caches a small amount of past tasks ’ training data , which will be replayed when training the base networks . ( ii ) the semantic memory ( associated with the neocortex ) stores another distinct set of old data only used to train the controller such that the task-specific features can generalize well across tasks . Moreover , the CLS theory also suggests that the interplay between the neocortex and the hippocampus attributes to the ability to recall knowledge and generalize to novel experiences ( Kumaran & McClelland , 2012 ) . Our proposed learning approach closely characterizes such properties : the base model focuses on acquiring new knowledge from the current task while the controller uses the base model ’ s knowledge to generalize to novel samples . In summary , our work makes the following contributions . First , we propose CTN , a novel continual learning method that can model task-specific features while enjoying neglectable complexity overhead compared to fixed architecture methods ( please refer to Table 4 ) . Second , we propose a novel objective that can improve the trade-off between alleviating forgetting and facilitating knowledge transfer to train CTN . Third , we conduct extensive experiments on continual learning benchmarks to demonstrate the efficacy of CTN compared to a suite of baselines . Finally , we provide a comprehensive analysis to investigate the complementarity of each CTN ’ s component . 2 METHOD . Notations . We denote φ as parameter of the base model that extracts global features from the input and θ as the parameter of the controller which modifies the features from φ given a task identifier t. The task identifier can be a set of semantic attributes about objects of that task ( Lampert et al. , 2009 ) or simply an index of the task , which we use in this work as a one-hot vector . A prediction is given as gϕt ( hφ , θ ( x , t ) ) , where gϕt ( · ) is the task Tt ’ s classifier with parameter ϕt such as a fully connected layer with softmax activation . And hφ , θ ( x , t ) is the final feature after transformed by the controller . We denoteDtrt as the training data of task Tt , Memt andMsmt as the episodic memory and the semantic memory of task Tt respectively . The episodic memory and semantic memory maintains two distinct sets of data obtained from task Tt . The episodic memory of task T1 , . . . , Tt−1 is denoted asMem < t ; similarly , Msm < t denotes the semantic memory of the first t− 1 tasks . Remark . Both theMemt andMsmt are obtained from Dtrt through the learner ’ s internal memory management strategy and contains distinct samples from each other such that their combined sizes do not exceed a pre-defined budget . 2.1 LEARNING TASK-SPECIFIC FEATURES FOR CONTINUAL LEARNING . Given a backbone network , one can implement the task-specific features by employing a set of task-specific filters and applying them to the backbone ’ s output . However , this trivial approach is not scalable , even for small networks . In the worst case , it results in storing an additional network per task , which violates the fixed architecture constraint . Since we want to obtain task-specific features with minimal parameter overhead , we propose to use a feature-wise transformation ( Perez et al. , 2018 ) to efficiently extract the task-specific features h̃ ( x , t ) from the common features ĥ ( x ) as follows : h̃ ( x ; t ) = γt ‖γt‖2 ⊗ ĥ ( x ) + βt ‖βt‖2 and { γt , βt } = cθ ( t ) , ( 1 ) where ⊗ denotes the element-wise multiplication operator , and cθ ( t ) is the controller implemented as a linear layer with parameter θ that predicts the transformation coefficients { γt , βt } given the task identifier t. Since the task identifiers are one-hot vectors , which are sparse and make training the controller difficult , we also introduce an embedding layer to map the task identifiers to dense , low dimensional vectors . For simplicity , we will use θ to refer to both the embedding and the linear layer parameters . In addition , instead of storing a set of coefficients { γt , βt } for each task , we only need a fixed set of parameter θ to predict these coefficients , which results in the fixed parameters in the controller . The coefficients { γt , βt } are ` 2-normalized and then transforms the common features ĥ ( x , t ) to become task-specific features h̃ ( x ; t ) . Finally , both feature types are combined by a residual connection before passing to the corresponding classifier gt ( · ) to make the final prediction : gϕt ( σ ( h ( x , t ) ) ) , and h ( x , t ) = ĥ ( x , t ) + h̃ ( x , t ) , ( 2 ) where σ ( · ) is a nonlinear activation function such as ReLU . Importantly , when the task-specific features are removed , i.e. , h̃ ( x , t ) = 0 , Eq . 2 reduces to the traditional experience replay . Lastly , for each incoming task , CTN has to allocate a new classifier , which is the same for all continual learning methods , and a new embedding vector , which is usually low dimensional , e.g . 32 or 64 . Therefore , CTN enjoys almost the same parameter growth as existing continual learning methods . 2.2 TRAINING THE CONTROLLER . While one can train CTN with experience replay ( ER ) , it does not explicitly address the trade-off between facilitating knowledge transfer and alleviating catastrophic forgetting . This motivates us to develop a novel training method that can simultaneously address both problems by leveraging the controller ’ s task-specific features . First , we introduce a dual memory system consisting of the semantic memoryMsmt associated with the controller and the episodic memoryMemt associated with the base model . We propose to train only the base model using experience replay with the episodic memory to obtain new knowledge from incoming tasks . The controller is also trained so that the task-specific features can generalize to unseen samples to the base model stored in the semantic memory . As a result , the task-specific features can generalize to both previous and current tasks , which simultaneously encapsulate both alleviating forgetting and facilitating knowledge transfer . Formally , given the current batch of data for task Tt as Bt , the training of CTN can be formulated as the following bilevel optimization problem ( Colson et al. , 2007 ) : Outer problem : minθ Lctrl ( { φ∗ , θ } ; Msm < t+1 ) Inner problem : s.t φ∗ = arg min φ Ltr ( { φ , θ } , Bt ∪Mem < t ) , ( 3 ) where φ∗ denotes the optimal base model corresponding to the current controller θ . Since every CTN ’ s prediction always involves both the controller and the base model , we use Ltr ( { φ , θ } , Bt ∪Mem < t ) to denote the training loss of the pair { φ , θ } on the data Bt ∪Mem < t . Similarly , Lctrl ( · ) denotes the controller ’ s loss . For simplicity , we omitted the dependency of the the loss on the classifiers ’ parameters and imply that the classifiers are jointly updated with the base model . Since we do not know the optimal transformation coefficients of any task , the controller is trained to minimize the classification loss of the samples via φ . We implement both the training and controller ’ s losses as the cross-entropy loss . Notably , Eq . 3 characterizes two nested optimization problems : the outer problem , which trains the controller to generalize , and each controller parameter θ parameterizes an inner problem that trains the base model to acquire new knowledge via experience replay . Moreover , only φ is trained in the inner problem , while only θ is updated in the outer problem . The bilevel optimization objective such as Eq . 3 has been successfully applied in other machine learning disciplines such as hyperparameter optimization , meta learning ( Franceschi et al. , 2018 ; Finn et al. , 2017 ) , and AutoML ( Liu et al. , 2019a ) . In this work , we extend this framework to continual learning to train the controller . However , unlike existing works ( Franceschi et al. , 2018 ; Finn et al. , 2017 ; Liu et al. , 2019a ) , our Eq . 3 has to be solved incrementally when a new data sample arrives . Therefore , we consider Eq . 3 as an online learning problem and optimize it using the follow the leader principle ( Hannan , 1957 ) . Particularly , we relax the optimal solutions of both the inner and outer problems to be solutions from a few gradient steps . When a new training data arrives , we first train the base model φ using experience replay for a few SGD steps with an inner learning rate α , each of which is implemented as : φ← φ− α∇φLtr ( { φ , θ } , Bt ∪Mem < t ) , ( 4 ) Then , we optimize the controller θ such that it can improve φ ’ s performance on the semantic memory : θ ← θ − β∇θLctrl ( { φ , θ } , Msm < t+1 ) , ( 5 ) where β is the outer learning rate . As a result , Eq . 3 is implemented as an alternative update procedure involving several outer updates to train θ , each of which includes an inner update to trainφ . Moreover , performing several updates per incoming sample does not violate the online assumption since we will not revisit that sample in the future , unless it is stored in the memories . | This paper tackles online continual neural network learning (following Lopez-Paz & Ranzato, 2017) with a combination of techniques: (1) a controller (or base parameter modulator, or hypernetwork) is introduced which produces task-specific scale and shift parameters, which modulate the feature maps of a base model (Perez et al., 2017); (2) as training data set samples are only provided once, the authors maintain experience replay buffers using soft label targets (by now standard techniques in online learning); (3) a bilevel optimization scheme where controller parameters are updated in an outer loop and base parameters adapted in an inner loop is employed. Task identities are available both during learning and at test time. This information is used to pick the correct task embeddings and the correct task-specific final classifier ("head"). | SP:f39013d44b9908838bbd3d71564dac2ed4b55564 |
Contextual Transformation Networks for Online Continual Learning | Continual learning methods with fixed architectures rely on a single network to learn models that can perform well on all tasks . As a result , they often only accommodate common features of those tasks but neglect each task ’ s specific features . On the other hand , dynamic architecture methods can have a separate network for each task , but they are too expensive to train and not scalable in practice , especially in online settings . To address this problem , we propose a novel online continual learning method named “ Contextual Transformation Networks ” ( CTN ) to efficiently model the task-specific features while enjoying neglectable complexity overhead compared to other fixed architecture methods . Moreover , inspired by the Complementary Learning Systems ( CLS ) theory , we propose a novel dual memory design and an objective to train CTN that can address both catastrophic forgetting and knowledge transfer simultaneously . Our extensive experiments show that CTN is competitive with a large scale dynamic architecture network and consistently outperforms other fixed architecture methods under the same standard backbone . Our implementation can be found at https : //github . com/phquang/Contextual-Transformation-Network . 1 INTRODUCTION . Continual learning is a promising framework towards building AI models that can learn continuously through time , acquire new knowledge while being able to perform its already learned skills ( French , 1999 ; 1992 ; Parisi et al. , 2019 ; Ring , 1997 ) . On top of that , online continual learning is particularly interesting because it resembles the real world and the model has to quickly obtain new knowledge on the fly by levering its learned skills . This problem is important for deep neural networks because optimizing them in the online setting has been shown to be challenging ( Sahoo et al. , 2018 ; Aljundi et al. , 2019a ) . Moreover , while it is crucial to obtain new information , the model must be able to perform its acquired skills . Balancing between preventing catastrophic forgetting and facilitating knowledge transfer is imperative when learning on a stream of tasks , which is ubiquitous in realistic scenarios . Thus , in this work , we focus on the continual learning setting in an online learning fashion , where both tasks and data of each task arrive sequentially ( Lopez-Paz & Ranzato , 2017 ) . In the literature , fixed architecture methods employ a shared feature extractor and a set of classifiers , one for each task ( Lopez-Paz & Ranzato , 2017 ; Chaudhry et al. , 2019a ; b ; Aljundi et al. , 2019a ) . Although using a shared feature extractor has achieved promising results , the common and global features are rather generic and not well-tailored towards each specific task . This problem is even more severe when old data are limited while learning new tasks . As a result , the common feature extractor loses its ability to extract previous tasks ’ features , resulting in catastrophic forgetting . On the other hand , while dynamic architecture methods such as Rusu et al . ( 2016 ) ; Li et al . ( 2019 ) ; Xu & Zhu ( 2018 ) alleviate this problem by having a separate network for each task , they suffer from the unbounded growth of the parameters . Moreover , the subnetworks ’ design is not trivial and requires extensive resource usage ( Rusu et al. , 2016 ; Li et al. , 2019 ) , which is not practical in many applications . These limitations motivated us to develop a novel method that can facilitate continual learning with a fixed architecture by modeling the task-specific features . To achieve this goal , we first revisit a popular result in learning multiple tasks that each task ’ s features are centered around a common vector ( Evgeniou & Pontil , 2004 ; Aytar & Zisserman , 2011 ; Pentina & Lampert , 2014 ; Liu et al. , 2019b ) . This result motivates us to develop a novel framework of Contextual Transformation Networks ( CTN ) , which consists of a base network that learns the common features of a given input and a controller that efficiently transforms the common features to become task-specific , given a task identifier . While one can train CTN using experience replay , it does not explicitly aim at achieving a good trade-off between stability and plasticity . Therefore , we propose a novel dual memory system and a learning method that encapsulate alleviating forgetting and facilitating knowledge transfer simultaneously . Particularly , we propose two distinct memories : the episodic memory and the semantic memory associated with the base model and the controller , respectively . Then , the base model is trained by experience replay on the episodic memory while the controllers is trained to learn task-specific features that can generalize to the semantic memory . As a result , CTN achieves a good trade-off between preventing catastrophic forgetting and facilitating knowledge transfer because the task-specific features can generalize well to all past and current tasks . Figure 1 gives an overview of the proposed Contextual Transformation Network ( CTN ) . Interestingly , the designs of our CTN and dual memory are partially related to the Complementary Learning Systems ( CLS ) theory in neuroscience ( McClelland et al. , 1995 ; Kumaran et al. , 2016 ) . Particularly , the controller acts as a neocortex that learns the structured knowledge of each task . In contrast , the base model acts as a hippocampus that performs rapid learning to acquire new information from the current task ’ s training data . Following the naming convention of memory in neuroscience , our CTN is equipped with two replay memory types . ( i ) the episodic memory ( associated with the hippocampus ) caches a small amount of past tasks ’ training data , which will be replayed when training the base networks . ( ii ) the semantic memory ( associated with the neocortex ) stores another distinct set of old data only used to train the controller such that the task-specific features can generalize well across tasks . Moreover , the CLS theory also suggests that the interplay between the neocortex and the hippocampus attributes to the ability to recall knowledge and generalize to novel experiences ( Kumaran & McClelland , 2012 ) . Our proposed learning approach closely characterizes such properties : the base model focuses on acquiring new knowledge from the current task while the controller uses the base model ’ s knowledge to generalize to novel samples . In summary , our work makes the following contributions . First , we propose CTN , a novel continual learning method that can model task-specific features while enjoying neglectable complexity overhead compared to fixed architecture methods ( please refer to Table 4 ) . Second , we propose a novel objective that can improve the trade-off between alleviating forgetting and facilitating knowledge transfer to train CTN . Third , we conduct extensive experiments on continual learning benchmarks to demonstrate the efficacy of CTN compared to a suite of baselines . Finally , we provide a comprehensive analysis to investigate the complementarity of each CTN ’ s component . 2 METHOD . Notations . We denote φ as parameter of the base model that extracts global features from the input and θ as the parameter of the controller which modifies the features from φ given a task identifier t. The task identifier can be a set of semantic attributes about objects of that task ( Lampert et al. , 2009 ) or simply an index of the task , which we use in this work as a one-hot vector . A prediction is given as gϕt ( hφ , θ ( x , t ) ) , where gϕt ( · ) is the task Tt ’ s classifier with parameter ϕt such as a fully connected layer with softmax activation . And hφ , θ ( x , t ) is the final feature after transformed by the controller . We denoteDtrt as the training data of task Tt , Memt andMsmt as the episodic memory and the semantic memory of task Tt respectively . The episodic memory and semantic memory maintains two distinct sets of data obtained from task Tt . The episodic memory of task T1 , . . . , Tt−1 is denoted asMem < t ; similarly , Msm < t denotes the semantic memory of the first t− 1 tasks . Remark . Both theMemt andMsmt are obtained from Dtrt through the learner ’ s internal memory management strategy and contains distinct samples from each other such that their combined sizes do not exceed a pre-defined budget . 2.1 LEARNING TASK-SPECIFIC FEATURES FOR CONTINUAL LEARNING . Given a backbone network , one can implement the task-specific features by employing a set of task-specific filters and applying them to the backbone ’ s output . However , this trivial approach is not scalable , even for small networks . In the worst case , it results in storing an additional network per task , which violates the fixed architecture constraint . Since we want to obtain task-specific features with minimal parameter overhead , we propose to use a feature-wise transformation ( Perez et al. , 2018 ) to efficiently extract the task-specific features h̃ ( x , t ) from the common features ĥ ( x ) as follows : h̃ ( x ; t ) = γt ‖γt‖2 ⊗ ĥ ( x ) + βt ‖βt‖2 and { γt , βt } = cθ ( t ) , ( 1 ) where ⊗ denotes the element-wise multiplication operator , and cθ ( t ) is the controller implemented as a linear layer with parameter θ that predicts the transformation coefficients { γt , βt } given the task identifier t. Since the task identifiers are one-hot vectors , which are sparse and make training the controller difficult , we also introduce an embedding layer to map the task identifiers to dense , low dimensional vectors . For simplicity , we will use θ to refer to both the embedding and the linear layer parameters . In addition , instead of storing a set of coefficients { γt , βt } for each task , we only need a fixed set of parameter θ to predict these coefficients , which results in the fixed parameters in the controller . The coefficients { γt , βt } are ` 2-normalized and then transforms the common features ĥ ( x , t ) to become task-specific features h̃ ( x ; t ) . Finally , both feature types are combined by a residual connection before passing to the corresponding classifier gt ( · ) to make the final prediction : gϕt ( σ ( h ( x , t ) ) ) , and h ( x , t ) = ĥ ( x , t ) + h̃ ( x , t ) , ( 2 ) where σ ( · ) is a nonlinear activation function such as ReLU . Importantly , when the task-specific features are removed , i.e. , h̃ ( x , t ) = 0 , Eq . 2 reduces to the traditional experience replay . Lastly , for each incoming task , CTN has to allocate a new classifier , which is the same for all continual learning methods , and a new embedding vector , which is usually low dimensional , e.g . 32 or 64 . Therefore , CTN enjoys almost the same parameter growth as existing continual learning methods . 2.2 TRAINING THE CONTROLLER . While one can train CTN with experience replay ( ER ) , it does not explicitly address the trade-off between facilitating knowledge transfer and alleviating catastrophic forgetting . This motivates us to develop a novel training method that can simultaneously address both problems by leveraging the controller ’ s task-specific features . First , we introduce a dual memory system consisting of the semantic memoryMsmt associated with the controller and the episodic memoryMemt associated with the base model . We propose to train only the base model using experience replay with the episodic memory to obtain new knowledge from incoming tasks . The controller is also trained so that the task-specific features can generalize to unseen samples to the base model stored in the semantic memory . As a result , the task-specific features can generalize to both previous and current tasks , which simultaneously encapsulate both alleviating forgetting and facilitating knowledge transfer . Formally , given the current batch of data for task Tt as Bt , the training of CTN can be formulated as the following bilevel optimization problem ( Colson et al. , 2007 ) : Outer problem : minθ Lctrl ( { φ∗ , θ } ; Msm < t+1 ) Inner problem : s.t φ∗ = arg min φ Ltr ( { φ , θ } , Bt ∪Mem < t ) , ( 3 ) where φ∗ denotes the optimal base model corresponding to the current controller θ . Since every CTN ’ s prediction always involves both the controller and the base model , we use Ltr ( { φ , θ } , Bt ∪Mem < t ) to denote the training loss of the pair { φ , θ } on the data Bt ∪Mem < t . Similarly , Lctrl ( · ) denotes the controller ’ s loss . For simplicity , we omitted the dependency of the the loss on the classifiers ’ parameters and imply that the classifiers are jointly updated with the base model . Since we do not know the optimal transformation coefficients of any task , the controller is trained to minimize the classification loss of the samples via φ . We implement both the training and controller ’ s losses as the cross-entropy loss . Notably , Eq . 3 characterizes two nested optimization problems : the outer problem , which trains the controller to generalize , and each controller parameter θ parameterizes an inner problem that trains the base model to acquire new knowledge via experience replay . Moreover , only φ is trained in the inner problem , while only θ is updated in the outer problem . The bilevel optimization objective such as Eq . 3 has been successfully applied in other machine learning disciplines such as hyperparameter optimization , meta learning ( Franceschi et al. , 2018 ; Finn et al. , 2017 ) , and AutoML ( Liu et al. , 2019a ) . In this work , we extend this framework to continual learning to train the controller . However , unlike existing works ( Franceschi et al. , 2018 ; Finn et al. , 2017 ; Liu et al. , 2019a ) , our Eq . 3 has to be solved incrementally when a new data sample arrives . Therefore , we consider Eq . 3 as an online learning problem and optimize it using the follow the leader principle ( Hannan , 1957 ) . Particularly , we relax the optimal solutions of both the inner and outer problems to be solutions from a few gradient steps . When a new training data arrives , we first train the base model φ using experience replay for a few SGD steps with an inner learning rate α , each of which is implemented as : φ← φ− α∇φLtr ( { φ , θ } , Bt ∪Mem < t ) , ( 4 ) Then , we optimize the controller θ such that it can improve φ ’ s performance on the semantic memory : θ ← θ − β∇θLctrl ( { φ , θ } , Msm < t+1 ) , ( 5 ) where β is the outer learning rate . As a result , Eq . 3 is implemented as an alternative update procedure involving several outer updates to train θ , each of which includes an inner update to trainφ . Moreover , performing several updates per incoming sample does not violate the online assumption since we will not revisit that sample in the future , unless it is stored in the memories . | This paper proposes CTN (Contextual Trasnformer Networks) for online continual learning. In particular, the authors introduce a dual memory framework that contains an episodic memory for base networks and semantic memory for task controllers. The overall framework is optimized with bi-level optimization. In addition, the base network also uses a KL-divergence loss to prevent catastrophic forgetting. Experiments are conducted on multiple datasets and the authors demonstrated that the proposed framewok outperforms other alternative approaches. | SP:f39013d44b9908838bbd3d71564dac2ed4b55564 |
The Logical Options Framework | 1 INTRODUCTION . To operate in the real world , intelligent agents must be able to make long-term plans by reasoning over symbolic abstractions while also maintaining the ability to react to low-level stimuli in their environment ( Zhang & Sridharan , 2020 ) . Many environments obey rules that can be represented as logical formulae ; e.g. , the rules a car follows while driving , or a recipe a chef follows to cook a dish . Traditional motion and path planning techniques struggle to formulate plans over these kinds of long-horizon tasks , but hierarchical approaches such as hierarchical reinforcement learning ( HRL ) can solve lengthy tasks by planning over both the high-level rules and the low-level environment . However , solving these problems involves trade-offs among multiple desirable properties , which we identify as satisfaction , optimality , and composability ( described below ) . Most of today ’ s algorithms sacrifice at least one of these objectives . For example , Reward Machines from Icarte et al . ( 2018 ) is satisfying and optimal , but not composable ; the options framework ( Sutton et al. , 1999 ) is composable and hierarchically optimal , but can not satisfy specifications . We introduce a new approach called the Logical Options Framework , which builds upon the options framework and aims to combine symbolic reasoning and low-level control to achieve satisfaction , optimality , and composability with as few compromises as possible . Furthermore , we show that our framework is compatible with a large variety of domains and planning algorithms , from discrete domains and value iteration to continuous domains and proximal policy optimization ( PPO ) . Satisfaction : An agent operating in an environment governed by rules must be able to satisfy the specified rules . Satisfaction is a concept from formal logic , in which the input to a logical formula causes the formula to evaluate to True . Logical formulae can encapsulate rules and tasks like the ones described in Fig . 1 , such as “ pick up the groceries ” and “ do not drive into a lake ” . In this paper , we state conditions under which our method is guaranteed to learn satisfying policies . Optimality : Optimality requires that the agent maximize its expected cumulative reward for each episode . In general , satisfaction can be achieved by rewarding the agent for satisfying the rules of the environment . In hierarchical planning there are several types of optimality , including hierarchical optimality ( optimal with respect to the hierarchy ) and optimality ( optimal with respect to everything ) . We prove in this paper that our method is hierarchically optimal and , under certain conditions , optimal . Composability : Our method also has the property of composability – once it has learned to satisfy a task , the learned model can be rearranged to satisfy a large variety of related tasks . More specifically , the rules of an environment can be factored into liveness and safety properties , which we discuss in Sec . 3 . The learned model can be adapted to satisfy any appropriate new liveness property . A shortcoming of many RL models is that they are not composable – trained to solve one specific task , they are incapable of handling even small variations in the task structure . However , the real world is a dynamic and unpredictable place , so the ability to automatically reason over as-yet-unseen tasks and rules is a crucial element of intelligence . The illustrations in Fig . 1 give an overview of our work . The environment is a world with a grocery store , your ( hypothetical ) kid , your house , and some lakes , and in which you , the agent , are driving a car . The propositions are divided into “ subgoals ” , representing events that can be achieved , such as going grocery shopping ; “ safety ” propositions , representing events that must be avoided ( driving into a lake ) ; and “ event ” propositions , corresponding to events that you have no control over ( receiving a phone call ) ( Fig . 1b ) . In this environment , you have to follow rules ( Fig . 1a ) . These rules can be converted into a logical formula , and from there into a finite state automaton ( FSA ) ( Fig . 1b ) . The Logical Options Framework learns an option for each subgoal ( illustrated by the arrows in Fig . 1c ) , and a metapolicy for choosing amongst the options to reach the goal state of the FSA . After learning , the options can be recombined to fulfill other tasks . 1.1 CONTRIBUTIONS . We introduce the Logical Options Framework ( LOF ) , which makes four contributions to the hierarchical reinforcement learning literature : 1 . The definition of a hierarchical semi-Markov Decision Process ( SMDP ) that is the product of a logical FSA and a low-level environment MDP . 2 . A planning algorithm for learning options and metapolicies for the SMDP that allows for the options to be composed to solve new tasks with only 10-50 retraining steps . 3 . Conditions and proofs for achieving satisfaction and optimality . 4 . Experiments on a discrete domain and a continuous domain on four tasks demonstrating satisfaction , optimality , and composability . 2 BACKGROUND . Linear Temporal Logic : We use linear temporal logic ( LTL ) to formally specify rules ( Clarke et al. , 2001 ) . LTL formulae are used only indirectly in LOF , as they are converted into automata that the algorithm uses directly . We chose to use LTL to represent rules because LTL corresponds closely to natural language and has proven to be a more natural way of expressing tasks and rules for engineers than designing FSAs by hand ( Kansou , 2019 ) . Formulae φ have the syntax grammar φ : = p | ¬φ | φ1 ∨ φ2 | © φ | φ1 U φ2 where p is a proposition ( a boolean-valued truth statement that can correspond to objects or events in the world ) , ¬ is negation , ∨ is disjunction , © is “ next ” , and U is “ until ” . The derived rules are conjunction ( ∧ ) , implication ( =⇒ ) , equivalence ( ↔ ) , “ eventually ” ( ♦φ ≡ TrueU φ ) and “ always ” ( φ ≡ ¬♦¬φ ) ( Baier & Katoen , 2008 ) . φ1 U φ2 means that φ1 is true until φ2 is true , ♦φ means that there is a time where φ is true and φ means that φ is always true . The Options Framework : The options framework is a framework for defining and solving semiMarkov Decision Processes ( SMDPs ) with a type of macro-action or subpolicy called an option ( Sutton et al. , 1999 ) . The inclusion of options in an MDP problem turns it into an SMDP problem , because actions are dependent not just on the previous state but also on the identity of the currently active option , which could have been initiated many time steps before the current time . An option o is a variable-length sequence of actions defined as o = ( I , π , β , Ro ( s ) , To ( s′|s ) ) . I ⊆ S is the initiation set of the option . π : S×A → [ 0 , 1 ] is the policy the option follows while the option is active . β : S → [ 0 , 1 ] is the termination condition . Ro ( s ) is the reward model of the option . To ( s ′|s ) is the transition model . A major challenge in option learning is that , in general , the number of time steps before the option terminates , k , is a random variable . With this in mind , Ro ( s ) is defined as the expected cumulative reward of option o given that the option is initiated in state s at time t and ends after k time steps . Letting rt be the reward received by the agent at t time steps from the beginning of the option , Ro ( s ) = E [ r1 + γr2 + . . . γ k−1rk ] ( 1 ) To ( s ′|s ) is the combined probability p ( s′ , k ) that option owill terminate at state s′ after k time steps : To ( s ′|s ) = ∞∑ k=1 p ( s′ , k ) γk ( 2 ) In the next section , we describe how Eqs . 1 and 2 can be simplified in the context of LOF . 3 LOGICAL OPTIONS FRAMEWORK . Here is a brief overview of how we will present our formulation of LOF : 1 . The LTL formula is decomposed into liveness and safety properties . The liveness property defines the task specification and the safety property defines the costs for violating rules . 2 . The propositions of the formula are divided into three types : subgoals , safety propositions , and event propositions . Subgoals are used to define tasks , and each subgoal is associated with its own option , whose goal is to achieve that subgoal . Safety propositions are used to define rules . Event propositions serve as control flow variables that affect the task . 3 . We define an SMDP that is the product of a low-level MDP and a high-level logical FSA . 4 . We describe how the logical options can be defined and learned . 5 . We present an algorithm for finding the hierarchically optimal policy on the SMDP . 6 . We state conditions under which satisfaction of the LTL specification is guaranteed , and we prove that the planning algorithm converges to an optimal policy by showing that the hierarchically optimal SMDP policy is the same as the optimal MDP policy . The Logic Formula : LTL formulae can be translated into Büchi automata using automatic translation tools such as SPOT ( Duret-Lutz et al. , 2016 ) . All Büchi automata can be decomposed into liveness and safety properties ( Alpern & Schneider , 1987 ) . To simplify the formulation , we assume that the LTL formula itself can be divided into liveness and safety formulae , φ = φliveness∧φsafety . For the case where the LTL formula can not be factored into independent formulae , please see Appendix A . The liveness property describes “ things that must happen ” to satisfy the LTL formula . It is a task specification , and it is used in planning to determine which subgoals the agent must achieve . The safety property describes “ things that can never happen ” and is used to define costs for violating the rules . In LOF , the liveness property must be written using a finite-trace subset of LTL called syntactically co-safe LTL ( Bhatia et al. , 2010 ) , in which the ( “ always ” ) operator is not allowed and © , U , and ♦ are only used in positive normal form . This way , the liveness property can be satisfied by finite-length sequences of propositions , and the property can be represented as an FSA . Propositions : Propositions are boolean-valued truth statements corresponding to goals , objects , and events in the environment . We distinguish between three types of propositions : subgoals PG , safety propositions PS , and event propositions PE . Subgoal propositions are propositions that must be achieved in order to satisfy the liveness property . They are associated with goals such as “ the agent is at the grocery store ” . They only appear in φliveness . Each subgoal may only be associated with one state . Note that in general , it may be impossible to avoid having subgoals appear in φsafety . Appendix A describes how to deal with this scenario . Safety propositions are propositions that the agent must avoid – for example , driving into a lake . They only appear in φsafety . Event propositions have a set value that affects the task specification – for example , whether or not a phone call is received . They may occur in φliveness , and , with some extensions that are described in Appendix A , in φsafety . Although in the fully observable setting , event propositions are somewhat trivial , in the partially observable setting , where the value of the event proposition is revealed to the agent at a random point in time , they are very useful . Our optimality guarantees only apply in the fully observable setting ; however , LOF ’ s properties of satisfaction and composability still apply in the partially observable setting . The goal state of the liveness property must be reachable from every other state using only subgoals . This means that no matter what the values of the event propositions are , it is always possible for the agent to satisfy the liveness property . Proposition labeling functions relate states to the set of propositions that are true at that state : TPG : S → 2PG , TPS : S → 2PS ; for event propositions , a function identifies the set of true propositions , TPE : 2 PE → { 0 , 1 } . Hierarchical SMDP : LOF works by defining a hierarchical semi-Markov Decision Process ( SMDP ) , learning the options , and then planning over the options . The high-level part of the hierarchy is defined by an FSA specified using LTL . The low level is an environment MDP . We assume that the high-level LTL specification φ can be decomposed into a liveness property φliveness and a safety property φsafety . The set of propositions P is the union of the sets of subgoals PG , safety propositions PS , and event propositions PE . We assume that the liveness property can be translated into an FSA T = ( F , P , TF , RF , f0 , fg ) . F is the set of automaton states ; P is the set of propositions ; TF is the transition function relating the current state and proposition to the next state , TF : F × P × F → [ 0 , 1 ] . In practice , TF is deterministic despite our use of probabilistic notation . We assume that there is a single initial state f0 and final state fg , and that the goal state fg is reachable from every state f ∈ F using only subgoals . There is also a reward function that assigns a reward to every state , RF : F → R. In our experiments , we assume that the safety property takes the form ∧ ps∈PS ¬ps . This simple safety property implies that every safety proposition is not allowed , and that the safety propositions have associated costs , RS : 2PS → R. φsafety is not limited to this simple case ; the general case is covered in Appendix A . There is a low-level environment MDP E = ( S , A , RE , TE , γ ) . S is the state space and A is the action space . They can be discrete or continuous . RE : S × A → R is a low-level reward function that characterizes , for example , distance or actuation costs . RE is a combination of the safety reward function RS and RE , e.g . RE ( s , a ) = RE ( s , a ) + RS ( TPS ( s ) ) . The transition function of the environment is TE : S ×A× S → [ 0 , 1 ] . From these parts we define a hierarchical SMDPM = ( S×F , A , P , O , TE×TP×TF , RSMDP , γ ) . The hierarchical state space contains two elements : low-level states S and FSA states F . The action space isA . The set of propositions is P . The set of options ( one option associated with each subgoal in PG ) is O . The transition function consists of the low-level environment transitions TE and the FSA transitions TF . TP = TPG × TPS × TPE . We classify TP , relating states to propositions , as a transition function because it helps to determine when FSA transitions occur . The transitions are applied in the order TE , TP , TF . The reward function RSMDP ( f , s , o ) = RF ( f ) Ro ( s ) , so RF ( f ) is a weighting on the option rewards . Lastly , the SMDP has the same discount factor γ as E . Planning is done on the SMDP in two steps : first , the options O are learned over E using an Algorithm 1 Learning and Planning with Logical Options 1 : procedure LEARNING-AND-PLANNING-WITH-LOGICAL-OPTIONS 2 : Given : Propositions P partitioned into subgoals PG , safety props PS , and event props PE Logical FSA T = ( F , PG × PE , TF , RF , f0 , fg ) derived from φliveness Low-level MDP E = ( S , A , RE , TE , γ ) , where RE ( s , a ) = RE ( s , a ) +RS ( TPS ( s ) ) combines the environment and safety rewards Proposition labeling functions TPG : S → 2PG , TPS : S → 2PS , and TPE : 2 PE → { 0 , 1 } 3 : To learn : 4 : Set of options O , one for each subgoal proposition p ∈ PG 5 : Metapolicy µ ( f , s , o ) along with Q ( f , s , o ) and V ( f , s ) 6 : Learn logical options : 7 : For every p in PG , learn an option for achieving p , op = ( Iop , πop , βop , Rop , Top ) 8 : Iop = S 9 : βop = { 1 if p ∈ TPG ( s ) 0 otherwise 10 : πop = optimal policy on E with rollouts terminating when p ∈ TPG ( s ) 11 : Top ( s ′|s ) = { Eγk if p ∈ TPG ( s′ ) , where k is number of time steps to reach p 0 otherwise 12 : Rop ( s ) = E [ RE ( s , a1 ) + γRE ( s1 , a2 ) + · · ·+ γk−1RE ( sk−1 , ak ) ] 13 : Find a metapolicy µ over the options : 14 : Initialize Q : F × S ×O → R and V : F × S → R to 0 15 : For ( k , f , s ) ∈ [ 1 , . . . , n ] ×F × S : 16 : For o ∈ O : 17 : Qk ( f , s , o ) ← RF ( f ) Ro ( s ) + ∑ f ′∈F ∑ p̄e∈2PE ∑ s′∈S TF ( f ′|f , TPG ( s′ ) , p̄e ) 18 : TPE ( p̄e ) To ( s ′|s ) Vk−1 ( f ′ , s′ ) 19 : Vk ( f , s ) ← max o∈O Qk ( f , s , o ) 20 : µ ( f , s , o ) = arg max o∈O Q ( f , s , o ) 21 : return Options O , metapolicy µ ( f , s , o ) and Q- and value functions Q ( f , s , o ) , V ( f , s ) 22 : end procedure appropriate policy-learning algorithm such as PPO or Reward Machines . Next , a metapolicy over the task specification T is found using the learned options and the reward function RSMDP . Logical Options : The first step of Alg . 1 is to learn the logical options . We associate every subgoal p with an option op = ( Iop , πop , βop , Rop , Top ) . These terms are defined starting at Alg . 1 line 6 . Every op has a policy πop whose goal is to reach the state sp where p is true . Options are learned by training on the environment MDP E and terminating only when sp is reached . As we discuss in Sec . 3.1 , under certain conditions the optimal option policy is guaranteed to always terminate at the subgoal . This allows us to simplify the transition model of Eq . 2 to the form in Alg . 1 line 11 . In the experiments , we further simplify this expression by setting γ = 1 . Logical Value Iteration : After finding the logical options , the next step is to find a policy for FSA T over the options , as described in Alg . 1 line 13 . A value function and Q-function are found for the SMDP using the Bellman update equations : Qk ( f , s , o ) ← RF ( f ) Ro ( s ) + ∑ f ′∈F ∑ p̄e∈2PE ∑ s′∈S TF ( f ′|f , TPG ( s′ ) , p̄e ) TPE ( p̄e ) To ( s ′|s ) Vk−1 ( f ′ , s′ ) ( 3 ) Vk ( f , s ) ← max o∈O Qk ( f , s , o ) ( 4 ) Eq . 3 differs from the generic equations for SMDP value iteration in that the transition function has two extra components , ∑ f ′∈F TF ( f ′|f , TP ( s′ ) , p̄e ) and ∑ p̄e∈2PE TPE ( p̄e ) . The equations are derived from Araki et al . ( 2019 ) and the fact that , on every step in the environment , three transitions are applied : the option transition To , the event proposition “ transition ” TPE , and the FSA transition TF . Note that Ro ( s ) and To ( s′|s ) compress the consequences of choosing an option o at a state s from a multi-step trajectory into two real-valued numbers , allowing for more efficient planning . | This paper is on a new RL framework that leverages logical reasoning to improve the learning performance of RL agents. In particular, the knowledge is encoded using LTL, and includes both safety knowledge (used for reward function definition) and liveness knowledge (used for constructing FSA). THe developed framework has been evaluated using tasks in both discrete and continuous domains, where the RL agent was realized using Q-learning and PPO respectively. The framework was compared with baselines including another LTL-based RL methods (Reward Machines). Results show that LOF performed better than the baseline methods in learning rate and policy quality (in most cases). | SP:0731025a467f9c3e648608248eada5a23aff5b49 |
The Logical Options Framework | 1 INTRODUCTION . To operate in the real world , intelligent agents must be able to make long-term plans by reasoning over symbolic abstractions while also maintaining the ability to react to low-level stimuli in their environment ( Zhang & Sridharan , 2020 ) . Many environments obey rules that can be represented as logical formulae ; e.g. , the rules a car follows while driving , or a recipe a chef follows to cook a dish . Traditional motion and path planning techniques struggle to formulate plans over these kinds of long-horizon tasks , but hierarchical approaches such as hierarchical reinforcement learning ( HRL ) can solve lengthy tasks by planning over both the high-level rules and the low-level environment . However , solving these problems involves trade-offs among multiple desirable properties , which we identify as satisfaction , optimality , and composability ( described below ) . Most of today ’ s algorithms sacrifice at least one of these objectives . For example , Reward Machines from Icarte et al . ( 2018 ) is satisfying and optimal , but not composable ; the options framework ( Sutton et al. , 1999 ) is composable and hierarchically optimal , but can not satisfy specifications . We introduce a new approach called the Logical Options Framework , which builds upon the options framework and aims to combine symbolic reasoning and low-level control to achieve satisfaction , optimality , and composability with as few compromises as possible . Furthermore , we show that our framework is compatible with a large variety of domains and planning algorithms , from discrete domains and value iteration to continuous domains and proximal policy optimization ( PPO ) . Satisfaction : An agent operating in an environment governed by rules must be able to satisfy the specified rules . Satisfaction is a concept from formal logic , in which the input to a logical formula causes the formula to evaluate to True . Logical formulae can encapsulate rules and tasks like the ones described in Fig . 1 , such as “ pick up the groceries ” and “ do not drive into a lake ” . In this paper , we state conditions under which our method is guaranteed to learn satisfying policies . Optimality : Optimality requires that the agent maximize its expected cumulative reward for each episode . In general , satisfaction can be achieved by rewarding the agent for satisfying the rules of the environment . In hierarchical planning there are several types of optimality , including hierarchical optimality ( optimal with respect to the hierarchy ) and optimality ( optimal with respect to everything ) . We prove in this paper that our method is hierarchically optimal and , under certain conditions , optimal . Composability : Our method also has the property of composability – once it has learned to satisfy a task , the learned model can be rearranged to satisfy a large variety of related tasks . More specifically , the rules of an environment can be factored into liveness and safety properties , which we discuss in Sec . 3 . The learned model can be adapted to satisfy any appropriate new liveness property . A shortcoming of many RL models is that they are not composable – trained to solve one specific task , they are incapable of handling even small variations in the task structure . However , the real world is a dynamic and unpredictable place , so the ability to automatically reason over as-yet-unseen tasks and rules is a crucial element of intelligence . The illustrations in Fig . 1 give an overview of our work . The environment is a world with a grocery store , your ( hypothetical ) kid , your house , and some lakes , and in which you , the agent , are driving a car . The propositions are divided into “ subgoals ” , representing events that can be achieved , such as going grocery shopping ; “ safety ” propositions , representing events that must be avoided ( driving into a lake ) ; and “ event ” propositions , corresponding to events that you have no control over ( receiving a phone call ) ( Fig . 1b ) . In this environment , you have to follow rules ( Fig . 1a ) . These rules can be converted into a logical formula , and from there into a finite state automaton ( FSA ) ( Fig . 1b ) . The Logical Options Framework learns an option for each subgoal ( illustrated by the arrows in Fig . 1c ) , and a metapolicy for choosing amongst the options to reach the goal state of the FSA . After learning , the options can be recombined to fulfill other tasks . 1.1 CONTRIBUTIONS . We introduce the Logical Options Framework ( LOF ) , which makes four contributions to the hierarchical reinforcement learning literature : 1 . The definition of a hierarchical semi-Markov Decision Process ( SMDP ) that is the product of a logical FSA and a low-level environment MDP . 2 . A planning algorithm for learning options and metapolicies for the SMDP that allows for the options to be composed to solve new tasks with only 10-50 retraining steps . 3 . Conditions and proofs for achieving satisfaction and optimality . 4 . Experiments on a discrete domain and a continuous domain on four tasks demonstrating satisfaction , optimality , and composability . 2 BACKGROUND . Linear Temporal Logic : We use linear temporal logic ( LTL ) to formally specify rules ( Clarke et al. , 2001 ) . LTL formulae are used only indirectly in LOF , as they are converted into automata that the algorithm uses directly . We chose to use LTL to represent rules because LTL corresponds closely to natural language and has proven to be a more natural way of expressing tasks and rules for engineers than designing FSAs by hand ( Kansou , 2019 ) . Formulae φ have the syntax grammar φ : = p | ¬φ | φ1 ∨ φ2 | © φ | φ1 U φ2 where p is a proposition ( a boolean-valued truth statement that can correspond to objects or events in the world ) , ¬ is negation , ∨ is disjunction , © is “ next ” , and U is “ until ” . The derived rules are conjunction ( ∧ ) , implication ( =⇒ ) , equivalence ( ↔ ) , “ eventually ” ( ♦φ ≡ TrueU φ ) and “ always ” ( φ ≡ ¬♦¬φ ) ( Baier & Katoen , 2008 ) . φ1 U φ2 means that φ1 is true until φ2 is true , ♦φ means that there is a time where φ is true and φ means that φ is always true . The Options Framework : The options framework is a framework for defining and solving semiMarkov Decision Processes ( SMDPs ) with a type of macro-action or subpolicy called an option ( Sutton et al. , 1999 ) . The inclusion of options in an MDP problem turns it into an SMDP problem , because actions are dependent not just on the previous state but also on the identity of the currently active option , which could have been initiated many time steps before the current time . An option o is a variable-length sequence of actions defined as o = ( I , π , β , Ro ( s ) , To ( s′|s ) ) . I ⊆ S is the initiation set of the option . π : S×A → [ 0 , 1 ] is the policy the option follows while the option is active . β : S → [ 0 , 1 ] is the termination condition . Ro ( s ) is the reward model of the option . To ( s ′|s ) is the transition model . A major challenge in option learning is that , in general , the number of time steps before the option terminates , k , is a random variable . With this in mind , Ro ( s ) is defined as the expected cumulative reward of option o given that the option is initiated in state s at time t and ends after k time steps . Letting rt be the reward received by the agent at t time steps from the beginning of the option , Ro ( s ) = E [ r1 + γr2 + . . . γ k−1rk ] ( 1 ) To ( s ′|s ) is the combined probability p ( s′ , k ) that option owill terminate at state s′ after k time steps : To ( s ′|s ) = ∞∑ k=1 p ( s′ , k ) γk ( 2 ) In the next section , we describe how Eqs . 1 and 2 can be simplified in the context of LOF . 3 LOGICAL OPTIONS FRAMEWORK . Here is a brief overview of how we will present our formulation of LOF : 1 . The LTL formula is decomposed into liveness and safety properties . The liveness property defines the task specification and the safety property defines the costs for violating rules . 2 . The propositions of the formula are divided into three types : subgoals , safety propositions , and event propositions . Subgoals are used to define tasks , and each subgoal is associated with its own option , whose goal is to achieve that subgoal . Safety propositions are used to define rules . Event propositions serve as control flow variables that affect the task . 3 . We define an SMDP that is the product of a low-level MDP and a high-level logical FSA . 4 . We describe how the logical options can be defined and learned . 5 . We present an algorithm for finding the hierarchically optimal policy on the SMDP . 6 . We state conditions under which satisfaction of the LTL specification is guaranteed , and we prove that the planning algorithm converges to an optimal policy by showing that the hierarchically optimal SMDP policy is the same as the optimal MDP policy . The Logic Formula : LTL formulae can be translated into Büchi automata using automatic translation tools such as SPOT ( Duret-Lutz et al. , 2016 ) . All Büchi automata can be decomposed into liveness and safety properties ( Alpern & Schneider , 1987 ) . To simplify the formulation , we assume that the LTL formula itself can be divided into liveness and safety formulae , φ = φliveness∧φsafety . For the case where the LTL formula can not be factored into independent formulae , please see Appendix A . The liveness property describes “ things that must happen ” to satisfy the LTL formula . It is a task specification , and it is used in planning to determine which subgoals the agent must achieve . The safety property describes “ things that can never happen ” and is used to define costs for violating the rules . In LOF , the liveness property must be written using a finite-trace subset of LTL called syntactically co-safe LTL ( Bhatia et al. , 2010 ) , in which the ( “ always ” ) operator is not allowed and © , U , and ♦ are only used in positive normal form . This way , the liveness property can be satisfied by finite-length sequences of propositions , and the property can be represented as an FSA . Propositions : Propositions are boolean-valued truth statements corresponding to goals , objects , and events in the environment . We distinguish between three types of propositions : subgoals PG , safety propositions PS , and event propositions PE . Subgoal propositions are propositions that must be achieved in order to satisfy the liveness property . They are associated with goals such as “ the agent is at the grocery store ” . They only appear in φliveness . Each subgoal may only be associated with one state . Note that in general , it may be impossible to avoid having subgoals appear in φsafety . Appendix A describes how to deal with this scenario . Safety propositions are propositions that the agent must avoid – for example , driving into a lake . They only appear in φsafety . Event propositions have a set value that affects the task specification – for example , whether or not a phone call is received . They may occur in φliveness , and , with some extensions that are described in Appendix A , in φsafety . Although in the fully observable setting , event propositions are somewhat trivial , in the partially observable setting , where the value of the event proposition is revealed to the agent at a random point in time , they are very useful . Our optimality guarantees only apply in the fully observable setting ; however , LOF ’ s properties of satisfaction and composability still apply in the partially observable setting . The goal state of the liveness property must be reachable from every other state using only subgoals . This means that no matter what the values of the event propositions are , it is always possible for the agent to satisfy the liveness property . Proposition labeling functions relate states to the set of propositions that are true at that state : TPG : S → 2PG , TPS : S → 2PS ; for event propositions , a function identifies the set of true propositions , TPE : 2 PE → { 0 , 1 } . Hierarchical SMDP : LOF works by defining a hierarchical semi-Markov Decision Process ( SMDP ) , learning the options , and then planning over the options . The high-level part of the hierarchy is defined by an FSA specified using LTL . The low level is an environment MDP . We assume that the high-level LTL specification φ can be decomposed into a liveness property φliveness and a safety property φsafety . The set of propositions P is the union of the sets of subgoals PG , safety propositions PS , and event propositions PE . We assume that the liveness property can be translated into an FSA T = ( F , P , TF , RF , f0 , fg ) . F is the set of automaton states ; P is the set of propositions ; TF is the transition function relating the current state and proposition to the next state , TF : F × P × F → [ 0 , 1 ] . In practice , TF is deterministic despite our use of probabilistic notation . We assume that there is a single initial state f0 and final state fg , and that the goal state fg is reachable from every state f ∈ F using only subgoals . There is also a reward function that assigns a reward to every state , RF : F → R. In our experiments , we assume that the safety property takes the form ∧ ps∈PS ¬ps . This simple safety property implies that every safety proposition is not allowed , and that the safety propositions have associated costs , RS : 2PS → R. φsafety is not limited to this simple case ; the general case is covered in Appendix A . There is a low-level environment MDP E = ( S , A , RE , TE , γ ) . S is the state space and A is the action space . They can be discrete or continuous . RE : S × A → R is a low-level reward function that characterizes , for example , distance or actuation costs . RE is a combination of the safety reward function RS and RE , e.g . RE ( s , a ) = RE ( s , a ) + RS ( TPS ( s ) ) . The transition function of the environment is TE : S ×A× S → [ 0 , 1 ] . From these parts we define a hierarchical SMDPM = ( S×F , A , P , O , TE×TP×TF , RSMDP , γ ) . The hierarchical state space contains two elements : low-level states S and FSA states F . The action space isA . The set of propositions is P . The set of options ( one option associated with each subgoal in PG ) is O . The transition function consists of the low-level environment transitions TE and the FSA transitions TF . TP = TPG × TPS × TPE . We classify TP , relating states to propositions , as a transition function because it helps to determine when FSA transitions occur . The transitions are applied in the order TE , TP , TF . The reward function RSMDP ( f , s , o ) = RF ( f ) Ro ( s ) , so RF ( f ) is a weighting on the option rewards . Lastly , the SMDP has the same discount factor γ as E . Planning is done on the SMDP in two steps : first , the options O are learned over E using an Algorithm 1 Learning and Planning with Logical Options 1 : procedure LEARNING-AND-PLANNING-WITH-LOGICAL-OPTIONS 2 : Given : Propositions P partitioned into subgoals PG , safety props PS , and event props PE Logical FSA T = ( F , PG × PE , TF , RF , f0 , fg ) derived from φliveness Low-level MDP E = ( S , A , RE , TE , γ ) , where RE ( s , a ) = RE ( s , a ) +RS ( TPS ( s ) ) combines the environment and safety rewards Proposition labeling functions TPG : S → 2PG , TPS : S → 2PS , and TPE : 2 PE → { 0 , 1 } 3 : To learn : 4 : Set of options O , one for each subgoal proposition p ∈ PG 5 : Metapolicy µ ( f , s , o ) along with Q ( f , s , o ) and V ( f , s ) 6 : Learn logical options : 7 : For every p in PG , learn an option for achieving p , op = ( Iop , πop , βop , Rop , Top ) 8 : Iop = S 9 : βop = { 1 if p ∈ TPG ( s ) 0 otherwise 10 : πop = optimal policy on E with rollouts terminating when p ∈ TPG ( s ) 11 : Top ( s ′|s ) = { Eγk if p ∈ TPG ( s′ ) , where k is number of time steps to reach p 0 otherwise 12 : Rop ( s ) = E [ RE ( s , a1 ) + γRE ( s1 , a2 ) + · · ·+ γk−1RE ( sk−1 , ak ) ] 13 : Find a metapolicy µ over the options : 14 : Initialize Q : F × S ×O → R and V : F × S → R to 0 15 : For ( k , f , s ) ∈ [ 1 , . . . , n ] ×F × S : 16 : For o ∈ O : 17 : Qk ( f , s , o ) ← RF ( f ) Ro ( s ) + ∑ f ′∈F ∑ p̄e∈2PE ∑ s′∈S TF ( f ′|f , TPG ( s′ ) , p̄e ) 18 : TPE ( p̄e ) To ( s ′|s ) Vk−1 ( f ′ , s′ ) 19 : Vk ( f , s ) ← max o∈O Qk ( f , s , o ) 20 : µ ( f , s , o ) = arg max o∈O Q ( f , s , o ) 21 : return Options O , metapolicy µ ( f , s , o ) and Q- and value functions Q ( f , s , o ) , V ( f , s ) 22 : end procedure appropriate policy-learning algorithm such as PPO or Reward Machines . Next , a metapolicy over the task specification T is found using the learned options and the reward function RSMDP . Logical Options : The first step of Alg . 1 is to learn the logical options . We associate every subgoal p with an option op = ( Iop , πop , βop , Rop , Top ) . These terms are defined starting at Alg . 1 line 6 . Every op has a policy πop whose goal is to reach the state sp where p is true . Options are learned by training on the environment MDP E and terminating only when sp is reached . As we discuss in Sec . 3.1 , under certain conditions the optimal option policy is guaranteed to always terminate at the subgoal . This allows us to simplify the transition model of Eq . 2 to the form in Alg . 1 line 11 . In the experiments , we further simplify this expression by setting γ = 1 . Logical Value Iteration : After finding the logical options , the next step is to find a policy for FSA T over the options , as described in Alg . 1 line 13 . A value function and Q-function are found for the SMDP using the Bellman update equations : Qk ( f , s , o ) ← RF ( f ) Ro ( s ) + ∑ f ′∈F ∑ p̄e∈2PE ∑ s′∈S TF ( f ′|f , TPG ( s′ ) , p̄e ) TPE ( p̄e ) To ( s ′|s ) Vk−1 ( f ′ , s′ ) ( 3 ) Vk ( f , s ) ← max o∈O Qk ( f , s , o ) ( 4 ) Eq . 3 differs from the generic equations for SMDP value iteration in that the transition function has two extra components , ∑ f ′∈F TF ( f ′|f , TP ( s′ ) , p̄e ) and ∑ p̄e∈2PE TPE ( p̄e ) . The equations are derived from Araki et al . ( 2019 ) and the fact that , on every step in the environment , three transitions are applied : the option transition To , the event proposition “ transition ” TPE , and the FSA transition TF . Note that Ro ( s ) and To ( s′|s ) compress the consequences of choosing an option o at a state s from a multi-step trajectory into two real-valued numbers , allowing for more efficient planning . | The authors propose the Logical Options Framework (LOF) --- a framework for reasoning over high-level plans and learning low-level control policies. This framework uses Linear Temporal Logic (LTL) to specify properties (high-level tasks) in terms of propositions. The authors propose a framework in which a separate sub-task policy is learnt to accomplish each such sub-task proposition. These low-level control policies may be reused, without further training, to accomplish new high-level tasks by performing value-iteration in the proposed Hierarchical SMDP. Experimental results demonstrate the method’s effectiveness for several tasks and experimental domains. | SP:0731025a467f9c3e648608248eada5a23aff5b49 |
The Logical Options Framework | 1 INTRODUCTION . To operate in the real world , intelligent agents must be able to make long-term plans by reasoning over symbolic abstractions while also maintaining the ability to react to low-level stimuli in their environment ( Zhang & Sridharan , 2020 ) . Many environments obey rules that can be represented as logical formulae ; e.g. , the rules a car follows while driving , or a recipe a chef follows to cook a dish . Traditional motion and path planning techniques struggle to formulate plans over these kinds of long-horizon tasks , but hierarchical approaches such as hierarchical reinforcement learning ( HRL ) can solve lengthy tasks by planning over both the high-level rules and the low-level environment . However , solving these problems involves trade-offs among multiple desirable properties , which we identify as satisfaction , optimality , and composability ( described below ) . Most of today ’ s algorithms sacrifice at least one of these objectives . For example , Reward Machines from Icarte et al . ( 2018 ) is satisfying and optimal , but not composable ; the options framework ( Sutton et al. , 1999 ) is composable and hierarchically optimal , but can not satisfy specifications . We introduce a new approach called the Logical Options Framework , which builds upon the options framework and aims to combine symbolic reasoning and low-level control to achieve satisfaction , optimality , and composability with as few compromises as possible . Furthermore , we show that our framework is compatible with a large variety of domains and planning algorithms , from discrete domains and value iteration to continuous domains and proximal policy optimization ( PPO ) . Satisfaction : An agent operating in an environment governed by rules must be able to satisfy the specified rules . Satisfaction is a concept from formal logic , in which the input to a logical formula causes the formula to evaluate to True . Logical formulae can encapsulate rules and tasks like the ones described in Fig . 1 , such as “ pick up the groceries ” and “ do not drive into a lake ” . In this paper , we state conditions under which our method is guaranteed to learn satisfying policies . Optimality : Optimality requires that the agent maximize its expected cumulative reward for each episode . In general , satisfaction can be achieved by rewarding the agent for satisfying the rules of the environment . In hierarchical planning there are several types of optimality , including hierarchical optimality ( optimal with respect to the hierarchy ) and optimality ( optimal with respect to everything ) . We prove in this paper that our method is hierarchically optimal and , under certain conditions , optimal . Composability : Our method also has the property of composability – once it has learned to satisfy a task , the learned model can be rearranged to satisfy a large variety of related tasks . More specifically , the rules of an environment can be factored into liveness and safety properties , which we discuss in Sec . 3 . The learned model can be adapted to satisfy any appropriate new liveness property . A shortcoming of many RL models is that they are not composable – trained to solve one specific task , they are incapable of handling even small variations in the task structure . However , the real world is a dynamic and unpredictable place , so the ability to automatically reason over as-yet-unseen tasks and rules is a crucial element of intelligence . The illustrations in Fig . 1 give an overview of our work . The environment is a world with a grocery store , your ( hypothetical ) kid , your house , and some lakes , and in which you , the agent , are driving a car . The propositions are divided into “ subgoals ” , representing events that can be achieved , such as going grocery shopping ; “ safety ” propositions , representing events that must be avoided ( driving into a lake ) ; and “ event ” propositions , corresponding to events that you have no control over ( receiving a phone call ) ( Fig . 1b ) . In this environment , you have to follow rules ( Fig . 1a ) . These rules can be converted into a logical formula , and from there into a finite state automaton ( FSA ) ( Fig . 1b ) . The Logical Options Framework learns an option for each subgoal ( illustrated by the arrows in Fig . 1c ) , and a metapolicy for choosing amongst the options to reach the goal state of the FSA . After learning , the options can be recombined to fulfill other tasks . 1.1 CONTRIBUTIONS . We introduce the Logical Options Framework ( LOF ) , which makes four contributions to the hierarchical reinforcement learning literature : 1 . The definition of a hierarchical semi-Markov Decision Process ( SMDP ) that is the product of a logical FSA and a low-level environment MDP . 2 . A planning algorithm for learning options and metapolicies for the SMDP that allows for the options to be composed to solve new tasks with only 10-50 retraining steps . 3 . Conditions and proofs for achieving satisfaction and optimality . 4 . Experiments on a discrete domain and a continuous domain on four tasks demonstrating satisfaction , optimality , and composability . 2 BACKGROUND . Linear Temporal Logic : We use linear temporal logic ( LTL ) to formally specify rules ( Clarke et al. , 2001 ) . LTL formulae are used only indirectly in LOF , as they are converted into automata that the algorithm uses directly . We chose to use LTL to represent rules because LTL corresponds closely to natural language and has proven to be a more natural way of expressing tasks and rules for engineers than designing FSAs by hand ( Kansou , 2019 ) . Formulae φ have the syntax grammar φ : = p | ¬φ | φ1 ∨ φ2 | © φ | φ1 U φ2 where p is a proposition ( a boolean-valued truth statement that can correspond to objects or events in the world ) , ¬ is negation , ∨ is disjunction , © is “ next ” , and U is “ until ” . The derived rules are conjunction ( ∧ ) , implication ( =⇒ ) , equivalence ( ↔ ) , “ eventually ” ( ♦φ ≡ TrueU φ ) and “ always ” ( φ ≡ ¬♦¬φ ) ( Baier & Katoen , 2008 ) . φ1 U φ2 means that φ1 is true until φ2 is true , ♦φ means that there is a time where φ is true and φ means that φ is always true . The Options Framework : The options framework is a framework for defining and solving semiMarkov Decision Processes ( SMDPs ) with a type of macro-action or subpolicy called an option ( Sutton et al. , 1999 ) . The inclusion of options in an MDP problem turns it into an SMDP problem , because actions are dependent not just on the previous state but also on the identity of the currently active option , which could have been initiated many time steps before the current time . An option o is a variable-length sequence of actions defined as o = ( I , π , β , Ro ( s ) , To ( s′|s ) ) . I ⊆ S is the initiation set of the option . π : S×A → [ 0 , 1 ] is the policy the option follows while the option is active . β : S → [ 0 , 1 ] is the termination condition . Ro ( s ) is the reward model of the option . To ( s ′|s ) is the transition model . A major challenge in option learning is that , in general , the number of time steps before the option terminates , k , is a random variable . With this in mind , Ro ( s ) is defined as the expected cumulative reward of option o given that the option is initiated in state s at time t and ends after k time steps . Letting rt be the reward received by the agent at t time steps from the beginning of the option , Ro ( s ) = E [ r1 + γr2 + . . . γ k−1rk ] ( 1 ) To ( s ′|s ) is the combined probability p ( s′ , k ) that option owill terminate at state s′ after k time steps : To ( s ′|s ) = ∞∑ k=1 p ( s′ , k ) γk ( 2 ) In the next section , we describe how Eqs . 1 and 2 can be simplified in the context of LOF . 3 LOGICAL OPTIONS FRAMEWORK . Here is a brief overview of how we will present our formulation of LOF : 1 . The LTL formula is decomposed into liveness and safety properties . The liveness property defines the task specification and the safety property defines the costs for violating rules . 2 . The propositions of the formula are divided into three types : subgoals , safety propositions , and event propositions . Subgoals are used to define tasks , and each subgoal is associated with its own option , whose goal is to achieve that subgoal . Safety propositions are used to define rules . Event propositions serve as control flow variables that affect the task . 3 . We define an SMDP that is the product of a low-level MDP and a high-level logical FSA . 4 . We describe how the logical options can be defined and learned . 5 . We present an algorithm for finding the hierarchically optimal policy on the SMDP . 6 . We state conditions under which satisfaction of the LTL specification is guaranteed , and we prove that the planning algorithm converges to an optimal policy by showing that the hierarchically optimal SMDP policy is the same as the optimal MDP policy . The Logic Formula : LTL formulae can be translated into Büchi automata using automatic translation tools such as SPOT ( Duret-Lutz et al. , 2016 ) . All Büchi automata can be decomposed into liveness and safety properties ( Alpern & Schneider , 1987 ) . To simplify the formulation , we assume that the LTL formula itself can be divided into liveness and safety formulae , φ = φliveness∧φsafety . For the case where the LTL formula can not be factored into independent formulae , please see Appendix A . The liveness property describes “ things that must happen ” to satisfy the LTL formula . It is a task specification , and it is used in planning to determine which subgoals the agent must achieve . The safety property describes “ things that can never happen ” and is used to define costs for violating the rules . In LOF , the liveness property must be written using a finite-trace subset of LTL called syntactically co-safe LTL ( Bhatia et al. , 2010 ) , in which the ( “ always ” ) operator is not allowed and © , U , and ♦ are only used in positive normal form . This way , the liveness property can be satisfied by finite-length sequences of propositions , and the property can be represented as an FSA . Propositions : Propositions are boolean-valued truth statements corresponding to goals , objects , and events in the environment . We distinguish between three types of propositions : subgoals PG , safety propositions PS , and event propositions PE . Subgoal propositions are propositions that must be achieved in order to satisfy the liveness property . They are associated with goals such as “ the agent is at the grocery store ” . They only appear in φliveness . Each subgoal may only be associated with one state . Note that in general , it may be impossible to avoid having subgoals appear in φsafety . Appendix A describes how to deal with this scenario . Safety propositions are propositions that the agent must avoid – for example , driving into a lake . They only appear in φsafety . Event propositions have a set value that affects the task specification – for example , whether or not a phone call is received . They may occur in φliveness , and , with some extensions that are described in Appendix A , in φsafety . Although in the fully observable setting , event propositions are somewhat trivial , in the partially observable setting , where the value of the event proposition is revealed to the agent at a random point in time , they are very useful . Our optimality guarantees only apply in the fully observable setting ; however , LOF ’ s properties of satisfaction and composability still apply in the partially observable setting . The goal state of the liveness property must be reachable from every other state using only subgoals . This means that no matter what the values of the event propositions are , it is always possible for the agent to satisfy the liveness property . Proposition labeling functions relate states to the set of propositions that are true at that state : TPG : S → 2PG , TPS : S → 2PS ; for event propositions , a function identifies the set of true propositions , TPE : 2 PE → { 0 , 1 } . Hierarchical SMDP : LOF works by defining a hierarchical semi-Markov Decision Process ( SMDP ) , learning the options , and then planning over the options . The high-level part of the hierarchy is defined by an FSA specified using LTL . The low level is an environment MDP . We assume that the high-level LTL specification φ can be decomposed into a liveness property φliveness and a safety property φsafety . The set of propositions P is the union of the sets of subgoals PG , safety propositions PS , and event propositions PE . We assume that the liveness property can be translated into an FSA T = ( F , P , TF , RF , f0 , fg ) . F is the set of automaton states ; P is the set of propositions ; TF is the transition function relating the current state and proposition to the next state , TF : F × P × F → [ 0 , 1 ] . In practice , TF is deterministic despite our use of probabilistic notation . We assume that there is a single initial state f0 and final state fg , and that the goal state fg is reachable from every state f ∈ F using only subgoals . There is also a reward function that assigns a reward to every state , RF : F → R. In our experiments , we assume that the safety property takes the form ∧ ps∈PS ¬ps . This simple safety property implies that every safety proposition is not allowed , and that the safety propositions have associated costs , RS : 2PS → R. φsafety is not limited to this simple case ; the general case is covered in Appendix A . There is a low-level environment MDP E = ( S , A , RE , TE , γ ) . S is the state space and A is the action space . They can be discrete or continuous . RE : S × A → R is a low-level reward function that characterizes , for example , distance or actuation costs . RE is a combination of the safety reward function RS and RE , e.g . RE ( s , a ) = RE ( s , a ) + RS ( TPS ( s ) ) . The transition function of the environment is TE : S ×A× S → [ 0 , 1 ] . From these parts we define a hierarchical SMDPM = ( S×F , A , P , O , TE×TP×TF , RSMDP , γ ) . The hierarchical state space contains two elements : low-level states S and FSA states F . The action space isA . The set of propositions is P . The set of options ( one option associated with each subgoal in PG ) is O . The transition function consists of the low-level environment transitions TE and the FSA transitions TF . TP = TPG × TPS × TPE . We classify TP , relating states to propositions , as a transition function because it helps to determine when FSA transitions occur . The transitions are applied in the order TE , TP , TF . The reward function RSMDP ( f , s , o ) = RF ( f ) Ro ( s ) , so RF ( f ) is a weighting on the option rewards . Lastly , the SMDP has the same discount factor γ as E . Planning is done on the SMDP in two steps : first , the options O are learned over E using an Algorithm 1 Learning and Planning with Logical Options 1 : procedure LEARNING-AND-PLANNING-WITH-LOGICAL-OPTIONS 2 : Given : Propositions P partitioned into subgoals PG , safety props PS , and event props PE Logical FSA T = ( F , PG × PE , TF , RF , f0 , fg ) derived from φliveness Low-level MDP E = ( S , A , RE , TE , γ ) , where RE ( s , a ) = RE ( s , a ) +RS ( TPS ( s ) ) combines the environment and safety rewards Proposition labeling functions TPG : S → 2PG , TPS : S → 2PS , and TPE : 2 PE → { 0 , 1 } 3 : To learn : 4 : Set of options O , one for each subgoal proposition p ∈ PG 5 : Metapolicy µ ( f , s , o ) along with Q ( f , s , o ) and V ( f , s ) 6 : Learn logical options : 7 : For every p in PG , learn an option for achieving p , op = ( Iop , πop , βop , Rop , Top ) 8 : Iop = S 9 : βop = { 1 if p ∈ TPG ( s ) 0 otherwise 10 : πop = optimal policy on E with rollouts terminating when p ∈ TPG ( s ) 11 : Top ( s ′|s ) = { Eγk if p ∈ TPG ( s′ ) , where k is number of time steps to reach p 0 otherwise 12 : Rop ( s ) = E [ RE ( s , a1 ) + γRE ( s1 , a2 ) + · · ·+ γk−1RE ( sk−1 , ak ) ] 13 : Find a metapolicy µ over the options : 14 : Initialize Q : F × S ×O → R and V : F × S → R to 0 15 : For ( k , f , s ) ∈ [ 1 , . . . , n ] ×F × S : 16 : For o ∈ O : 17 : Qk ( f , s , o ) ← RF ( f ) Ro ( s ) + ∑ f ′∈F ∑ p̄e∈2PE ∑ s′∈S TF ( f ′|f , TPG ( s′ ) , p̄e ) 18 : TPE ( p̄e ) To ( s ′|s ) Vk−1 ( f ′ , s′ ) 19 : Vk ( f , s ) ← max o∈O Qk ( f , s , o ) 20 : µ ( f , s , o ) = arg max o∈O Q ( f , s , o ) 21 : return Options O , metapolicy µ ( f , s , o ) and Q- and value functions Q ( f , s , o ) , V ( f , s ) 22 : end procedure appropriate policy-learning algorithm such as PPO or Reward Machines . Next , a metapolicy over the task specification T is found using the learned options and the reward function RSMDP . Logical Options : The first step of Alg . 1 is to learn the logical options . We associate every subgoal p with an option op = ( Iop , πop , βop , Rop , Top ) . These terms are defined starting at Alg . 1 line 6 . Every op has a policy πop whose goal is to reach the state sp where p is true . Options are learned by training on the environment MDP E and terminating only when sp is reached . As we discuss in Sec . 3.1 , under certain conditions the optimal option policy is guaranteed to always terminate at the subgoal . This allows us to simplify the transition model of Eq . 2 to the form in Alg . 1 line 11 . In the experiments , we further simplify this expression by setting γ = 1 . Logical Value Iteration : After finding the logical options , the next step is to find a policy for FSA T over the options , as described in Alg . 1 line 13 . A value function and Q-function are found for the SMDP using the Bellman update equations : Qk ( f , s , o ) ← RF ( f ) Ro ( s ) + ∑ f ′∈F ∑ p̄e∈2PE ∑ s′∈S TF ( f ′|f , TPG ( s′ ) , p̄e ) TPE ( p̄e ) To ( s ′|s ) Vk−1 ( f ′ , s′ ) ( 3 ) Vk ( f , s ) ← max o∈O Qk ( f , s , o ) ( 4 ) Eq . 3 differs from the generic equations for SMDP value iteration in that the transition function has two extra components , ∑ f ′∈F TF ( f ′|f , TP ( s′ ) , p̄e ) and ∑ p̄e∈2PE TPE ( p̄e ) . The equations are derived from Araki et al . ( 2019 ) and the fact that , on every step in the environment , three transitions are applied : the option transition To , the event proposition “ transition ” TPE , and the FSA transition TF . Note that Ro ( s ) and To ( s′|s ) compress the consequences of choosing an option o at a state s from a multi-step trajectory into two real-valued numbers , allowing for more efficient planning . | In this paper, the author proposes logic option framework for learning policies that satisfy the logic constraints. Temporal logic rules are converted into finite state machine and each of them is then converted to a learnable option, where the logic proposition is used as the reward function. Given the options, it searches for the optimal meta-policy over all the options. The LOF is tested on a gridworld and an OpenAI Gym benchmark and is compared against baselines that do not use rules. | SP:0731025a467f9c3e648608248eada5a23aff5b49 |
Filter pre-pruning for improved fine-tuning of quantized deep neural networks | Deep Neural Networks ( DNNs ) have many parameters and activation data , and these both are expensive to implement . One method to reduce the size of the DNN is to quantize the pre-trained model by using a low-bit expression for weights and activations , using fine-tuning to recover the drop in accuracy . However , it is generally difficult to train neural networks which use low-bit expressions . One reason is that the weights in the middle layer of the DNN have a wide dynamic range and so when quantizing the wide dynamic range into a few bits , the step size becomes large , which leads to a large quantization error and finally a large degradation in accuracy . To solve this problem , this paper makes the following three contributions without using any additional learning parameters and hyperparameters . First , we analyze how batch normalization , which causes the aforementioned problem , disturbs the fine-tuning of the quantized DNN . Second , based on these results , we propose a new pruning method called Pruning for Quantization ( PfQ ) which removes the filters that disturb the fine-tuning of the DNN while not affecting the inferred result as far as possible . Third , we propose a workflow of fine-tuning for quantized DNNs using the proposed pruning method ( PfQ ) . Experiments using well-known models and datasets confirmed that the proposed method achieves higher performance with a similar model size than conventional quantization methods including fine-tuning . 1 INTRODUCTION . DNNs ( Deep Neural Networks ) greatly contribute to performance improvement in various tasks and their implementation in edge devices is required . On the other hand , a typical DNN ( He et al. , 2015 ; Simonyan & Zisserman , 2015 ) has the problem that the implementation cost is very large , and it is difficult to operate it on an edge device with limited resources . One approach to this problem is to reduce the implementation cost by quantizing the activations and weights in the DNN . Quantizing a DNN using extremely low bits , such as 1 or 2 bits has been studied by Courbariaux et al . ( 2015 ) and Gu et al . ( 2019 ) . However , it is known that while such a bit reduction has been performed for a large model such as ResNet ( He et al. , 2015 ) , it has not yet been performed for a small model such as MobileNet ( Howard et al. , 2017 ; Sandler et al. , 2018 ; Howard et al. , 2019 ) , and is very difficult to apply to this case . For models that are difficult to quantize , special processing for the DNN is required before quantization . On the other hand , although fine-tuning is essential for quantization with extremely low bit representation , few studies have been conducted on pre-processing for easy fine-tuning of quantized DNNs . In particular , it has been experimentally shown from previous works ( Lan et al. , 2019 ; Frankle & Carbin , 2018 ) that , regardless of quantization , some weights are unnecessary for learning or in fact disturb the learning process . Therefore , we focused on the possibility of the existence of weights that specially disturb the finetuning quantized DNN and to improve the performance of the quantized DNN after fine-tuning by removing those weights . 2 RELATED WORK AND PROBLEM . 2.1 CONVENTIONAL QUANTIZATION WORKS . In order to reduce the implementation cost of DNN in hardware , many methods of reduction by pruning ( Molchanov et al. , 2019 ; You et al. , 2019 ; He et al. , 2019 ) and quantization ( Gu et al. , 2019 ; Gong et al. , 2020 ; Fan et al. , 2020 ; Uhlich et al. , 2019 ; Sheng et al. , 2018 ; Nagel et al. , 2019 ) have been studied . Research is also underway in network architectures such as depthwise convolution and pointwise convolution ( Howard et al. , 2017 ) , which are arithmetic modules that maintain high performance even when both the number of operations and the model capacity are kept small ( Howard et al. , 2017 ; Sandler et al. , 2018 ; Howard et al. , 2019 ) . Knowledge Transfer ( Hinton et al. , 2015 ; Zagoruyko & Komodakis , 2016 ; Radosavovic et al. , 2018 ; Chen et al. , 2019 ) is also being studied as a special learning method for achieving high performance in these compression technologies and compressed architectures . There have been various approaches to studies in DNN compression using quantization . DNN quantization is usually done for activations and weights in DNN . As a basic approach to quantization , there are some methods for a pre-trained model of which one uses only quantization ( Sheng et al. , 2018 ; Nagel et al. , 2019 ) and another uses fine-tuning ( Gong et al. , 2019 ; Gu et al. , 2019 ; Jung et al. , 2019 ; Uhlich et al. , 2019 ; Gong et al. , 2020 ; Fan et al. , 2020 ) . Cardinaux et al . ( 2020 ) and Han et al . ( 2015 ) propose a method for expressing values that are as precise as possible . However , the simplest expression method is easier to calculate and implement in hardware , so expressions to divide the range of quantized values by a linear value ( Jacob et al. , 2018 ; Sheng et al. , 2018 ; Nagel et al. , 2019 ; Gu et al. , 2019 ; Gong et al. , 2019 ; 2020 ; Jung et al. , 2019 ) or a power of 2 value ( Lee et al. , 2017 ; Li et al. , 2019 ) are widely used at present in quantization research . It is known that fine-tuning is essential to quantize DNN with low bits in order not to decrease accuracy as much as possible . Jacob et al . ( 2018 ) shows that an accuracy improvement can be expected by fine-tuning with quantization . Since the quantization function is usually non-differentiable , the gradient in the quantization function is often approximated by STE ( Bengio et al. , 2013 ) . However , in the case of quantization with low bits , the error is very large in the approximation by STE , and it is known that it is difficult to accurately propagate the gradient backward from the output side to the input side , making learning difficult . In order to solve this problem , Gong et al . ( 2019 ) , Fan et al . ( 2020 ) and Darabi et al . ( 2018 ) proposed the backward quantization function so that the gradient can be propagated to the input side as accurately as possible . Gu et al . ( 2019 ) and Banner et al . ( 2018 ) considered activations and weights in DNN as random variables , and proposed an approach to optimize the stochastic model behind DNN so that activations and weights in DNN become vectors which are easy to quantize . Jung et al . ( 2019 ) and Uhlich et al . ( 2019 ) considered that it is important for performance to determine the dynamic range of vectors to be quantized appropriately , and it is proposed that this dynamic range is also learned as a learning parameter . 2.2 PROBLEM OF WIDE DYNAMIC RANGE ON QUANTIZATION . It is important to set the dynamic range appropriately in the quantization . In modern network architectures , most of the computation is made up of a block of convolution and batch normalization ( BN ) . It is known that the above block can be replaced by the equivalent convolution , and quantization is performed after this replacement . Thus , it is possible to suppress the quantization error rather than quantizing the convolution and BN separately . On the other hand , it is also known that the dynamic range of the convolution may be increased by this replacement ( Sheng et al. , 2018 ; Nagel et al. , 2019 ) . In order to explain this in detail , the calculation formulas of convolution and BN in pre-training are described . First , the equation for convolution is described as follows C ( o , j , k ) = ∑ i ∑ ( u , v ) w ( o , i , u , v ) x ( i , j+u , k+v ) + b ( o ) , ( 1 ) where C ( o , j , k ) is the o-th convolution output feature at the coordinate ( j , k ) , w ( o , i , u , v ) is the weight of the kernel coordinates ( u , v ) in the i-th input map , and x ( i , j+u , k+v ) is the input data . For simplicity , C ( o , j , k ) is represented as vector C ( o ) = ( c ( o,1 ) , ... , c ( o , N ) ) 1 and w ( o , i , u , v ) is represented as vector w ( o , i ) if it is not necessary . Next , the calculation formula for BN is described as B ( o ) = C ( o ) − µ ( o ) √ ( σ ( o ) ) 2 + ǫ γ ( o ) + β ( o ) , ( 2 ) where B ( o ) is the o-th BN output feature 2. µ ( o ) , ( σ ( o ) ) 2 are respectively calculated by equation ( 3 ) , ( 4 ) during the training or by equation ( 7 ) , ( 8 ) during the inference . γ ( o ) , β ( o ) are respectively the scaling factor and shift amounts of BN . The mean and variance are calculated as µ ( o ) = 1 N N ∑ n c ( o , n ) ( 3 ) ( σ ( o ) ) 2 = 1 N N ∑ n ∣ ∣c ( o , n ) − µ ( o ) ∣ ∣ 2 . ( 4 ) At the time of inference or the fine-tuning of quantization for the pre-trained model , BN can be folded into convolution by inserting equation ( 1 ) into ( 2 ) . The new weight ( ŵ ( o , i , u , v ) ) and bias ( b̂ ( o ) ) of the convolution when BN is folded in the convolution are calculated by ŵ ( o , i ) = γ ( o ) √ V ( τ ) ( o ) + ǫ w ( o , i ) ( 5 ) b̂ ( o ) = γ ( o ) √ V ( τ ) ( o ) + ǫ b ( o ) + β ( o ) − γ ( o ) √ V ( τ ) ( o ) + ǫ M ( τ ) ( o ) , ( 6 ) where M ( τ ) ( o ) , V ( τ ) ( o ) are respectively the mean ( running mean ) and variance ( running variance ) of BN used at inference , and the values are calculated as M ( τ ) ( o ) = M ( τ−1 ) ( o ) ρ+ µ ( o ) ( 1− ρ ) ( 7 ) V ( τ ) ( o ) = V ( τ−1 ) ( o ) ρ+ ( σ ( o ) ) 2 ( 1− ρ ) N N − 1 , ( 8 ) where τ is an iteration index , and is omitted in this paper when not specifically needed , and ρ is a hyper-parameter of BN in pre-training so that 0 < ρ < 1 . The initial values of ( 7 ) and ( 8 ) are set before learning in the same way as weights such as convolution . Sheng et al . ( 2018 ) pointed out that the dynamic range of the weights of depthwise convolution is 1 N is the number of elements in a channel C ( o ) . 2Vector and scalar operations are performed by implicitly broadcasting scalars . large , which leads to the large quantization error . They also pointed out the relationship that the filters ( sets of weights ) with wide dynamic range correspond to the running variances of the BN with small magnitude . Nagel et al . ( 2019 ) attacked this problem by adjusting scales of weights of consecutive depthwise and pointwise convolutions without affecting the outputs of the pointwise convolution . However , they can not solve the problem in quantization completely . In this study , we theoretically analyze the weights with the running variances which have small magnitude and show that certain weights disturb the fine-tuning of the quantized DNN . Based on this analysis , we propose a new quantization training method which can solve the problem and improve the performance ( section 4 ) . | This work present a Pruning mechanism for Quantization scenario. Duo to the low-bits effects, the quantized network is hard to train properly. Therefore, authors provide a new method call Pruning for Quantization (PfQ) and a workflow to solve the model compression problem practically. Comparing to some current quantization methods, PfQ obtains some gain from solution to the performance on benchmark datasets such as ImageNet and CIFAR100. | SP:43fc643b6ac6560e48804865dd7a57398743b664 |
Filter pre-pruning for improved fine-tuning of quantized deep neural networks | Deep Neural Networks ( DNNs ) have many parameters and activation data , and these both are expensive to implement . One method to reduce the size of the DNN is to quantize the pre-trained model by using a low-bit expression for weights and activations , using fine-tuning to recover the drop in accuracy . However , it is generally difficult to train neural networks which use low-bit expressions . One reason is that the weights in the middle layer of the DNN have a wide dynamic range and so when quantizing the wide dynamic range into a few bits , the step size becomes large , which leads to a large quantization error and finally a large degradation in accuracy . To solve this problem , this paper makes the following three contributions without using any additional learning parameters and hyperparameters . First , we analyze how batch normalization , which causes the aforementioned problem , disturbs the fine-tuning of the quantized DNN . Second , based on these results , we propose a new pruning method called Pruning for Quantization ( PfQ ) which removes the filters that disturb the fine-tuning of the DNN while not affecting the inferred result as far as possible . Third , we propose a workflow of fine-tuning for quantized DNNs using the proposed pruning method ( PfQ ) . Experiments using well-known models and datasets confirmed that the proposed method achieves higher performance with a similar model size than conventional quantization methods including fine-tuning . 1 INTRODUCTION . DNNs ( Deep Neural Networks ) greatly contribute to performance improvement in various tasks and their implementation in edge devices is required . On the other hand , a typical DNN ( He et al. , 2015 ; Simonyan & Zisserman , 2015 ) has the problem that the implementation cost is very large , and it is difficult to operate it on an edge device with limited resources . One approach to this problem is to reduce the implementation cost by quantizing the activations and weights in the DNN . Quantizing a DNN using extremely low bits , such as 1 or 2 bits has been studied by Courbariaux et al . ( 2015 ) and Gu et al . ( 2019 ) . However , it is known that while such a bit reduction has been performed for a large model such as ResNet ( He et al. , 2015 ) , it has not yet been performed for a small model such as MobileNet ( Howard et al. , 2017 ; Sandler et al. , 2018 ; Howard et al. , 2019 ) , and is very difficult to apply to this case . For models that are difficult to quantize , special processing for the DNN is required before quantization . On the other hand , although fine-tuning is essential for quantization with extremely low bit representation , few studies have been conducted on pre-processing for easy fine-tuning of quantized DNNs . In particular , it has been experimentally shown from previous works ( Lan et al. , 2019 ; Frankle & Carbin , 2018 ) that , regardless of quantization , some weights are unnecessary for learning or in fact disturb the learning process . Therefore , we focused on the possibility of the existence of weights that specially disturb the finetuning quantized DNN and to improve the performance of the quantized DNN after fine-tuning by removing those weights . 2 RELATED WORK AND PROBLEM . 2.1 CONVENTIONAL QUANTIZATION WORKS . In order to reduce the implementation cost of DNN in hardware , many methods of reduction by pruning ( Molchanov et al. , 2019 ; You et al. , 2019 ; He et al. , 2019 ) and quantization ( Gu et al. , 2019 ; Gong et al. , 2020 ; Fan et al. , 2020 ; Uhlich et al. , 2019 ; Sheng et al. , 2018 ; Nagel et al. , 2019 ) have been studied . Research is also underway in network architectures such as depthwise convolution and pointwise convolution ( Howard et al. , 2017 ) , which are arithmetic modules that maintain high performance even when both the number of operations and the model capacity are kept small ( Howard et al. , 2017 ; Sandler et al. , 2018 ; Howard et al. , 2019 ) . Knowledge Transfer ( Hinton et al. , 2015 ; Zagoruyko & Komodakis , 2016 ; Radosavovic et al. , 2018 ; Chen et al. , 2019 ) is also being studied as a special learning method for achieving high performance in these compression technologies and compressed architectures . There have been various approaches to studies in DNN compression using quantization . DNN quantization is usually done for activations and weights in DNN . As a basic approach to quantization , there are some methods for a pre-trained model of which one uses only quantization ( Sheng et al. , 2018 ; Nagel et al. , 2019 ) and another uses fine-tuning ( Gong et al. , 2019 ; Gu et al. , 2019 ; Jung et al. , 2019 ; Uhlich et al. , 2019 ; Gong et al. , 2020 ; Fan et al. , 2020 ) . Cardinaux et al . ( 2020 ) and Han et al . ( 2015 ) propose a method for expressing values that are as precise as possible . However , the simplest expression method is easier to calculate and implement in hardware , so expressions to divide the range of quantized values by a linear value ( Jacob et al. , 2018 ; Sheng et al. , 2018 ; Nagel et al. , 2019 ; Gu et al. , 2019 ; Gong et al. , 2019 ; 2020 ; Jung et al. , 2019 ) or a power of 2 value ( Lee et al. , 2017 ; Li et al. , 2019 ) are widely used at present in quantization research . It is known that fine-tuning is essential to quantize DNN with low bits in order not to decrease accuracy as much as possible . Jacob et al . ( 2018 ) shows that an accuracy improvement can be expected by fine-tuning with quantization . Since the quantization function is usually non-differentiable , the gradient in the quantization function is often approximated by STE ( Bengio et al. , 2013 ) . However , in the case of quantization with low bits , the error is very large in the approximation by STE , and it is known that it is difficult to accurately propagate the gradient backward from the output side to the input side , making learning difficult . In order to solve this problem , Gong et al . ( 2019 ) , Fan et al . ( 2020 ) and Darabi et al . ( 2018 ) proposed the backward quantization function so that the gradient can be propagated to the input side as accurately as possible . Gu et al . ( 2019 ) and Banner et al . ( 2018 ) considered activations and weights in DNN as random variables , and proposed an approach to optimize the stochastic model behind DNN so that activations and weights in DNN become vectors which are easy to quantize . Jung et al . ( 2019 ) and Uhlich et al . ( 2019 ) considered that it is important for performance to determine the dynamic range of vectors to be quantized appropriately , and it is proposed that this dynamic range is also learned as a learning parameter . 2.2 PROBLEM OF WIDE DYNAMIC RANGE ON QUANTIZATION . It is important to set the dynamic range appropriately in the quantization . In modern network architectures , most of the computation is made up of a block of convolution and batch normalization ( BN ) . It is known that the above block can be replaced by the equivalent convolution , and quantization is performed after this replacement . Thus , it is possible to suppress the quantization error rather than quantizing the convolution and BN separately . On the other hand , it is also known that the dynamic range of the convolution may be increased by this replacement ( Sheng et al. , 2018 ; Nagel et al. , 2019 ) . In order to explain this in detail , the calculation formulas of convolution and BN in pre-training are described . First , the equation for convolution is described as follows C ( o , j , k ) = ∑ i ∑ ( u , v ) w ( o , i , u , v ) x ( i , j+u , k+v ) + b ( o ) , ( 1 ) where C ( o , j , k ) is the o-th convolution output feature at the coordinate ( j , k ) , w ( o , i , u , v ) is the weight of the kernel coordinates ( u , v ) in the i-th input map , and x ( i , j+u , k+v ) is the input data . For simplicity , C ( o , j , k ) is represented as vector C ( o ) = ( c ( o,1 ) , ... , c ( o , N ) ) 1 and w ( o , i , u , v ) is represented as vector w ( o , i ) if it is not necessary . Next , the calculation formula for BN is described as B ( o ) = C ( o ) − µ ( o ) √ ( σ ( o ) ) 2 + ǫ γ ( o ) + β ( o ) , ( 2 ) where B ( o ) is the o-th BN output feature 2. µ ( o ) , ( σ ( o ) ) 2 are respectively calculated by equation ( 3 ) , ( 4 ) during the training or by equation ( 7 ) , ( 8 ) during the inference . γ ( o ) , β ( o ) are respectively the scaling factor and shift amounts of BN . The mean and variance are calculated as µ ( o ) = 1 N N ∑ n c ( o , n ) ( 3 ) ( σ ( o ) ) 2 = 1 N N ∑ n ∣ ∣c ( o , n ) − µ ( o ) ∣ ∣ 2 . ( 4 ) At the time of inference or the fine-tuning of quantization for the pre-trained model , BN can be folded into convolution by inserting equation ( 1 ) into ( 2 ) . The new weight ( ŵ ( o , i , u , v ) ) and bias ( b̂ ( o ) ) of the convolution when BN is folded in the convolution are calculated by ŵ ( o , i ) = γ ( o ) √ V ( τ ) ( o ) + ǫ w ( o , i ) ( 5 ) b̂ ( o ) = γ ( o ) √ V ( τ ) ( o ) + ǫ b ( o ) + β ( o ) − γ ( o ) √ V ( τ ) ( o ) + ǫ M ( τ ) ( o ) , ( 6 ) where M ( τ ) ( o ) , V ( τ ) ( o ) are respectively the mean ( running mean ) and variance ( running variance ) of BN used at inference , and the values are calculated as M ( τ ) ( o ) = M ( τ−1 ) ( o ) ρ+ µ ( o ) ( 1− ρ ) ( 7 ) V ( τ ) ( o ) = V ( τ−1 ) ( o ) ρ+ ( σ ( o ) ) 2 ( 1− ρ ) N N − 1 , ( 8 ) where τ is an iteration index , and is omitted in this paper when not specifically needed , and ρ is a hyper-parameter of BN in pre-training so that 0 < ρ < 1 . The initial values of ( 7 ) and ( 8 ) are set before learning in the same way as weights such as convolution . Sheng et al . ( 2018 ) pointed out that the dynamic range of the weights of depthwise convolution is 1 N is the number of elements in a channel C ( o ) . 2Vector and scalar operations are performed by implicitly broadcasting scalars . large , which leads to the large quantization error . They also pointed out the relationship that the filters ( sets of weights ) with wide dynamic range correspond to the running variances of the BN with small magnitude . Nagel et al . ( 2019 ) attacked this problem by adjusting scales of weights of consecutive depthwise and pointwise convolutions without affecting the outputs of the pointwise convolution . However , they can not solve the problem in quantization completely . In this study , we theoretically analyze the weights with the running variances which have small magnitude and show that certain weights disturb the fine-tuning of the quantized DNN . Based on this analysis , we propose a new quantization training method which can solve the problem and improve the performance ( section 4 ) . | This paper studies the effect of quantization during training together with batch normalization in quantized deep neural networks. The compound effect of convolution and batch normalization on the dynamic range of activations has implications on the progress of training. The authors propose a protocol for training a quantized neural network combining filter pruning, fine tuning and bias correction. The experiments show that the model size is reduced significantly, while keeping or improving the accuracy. | SP:43fc643b6ac6560e48804865dd7a57398743b664 |
Filter pre-pruning for improved fine-tuning of quantized deep neural networks | Deep Neural Networks ( DNNs ) have many parameters and activation data , and these both are expensive to implement . One method to reduce the size of the DNN is to quantize the pre-trained model by using a low-bit expression for weights and activations , using fine-tuning to recover the drop in accuracy . However , it is generally difficult to train neural networks which use low-bit expressions . One reason is that the weights in the middle layer of the DNN have a wide dynamic range and so when quantizing the wide dynamic range into a few bits , the step size becomes large , which leads to a large quantization error and finally a large degradation in accuracy . To solve this problem , this paper makes the following three contributions without using any additional learning parameters and hyperparameters . First , we analyze how batch normalization , which causes the aforementioned problem , disturbs the fine-tuning of the quantized DNN . Second , based on these results , we propose a new pruning method called Pruning for Quantization ( PfQ ) which removes the filters that disturb the fine-tuning of the DNN while not affecting the inferred result as far as possible . Third , we propose a workflow of fine-tuning for quantized DNNs using the proposed pruning method ( PfQ ) . Experiments using well-known models and datasets confirmed that the proposed method achieves higher performance with a similar model size than conventional quantization methods including fine-tuning . 1 INTRODUCTION . DNNs ( Deep Neural Networks ) greatly contribute to performance improvement in various tasks and their implementation in edge devices is required . On the other hand , a typical DNN ( He et al. , 2015 ; Simonyan & Zisserman , 2015 ) has the problem that the implementation cost is very large , and it is difficult to operate it on an edge device with limited resources . One approach to this problem is to reduce the implementation cost by quantizing the activations and weights in the DNN . Quantizing a DNN using extremely low bits , such as 1 or 2 bits has been studied by Courbariaux et al . ( 2015 ) and Gu et al . ( 2019 ) . However , it is known that while such a bit reduction has been performed for a large model such as ResNet ( He et al. , 2015 ) , it has not yet been performed for a small model such as MobileNet ( Howard et al. , 2017 ; Sandler et al. , 2018 ; Howard et al. , 2019 ) , and is very difficult to apply to this case . For models that are difficult to quantize , special processing for the DNN is required before quantization . On the other hand , although fine-tuning is essential for quantization with extremely low bit representation , few studies have been conducted on pre-processing for easy fine-tuning of quantized DNNs . In particular , it has been experimentally shown from previous works ( Lan et al. , 2019 ; Frankle & Carbin , 2018 ) that , regardless of quantization , some weights are unnecessary for learning or in fact disturb the learning process . Therefore , we focused on the possibility of the existence of weights that specially disturb the finetuning quantized DNN and to improve the performance of the quantized DNN after fine-tuning by removing those weights . 2 RELATED WORK AND PROBLEM . 2.1 CONVENTIONAL QUANTIZATION WORKS . In order to reduce the implementation cost of DNN in hardware , many methods of reduction by pruning ( Molchanov et al. , 2019 ; You et al. , 2019 ; He et al. , 2019 ) and quantization ( Gu et al. , 2019 ; Gong et al. , 2020 ; Fan et al. , 2020 ; Uhlich et al. , 2019 ; Sheng et al. , 2018 ; Nagel et al. , 2019 ) have been studied . Research is also underway in network architectures such as depthwise convolution and pointwise convolution ( Howard et al. , 2017 ) , which are arithmetic modules that maintain high performance even when both the number of operations and the model capacity are kept small ( Howard et al. , 2017 ; Sandler et al. , 2018 ; Howard et al. , 2019 ) . Knowledge Transfer ( Hinton et al. , 2015 ; Zagoruyko & Komodakis , 2016 ; Radosavovic et al. , 2018 ; Chen et al. , 2019 ) is also being studied as a special learning method for achieving high performance in these compression technologies and compressed architectures . There have been various approaches to studies in DNN compression using quantization . DNN quantization is usually done for activations and weights in DNN . As a basic approach to quantization , there are some methods for a pre-trained model of which one uses only quantization ( Sheng et al. , 2018 ; Nagel et al. , 2019 ) and another uses fine-tuning ( Gong et al. , 2019 ; Gu et al. , 2019 ; Jung et al. , 2019 ; Uhlich et al. , 2019 ; Gong et al. , 2020 ; Fan et al. , 2020 ) . Cardinaux et al . ( 2020 ) and Han et al . ( 2015 ) propose a method for expressing values that are as precise as possible . However , the simplest expression method is easier to calculate and implement in hardware , so expressions to divide the range of quantized values by a linear value ( Jacob et al. , 2018 ; Sheng et al. , 2018 ; Nagel et al. , 2019 ; Gu et al. , 2019 ; Gong et al. , 2019 ; 2020 ; Jung et al. , 2019 ) or a power of 2 value ( Lee et al. , 2017 ; Li et al. , 2019 ) are widely used at present in quantization research . It is known that fine-tuning is essential to quantize DNN with low bits in order not to decrease accuracy as much as possible . Jacob et al . ( 2018 ) shows that an accuracy improvement can be expected by fine-tuning with quantization . Since the quantization function is usually non-differentiable , the gradient in the quantization function is often approximated by STE ( Bengio et al. , 2013 ) . However , in the case of quantization with low bits , the error is very large in the approximation by STE , and it is known that it is difficult to accurately propagate the gradient backward from the output side to the input side , making learning difficult . In order to solve this problem , Gong et al . ( 2019 ) , Fan et al . ( 2020 ) and Darabi et al . ( 2018 ) proposed the backward quantization function so that the gradient can be propagated to the input side as accurately as possible . Gu et al . ( 2019 ) and Banner et al . ( 2018 ) considered activations and weights in DNN as random variables , and proposed an approach to optimize the stochastic model behind DNN so that activations and weights in DNN become vectors which are easy to quantize . Jung et al . ( 2019 ) and Uhlich et al . ( 2019 ) considered that it is important for performance to determine the dynamic range of vectors to be quantized appropriately , and it is proposed that this dynamic range is also learned as a learning parameter . 2.2 PROBLEM OF WIDE DYNAMIC RANGE ON QUANTIZATION . It is important to set the dynamic range appropriately in the quantization . In modern network architectures , most of the computation is made up of a block of convolution and batch normalization ( BN ) . It is known that the above block can be replaced by the equivalent convolution , and quantization is performed after this replacement . Thus , it is possible to suppress the quantization error rather than quantizing the convolution and BN separately . On the other hand , it is also known that the dynamic range of the convolution may be increased by this replacement ( Sheng et al. , 2018 ; Nagel et al. , 2019 ) . In order to explain this in detail , the calculation formulas of convolution and BN in pre-training are described . First , the equation for convolution is described as follows C ( o , j , k ) = ∑ i ∑ ( u , v ) w ( o , i , u , v ) x ( i , j+u , k+v ) + b ( o ) , ( 1 ) where C ( o , j , k ) is the o-th convolution output feature at the coordinate ( j , k ) , w ( o , i , u , v ) is the weight of the kernel coordinates ( u , v ) in the i-th input map , and x ( i , j+u , k+v ) is the input data . For simplicity , C ( o , j , k ) is represented as vector C ( o ) = ( c ( o,1 ) , ... , c ( o , N ) ) 1 and w ( o , i , u , v ) is represented as vector w ( o , i ) if it is not necessary . Next , the calculation formula for BN is described as B ( o ) = C ( o ) − µ ( o ) √ ( σ ( o ) ) 2 + ǫ γ ( o ) + β ( o ) , ( 2 ) where B ( o ) is the o-th BN output feature 2. µ ( o ) , ( σ ( o ) ) 2 are respectively calculated by equation ( 3 ) , ( 4 ) during the training or by equation ( 7 ) , ( 8 ) during the inference . γ ( o ) , β ( o ) are respectively the scaling factor and shift amounts of BN . The mean and variance are calculated as µ ( o ) = 1 N N ∑ n c ( o , n ) ( 3 ) ( σ ( o ) ) 2 = 1 N N ∑ n ∣ ∣c ( o , n ) − µ ( o ) ∣ ∣ 2 . ( 4 ) At the time of inference or the fine-tuning of quantization for the pre-trained model , BN can be folded into convolution by inserting equation ( 1 ) into ( 2 ) . The new weight ( ŵ ( o , i , u , v ) ) and bias ( b̂ ( o ) ) of the convolution when BN is folded in the convolution are calculated by ŵ ( o , i ) = γ ( o ) √ V ( τ ) ( o ) + ǫ w ( o , i ) ( 5 ) b̂ ( o ) = γ ( o ) √ V ( τ ) ( o ) + ǫ b ( o ) + β ( o ) − γ ( o ) √ V ( τ ) ( o ) + ǫ M ( τ ) ( o ) , ( 6 ) where M ( τ ) ( o ) , V ( τ ) ( o ) are respectively the mean ( running mean ) and variance ( running variance ) of BN used at inference , and the values are calculated as M ( τ ) ( o ) = M ( τ−1 ) ( o ) ρ+ µ ( o ) ( 1− ρ ) ( 7 ) V ( τ ) ( o ) = V ( τ−1 ) ( o ) ρ+ ( σ ( o ) ) 2 ( 1− ρ ) N N − 1 , ( 8 ) where τ is an iteration index , and is omitted in this paper when not specifically needed , and ρ is a hyper-parameter of BN in pre-training so that 0 < ρ < 1 . The initial values of ( 7 ) and ( 8 ) are set before learning in the same way as weights such as convolution . Sheng et al . ( 2018 ) pointed out that the dynamic range of the weights of depthwise convolution is 1 N is the number of elements in a channel C ( o ) . 2Vector and scalar operations are performed by implicitly broadcasting scalars . large , which leads to the large quantization error . They also pointed out the relationship that the filters ( sets of weights ) with wide dynamic range correspond to the running variances of the BN with small magnitude . Nagel et al . ( 2019 ) attacked this problem by adjusting scales of weights of consecutive depthwise and pointwise convolutions without affecting the outputs of the pointwise convolution . However , they can not solve the problem in quantization completely . In this study , we theoretically analyze the weights with the running variances which have small magnitude and show that certain weights disturb the fine-tuning of the quantized DNN . Based on this analysis , we propose a new quantization training method which can solve the problem and improve the performance ( section 4 ) . | This paper proposed to prune certain channels to improve the accuracy of quantized DNN model. The motivation comes from the observation that the channels which have small variance are actually harmful to the quantization-aware training. The authors show that these channels with small variance can be pruned without significant influence to the neural network, and the accuracy loss can be easily recovered with fine-tuning. | SP:43fc643b6ac6560e48804865dd7a57398743b664 |
It Is Likely That Your Loss Should be a Likelihood | 1 INTRODUCTION . Choosing the right loss matters . Many common losses arise from likelihoods , such as the squared error loss from the normal distribution , absolute error from the Laplace distribution , and the cross entropy loss from the softmax distribution . The same is true of regularizers , where L2 arises from a normal prior and L1 from a Laplace prior . Deriving losses from likelihoods recasts the problem as a choice of distribution which allows datadependent adaptation . Standard losses and regularizers implicitly fix key distribution parameters , limiting flexibility . For instance , the squared error corresponds to fixing the normal variance at a constant . The full normal likelihood retains its scale parameter and allows optimization over a parametrized set of distributions . This work examines how to jointly optimize distribution and model parameters to select losses and regularizers that encourage generalization , calibration , and robustness to outliers . We explore three key likelihoods : the normal , softmax , and the robust regression likelihood ρ of Barron ( 2019 ) . Additionally , we cast adaptive priors in the same light and introduce adaptive regularizers . Our contributions : 1 . We systematically survey and evaluate global , data , and predicted likelihood parameters and introduce a new self-tuning variant of the robust adaptive loss ρ 2 . We apply likelihood parameters to create new classes of robust models , outlier detectors , and re-calibrators . 3 . We propose adaptive versions of L1 and L2 regularization using parameterized normal and Laplace priors on model parameters . 2 BACKGROUND . Notation We consider a dataset D of points xi and targets yi indexed by i ∈ { 1 , . . . , N } . Targets for regression are real numbers and targets for classification are one-hot vectors . The model f with parameters θ makes predictions ŷi = fθ ( x ) . A loss L ( ŷ , y ) measures the quality of the prediction given the target . To learn model parameters we solve the following loss optimization : min θ E ( x , y ) ∼D L ( ŷ = fθ ( x ) , y ) ( 1 ) A likelihood L ( ŷ|y , φ ) measures the quality of the prediction as a distribution over ŷ given the target y and likelihood parameters φ . We use the negative log-likelihood ` ( NLL ) , and the likelihood interchangeably since both have the same optima . We define the full likelihood optimization : min θ , φ E ( x , y ) ∼D ` ( ŷ = fθ ( x ) |y , φ ) ( 2 ) to jointly learn model and likelihood parameters . “ Full ” indicates the inclusion of φ , which controls the distribution and induced NLL loss . We focus on full likelihood optimization in this work . We note that the target , y , is the only supervision needed to optimize model and likelihood parameters , θ and φ respectively . Additionally , though the shape and scale varies with φ , reducing the error ŷ−y always reduces the NLL for our distributions . Distributions Under Investigation This work considers the normal likelihood with variance σ ( Bishop et al. , 2006 ; Hastie et al. , 2009 ) , the softmax likelihood with temperature τ ( Hinton et al. , 2015 ) , and the robust likelihood ρ ( Barron , 2019 ) with shape α and scale σ that control the scale and shape of the likelihood . The first two are among the most common losses in machine learning , and the last loss provides an important illustration of a likelihood parameter that affects “ shape ” instead of “ scale ” . We note that changing the scale and shape of the likelihood distribution is not “ cheating ” as there is a trade-off between uncertainty and credit . Figure 1 shows how this trade-off affects the Normal and softmax distributions and their NLLs . The normal likelihood has terms for the residual ŷ − y and the variance σ as N ( ŷ|y , σ ) = ( 2πσ2 ) − 12 exp ( −1 2 ( ŷ − y ) 2 σ2 ) , ( 3 ) with σ ∈ ( 0 , ∞ ) scaling the distribution . The normal NLL can be written ` N = 12σ2 ( ŷ−y ) 2+log σ , after simplifying and omitting constants that do not affect minimization . We recover the squared error by substituting σ = 1 . The softmax defines a categorical distribution defined by scores z for each class c as softmax ( ŷ = y|z , τ ) = e zyτ∑ c e zcτ , ( 4 ) with the temperature , τ ∈ ( 0 , ∞ ) , adjusting the entropy of the distribution . We recover the classification cross-entropy loss , − log p ( ŷ = y ) , by substituting τ = 1 in the respective NLL . We state the gradients of these likelihoods with respect to their σ and τ in Section A of the supplement . The robust loss ρ and its likelihood are ρ ( x , α , σ ) = |α− 2| α ( ( x/σ ) 2 |α− 2| + 1 ) α/2 − 1 and ( 5 ) p ( ŷ | y , α , σ ) = 1 σZ ( α ) exp ( −ρ ( ŷ − y , α , σ ) ) , ( 6 ) with shape α ∈ [ 0 , ∞ ) , scale σ ∈ ( 0 , ∞ ) , and normalization function Z ( α ) . This robust loss , ρ , has the interesting property that it generalizes several different loss functions commonly used in robust learning such as the L2 loss ( α = 2 ) , pseudo-huber loss ( Charbonnier et al. , 1997 ) ( α = 1 ) , Cauchy loss ( Li et al. , 2018 ) ( α = 0 ) , Geman-McClure loss ( Ganan & McClure , 1985 ) , ( α = −2 ) , and Welsch ( Dennis Jr & Welsch , 1978 ) loss ( alpha = −∞ ) . Learning the shape parameter allows models to adapt the shape of their noise distribution . 3 RELATED WORK . Likelihood optimization follows from maximum likelihood estimation ( Hastie et al. , 2009 ; Bishop et al. , 2006 ) , yet is uncommon in practice for fitting deep regressors and classifiers for discriminative tasks . However Kendall & Gal ( 2017 ) ; Kendall et al . ( 2018 ) ; Barron ( 2019 ) ; Saxena et al . ( 2019 ) optimize likelihood parameters to their advantage yet differ in their tasks , likelihoods , and parameterizations . In this work we aim to systematically experiment , clarify usage , and encourage their wider adoption . Early work on regressing means and variances ( Nix & Weigend , 1994 ) had the key insight that optimizing the full likelihood can fit these parameters and adapt the loss . Some recent works use likelihoods for loss adaptation , and interpret their parameters as the uncertainty ( Kendall & Gal , 2017 ; Kendall et al. , 2018 ) , robustness ( Kendall & Gal , 2017 ; Barron , 2019 ; Saxena et al. , 2019 ) , and curricula ( Saxena et al. , 2019 ) of losses . MacKay & Mac Kay ( 2003 ) uses Bayesian evidence to select hyper-parameters and losses based on proper likelihood normalization . Barron ( 2019 ) define a generalized robust regression loss , ρ , to jointly optimize the type and degree of robustness with global , data-independent , parameters . Kendall & Gal ( 2017 ) predict variances for regression and classification to handle data-dependent uncertainty . Kendall et al . ( 2018 ) balance multi-task loss weights by optimizing variances for regression and temperatures for classification . These global parameters depend on the task but not the data , and are interpreted as inherent task uncertainty . Saxena et al . ( 2019 ) define a differentiable curriculum for classification by assigning each training point its own temperature . These data parameters depend on the index of the data but not its value . We compare these different likelihood parameterizations across tasks and distributions . In the calibration literature , Guo et al . ( 2017 ) have found that deep networks are often miscalibrated , but they can be re-calibrated by cross-validating the temperature of the softmax . In this work we explore several generalizations of this concept . Alternatively , Platt scaling ( Platt , 1999 ) fits a sigmoid regressor to model predictions to calibrate probabilities . Kuleshov et al . ( 2018 ) re-calibrate regressors by fitting an Isotonic regressor to the empirical cumulative distribution function . 4 LIKELIHOOD PARAMETER TYPES . We explore the space of likelihood parameter representations for model optimization and inference . Though we note that some losses , like adversarial losses , are difficult to represent as likelihoods , many different losses in the community have a natural probabilistic interpretation . Often , these probabilistic interpretations can be parametrized in a variety of ways . We explore two key axes of generality when building these loss functions : conditioning and dimensionality . Conditioning We represent the likelihood parameters by three functional classes : global , data , and predicted . Global parameters , φ = c , are independent of the data and model and define the same likelihood distribution for all points . Data parameters , φi , are conditioned on the index , i , of the data , xi , but not its value . Every training point is assigned an independent likelihood parameter , φi that define different likelihoods for each training point . Predicted parameters , φ ( x ) = gη ( x ) , are determined by a model , g , with parameters η ( not to be confused with the task model parameters θ ) . Global and predicted parameters can be used during training and testing , but data parameters are only assigned to each training point and are undefined for testing . We show a simple example of predicted temperature in Figure 4 , and an illustration of the parameter types in Figure 2 . We note that for certain global parameters like a learned Normal scale , changing the scale does not affect the optima , but does change the probabilistic interpretation . This invariance has led many authors to drop the scale from their formulations . However , when models can predict these scale parameters they can naturally remain calibrated in the presence of heteroskedasticity and outliers . conditioning : global , predicted , and data . Each represents a different way to parametrize the model ’ s temperature . Each represents a possible way to parametrize the additional scale parameter added to the loss . Dimensionality The dimensionality , |φ| , of likelihood parameters can vary with the dimension of the task prediction , ŷ . For example , image regressors can use a single likelihood parameter for each image |φ| = 1 , RGB image channel |φ| = C , or even every pixel |φ| = W × H × C as in Figure 3 . These choices correspond to different likelihood distribution classes . Dimensionality and Conditioning of likelihood parameters can interact . For example , data parameters with |φ| = W × H × C would result in N ×W × H × C additional parameters , where N is the size of the dataset . This can complicate implementations and slow down optimization due to disk I/O when their size exceeds memory . Table 5 in the appendix contrasts the computational requirements of different likelihood parameter types . The work of Barron ( 2019 ) explores both scalar and pixel-wise dimensionalities for his robust loss . 5 APPLICATIONS | The paper proposes the use of complete parametrized likelihoods for providing supervision in place of the commonly used loss functions. The normal distribution, the categorical distribution defined by softmax and the likelihood of the robust rho-estimator are considered. The main idea is that by including the parameters of these likelihoods and optimizing over them, one can increase robustness, detect outliers and achieve re-calibration. In addition, by considering parametric priors and tuning their parameters one can obtain more flexible regularizers over the trainable parameters of a model. | SP:c3b3b5c69080aba6363c9120e42b3e68ea633c68 |
It Is Likely That Your Loss Should be a Likelihood | 1 INTRODUCTION . Choosing the right loss matters . Many common losses arise from likelihoods , such as the squared error loss from the normal distribution , absolute error from the Laplace distribution , and the cross entropy loss from the softmax distribution . The same is true of regularizers , where L2 arises from a normal prior and L1 from a Laplace prior . Deriving losses from likelihoods recasts the problem as a choice of distribution which allows datadependent adaptation . Standard losses and regularizers implicitly fix key distribution parameters , limiting flexibility . For instance , the squared error corresponds to fixing the normal variance at a constant . The full normal likelihood retains its scale parameter and allows optimization over a parametrized set of distributions . This work examines how to jointly optimize distribution and model parameters to select losses and regularizers that encourage generalization , calibration , and robustness to outliers . We explore three key likelihoods : the normal , softmax , and the robust regression likelihood ρ of Barron ( 2019 ) . Additionally , we cast adaptive priors in the same light and introduce adaptive regularizers . Our contributions : 1 . We systematically survey and evaluate global , data , and predicted likelihood parameters and introduce a new self-tuning variant of the robust adaptive loss ρ 2 . We apply likelihood parameters to create new classes of robust models , outlier detectors , and re-calibrators . 3 . We propose adaptive versions of L1 and L2 regularization using parameterized normal and Laplace priors on model parameters . 2 BACKGROUND . Notation We consider a dataset D of points xi and targets yi indexed by i ∈ { 1 , . . . , N } . Targets for regression are real numbers and targets for classification are one-hot vectors . The model f with parameters θ makes predictions ŷi = fθ ( x ) . A loss L ( ŷ , y ) measures the quality of the prediction given the target . To learn model parameters we solve the following loss optimization : min θ E ( x , y ) ∼D L ( ŷ = fθ ( x ) , y ) ( 1 ) A likelihood L ( ŷ|y , φ ) measures the quality of the prediction as a distribution over ŷ given the target y and likelihood parameters φ . We use the negative log-likelihood ` ( NLL ) , and the likelihood interchangeably since both have the same optima . We define the full likelihood optimization : min θ , φ E ( x , y ) ∼D ` ( ŷ = fθ ( x ) |y , φ ) ( 2 ) to jointly learn model and likelihood parameters . “ Full ” indicates the inclusion of φ , which controls the distribution and induced NLL loss . We focus on full likelihood optimization in this work . We note that the target , y , is the only supervision needed to optimize model and likelihood parameters , θ and φ respectively . Additionally , though the shape and scale varies with φ , reducing the error ŷ−y always reduces the NLL for our distributions . Distributions Under Investigation This work considers the normal likelihood with variance σ ( Bishop et al. , 2006 ; Hastie et al. , 2009 ) , the softmax likelihood with temperature τ ( Hinton et al. , 2015 ) , and the robust likelihood ρ ( Barron , 2019 ) with shape α and scale σ that control the scale and shape of the likelihood . The first two are among the most common losses in machine learning , and the last loss provides an important illustration of a likelihood parameter that affects “ shape ” instead of “ scale ” . We note that changing the scale and shape of the likelihood distribution is not “ cheating ” as there is a trade-off between uncertainty and credit . Figure 1 shows how this trade-off affects the Normal and softmax distributions and their NLLs . The normal likelihood has terms for the residual ŷ − y and the variance σ as N ( ŷ|y , σ ) = ( 2πσ2 ) − 12 exp ( −1 2 ( ŷ − y ) 2 σ2 ) , ( 3 ) with σ ∈ ( 0 , ∞ ) scaling the distribution . The normal NLL can be written ` N = 12σ2 ( ŷ−y ) 2+log σ , after simplifying and omitting constants that do not affect minimization . We recover the squared error by substituting σ = 1 . The softmax defines a categorical distribution defined by scores z for each class c as softmax ( ŷ = y|z , τ ) = e zyτ∑ c e zcτ , ( 4 ) with the temperature , τ ∈ ( 0 , ∞ ) , adjusting the entropy of the distribution . We recover the classification cross-entropy loss , − log p ( ŷ = y ) , by substituting τ = 1 in the respective NLL . We state the gradients of these likelihoods with respect to their σ and τ in Section A of the supplement . The robust loss ρ and its likelihood are ρ ( x , α , σ ) = |α− 2| α ( ( x/σ ) 2 |α− 2| + 1 ) α/2 − 1 and ( 5 ) p ( ŷ | y , α , σ ) = 1 σZ ( α ) exp ( −ρ ( ŷ − y , α , σ ) ) , ( 6 ) with shape α ∈ [ 0 , ∞ ) , scale σ ∈ ( 0 , ∞ ) , and normalization function Z ( α ) . This robust loss , ρ , has the interesting property that it generalizes several different loss functions commonly used in robust learning such as the L2 loss ( α = 2 ) , pseudo-huber loss ( Charbonnier et al. , 1997 ) ( α = 1 ) , Cauchy loss ( Li et al. , 2018 ) ( α = 0 ) , Geman-McClure loss ( Ganan & McClure , 1985 ) , ( α = −2 ) , and Welsch ( Dennis Jr & Welsch , 1978 ) loss ( alpha = −∞ ) . Learning the shape parameter allows models to adapt the shape of their noise distribution . 3 RELATED WORK . Likelihood optimization follows from maximum likelihood estimation ( Hastie et al. , 2009 ; Bishop et al. , 2006 ) , yet is uncommon in practice for fitting deep regressors and classifiers for discriminative tasks . However Kendall & Gal ( 2017 ) ; Kendall et al . ( 2018 ) ; Barron ( 2019 ) ; Saxena et al . ( 2019 ) optimize likelihood parameters to their advantage yet differ in their tasks , likelihoods , and parameterizations . In this work we aim to systematically experiment , clarify usage , and encourage their wider adoption . Early work on regressing means and variances ( Nix & Weigend , 1994 ) had the key insight that optimizing the full likelihood can fit these parameters and adapt the loss . Some recent works use likelihoods for loss adaptation , and interpret their parameters as the uncertainty ( Kendall & Gal , 2017 ; Kendall et al. , 2018 ) , robustness ( Kendall & Gal , 2017 ; Barron , 2019 ; Saxena et al. , 2019 ) , and curricula ( Saxena et al. , 2019 ) of losses . MacKay & Mac Kay ( 2003 ) uses Bayesian evidence to select hyper-parameters and losses based on proper likelihood normalization . Barron ( 2019 ) define a generalized robust regression loss , ρ , to jointly optimize the type and degree of robustness with global , data-independent , parameters . Kendall & Gal ( 2017 ) predict variances for regression and classification to handle data-dependent uncertainty . Kendall et al . ( 2018 ) balance multi-task loss weights by optimizing variances for regression and temperatures for classification . These global parameters depend on the task but not the data , and are interpreted as inherent task uncertainty . Saxena et al . ( 2019 ) define a differentiable curriculum for classification by assigning each training point its own temperature . These data parameters depend on the index of the data but not its value . We compare these different likelihood parameterizations across tasks and distributions . In the calibration literature , Guo et al . ( 2017 ) have found that deep networks are often miscalibrated , but they can be re-calibrated by cross-validating the temperature of the softmax . In this work we explore several generalizations of this concept . Alternatively , Platt scaling ( Platt , 1999 ) fits a sigmoid regressor to model predictions to calibrate probabilities . Kuleshov et al . ( 2018 ) re-calibrate regressors by fitting an Isotonic regressor to the empirical cumulative distribution function . 4 LIKELIHOOD PARAMETER TYPES . We explore the space of likelihood parameter representations for model optimization and inference . Though we note that some losses , like adversarial losses , are difficult to represent as likelihoods , many different losses in the community have a natural probabilistic interpretation . Often , these probabilistic interpretations can be parametrized in a variety of ways . We explore two key axes of generality when building these loss functions : conditioning and dimensionality . Conditioning We represent the likelihood parameters by three functional classes : global , data , and predicted . Global parameters , φ = c , are independent of the data and model and define the same likelihood distribution for all points . Data parameters , φi , are conditioned on the index , i , of the data , xi , but not its value . Every training point is assigned an independent likelihood parameter , φi that define different likelihoods for each training point . Predicted parameters , φ ( x ) = gη ( x ) , are determined by a model , g , with parameters η ( not to be confused with the task model parameters θ ) . Global and predicted parameters can be used during training and testing , but data parameters are only assigned to each training point and are undefined for testing . We show a simple example of predicted temperature in Figure 4 , and an illustration of the parameter types in Figure 2 . We note that for certain global parameters like a learned Normal scale , changing the scale does not affect the optima , but does change the probabilistic interpretation . This invariance has led many authors to drop the scale from their formulations . However , when models can predict these scale parameters they can naturally remain calibrated in the presence of heteroskedasticity and outliers . conditioning : global , predicted , and data . Each represents a different way to parametrize the model ’ s temperature . Each represents a possible way to parametrize the additional scale parameter added to the loss . Dimensionality The dimensionality , |φ| , of likelihood parameters can vary with the dimension of the task prediction , ŷ . For example , image regressors can use a single likelihood parameter for each image |φ| = 1 , RGB image channel |φ| = C , or even every pixel |φ| = W × H × C as in Figure 3 . These choices correspond to different likelihood distribution classes . Dimensionality and Conditioning of likelihood parameters can interact . For example , data parameters with |φ| = W × H × C would result in N ×W × H × C additional parameters , where N is the size of the dataset . This can complicate implementations and slow down optimization due to disk I/O when their size exceeds memory . Table 5 in the appendix contrasts the computational requirements of different likelihood parameter types . The work of Barron ( 2019 ) explores both scalar and pixel-wise dimensionalities for his robust loss . 5 APPLICATIONS | This paper studied loss functions by interpreting them from a likelihood viewpoint and by proposing to optimize "full" likelihoods for robust modeling, outlier-detection, and re-calibration purposes. Many loss functions stem from maximum likelihood estimation (MLE). For instance, the quadratic loss stems from MLE under Gaussianity, the absolute deviation loss stems from MLE under the Laplace noise assumption, and the check loss from MLE under the asymmetry Laplace noise assumption. What is common about these noise assumptions is that they contain scale/location parameters. Traditionally, in the machine learning community, these loss functions are used by ignoring the underlying noise assumptions and so the scale parameters are abandoned. The point of the paper is to take into account these scale parameters when solving the resulting optimization problems in learning. | SP:c3b3b5c69080aba6363c9120e42b3e68ea633c68 |
It Is Likely That Your Loss Should be a Likelihood | 1 INTRODUCTION . Choosing the right loss matters . Many common losses arise from likelihoods , such as the squared error loss from the normal distribution , absolute error from the Laplace distribution , and the cross entropy loss from the softmax distribution . The same is true of regularizers , where L2 arises from a normal prior and L1 from a Laplace prior . Deriving losses from likelihoods recasts the problem as a choice of distribution which allows datadependent adaptation . Standard losses and regularizers implicitly fix key distribution parameters , limiting flexibility . For instance , the squared error corresponds to fixing the normal variance at a constant . The full normal likelihood retains its scale parameter and allows optimization over a parametrized set of distributions . This work examines how to jointly optimize distribution and model parameters to select losses and regularizers that encourage generalization , calibration , and robustness to outliers . We explore three key likelihoods : the normal , softmax , and the robust regression likelihood ρ of Barron ( 2019 ) . Additionally , we cast adaptive priors in the same light and introduce adaptive regularizers . Our contributions : 1 . We systematically survey and evaluate global , data , and predicted likelihood parameters and introduce a new self-tuning variant of the robust adaptive loss ρ 2 . We apply likelihood parameters to create new classes of robust models , outlier detectors , and re-calibrators . 3 . We propose adaptive versions of L1 and L2 regularization using parameterized normal and Laplace priors on model parameters . 2 BACKGROUND . Notation We consider a dataset D of points xi and targets yi indexed by i ∈ { 1 , . . . , N } . Targets for regression are real numbers and targets for classification are one-hot vectors . The model f with parameters θ makes predictions ŷi = fθ ( x ) . A loss L ( ŷ , y ) measures the quality of the prediction given the target . To learn model parameters we solve the following loss optimization : min θ E ( x , y ) ∼D L ( ŷ = fθ ( x ) , y ) ( 1 ) A likelihood L ( ŷ|y , φ ) measures the quality of the prediction as a distribution over ŷ given the target y and likelihood parameters φ . We use the negative log-likelihood ` ( NLL ) , and the likelihood interchangeably since both have the same optima . We define the full likelihood optimization : min θ , φ E ( x , y ) ∼D ` ( ŷ = fθ ( x ) |y , φ ) ( 2 ) to jointly learn model and likelihood parameters . “ Full ” indicates the inclusion of φ , which controls the distribution and induced NLL loss . We focus on full likelihood optimization in this work . We note that the target , y , is the only supervision needed to optimize model and likelihood parameters , θ and φ respectively . Additionally , though the shape and scale varies with φ , reducing the error ŷ−y always reduces the NLL for our distributions . Distributions Under Investigation This work considers the normal likelihood with variance σ ( Bishop et al. , 2006 ; Hastie et al. , 2009 ) , the softmax likelihood with temperature τ ( Hinton et al. , 2015 ) , and the robust likelihood ρ ( Barron , 2019 ) with shape α and scale σ that control the scale and shape of the likelihood . The first two are among the most common losses in machine learning , and the last loss provides an important illustration of a likelihood parameter that affects “ shape ” instead of “ scale ” . We note that changing the scale and shape of the likelihood distribution is not “ cheating ” as there is a trade-off between uncertainty and credit . Figure 1 shows how this trade-off affects the Normal and softmax distributions and their NLLs . The normal likelihood has terms for the residual ŷ − y and the variance σ as N ( ŷ|y , σ ) = ( 2πσ2 ) − 12 exp ( −1 2 ( ŷ − y ) 2 σ2 ) , ( 3 ) with σ ∈ ( 0 , ∞ ) scaling the distribution . The normal NLL can be written ` N = 12σ2 ( ŷ−y ) 2+log σ , after simplifying and omitting constants that do not affect minimization . We recover the squared error by substituting σ = 1 . The softmax defines a categorical distribution defined by scores z for each class c as softmax ( ŷ = y|z , τ ) = e zyτ∑ c e zcτ , ( 4 ) with the temperature , τ ∈ ( 0 , ∞ ) , adjusting the entropy of the distribution . We recover the classification cross-entropy loss , − log p ( ŷ = y ) , by substituting τ = 1 in the respective NLL . We state the gradients of these likelihoods with respect to their σ and τ in Section A of the supplement . The robust loss ρ and its likelihood are ρ ( x , α , σ ) = |α− 2| α ( ( x/σ ) 2 |α− 2| + 1 ) α/2 − 1 and ( 5 ) p ( ŷ | y , α , σ ) = 1 σZ ( α ) exp ( −ρ ( ŷ − y , α , σ ) ) , ( 6 ) with shape α ∈ [ 0 , ∞ ) , scale σ ∈ ( 0 , ∞ ) , and normalization function Z ( α ) . This robust loss , ρ , has the interesting property that it generalizes several different loss functions commonly used in robust learning such as the L2 loss ( α = 2 ) , pseudo-huber loss ( Charbonnier et al. , 1997 ) ( α = 1 ) , Cauchy loss ( Li et al. , 2018 ) ( α = 0 ) , Geman-McClure loss ( Ganan & McClure , 1985 ) , ( α = −2 ) , and Welsch ( Dennis Jr & Welsch , 1978 ) loss ( alpha = −∞ ) . Learning the shape parameter allows models to adapt the shape of their noise distribution . 3 RELATED WORK . Likelihood optimization follows from maximum likelihood estimation ( Hastie et al. , 2009 ; Bishop et al. , 2006 ) , yet is uncommon in practice for fitting deep regressors and classifiers for discriminative tasks . However Kendall & Gal ( 2017 ) ; Kendall et al . ( 2018 ) ; Barron ( 2019 ) ; Saxena et al . ( 2019 ) optimize likelihood parameters to their advantage yet differ in their tasks , likelihoods , and parameterizations . In this work we aim to systematically experiment , clarify usage , and encourage their wider adoption . Early work on regressing means and variances ( Nix & Weigend , 1994 ) had the key insight that optimizing the full likelihood can fit these parameters and adapt the loss . Some recent works use likelihoods for loss adaptation , and interpret their parameters as the uncertainty ( Kendall & Gal , 2017 ; Kendall et al. , 2018 ) , robustness ( Kendall & Gal , 2017 ; Barron , 2019 ; Saxena et al. , 2019 ) , and curricula ( Saxena et al. , 2019 ) of losses . MacKay & Mac Kay ( 2003 ) uses Bayesian evidence to select hyper-parameters and losses based on proper likelihood normalization . Barron ( 2019 ) define a generalized robust regression loss , ρ , to jointly optimize the type and degree of robustness with global , data-independent , parameters . Kendall & Gal ( 2017 ) predict variances for regression and classification to handle data-dependent uncertainty . Kendall et al . ( 2018 ) balance multi-task loss weights by optimizing variances for regression and temperatures for classification . These global parameters depend on the task but not the data , and are interpreted as inherent task uncertainty . Saxena et al . ( 2019 ) define a differentiable curriculum for classification by assigning each training point its own temperature . These data parameters depend on the index of the data but not its value . We compare these different likelihood parameterizations across tasks and distributions . In the calibration literature , Guo et al . ( 2017 ) have found that deep networks are often miscalibrated , but they can be re-calibrated by cross-validating the temperature of the softmax . In this work we explore several generalizations of this concept . Alternatively , Platt scaling ( Platt , 1999 ) fits a sigmoid regressor to model predictions to calibrate probabilities . Kuleshov et al . ( 2018 ) re-calibrate regressors by fitting an Isotonic regressor to the empirical cumulative distribution function . 4 LIKELIHOOD PARAMETER TYPES . We explore the space of likelihood parameter representations for model optimization and inference . Though we note that some losses , like adversarial losses , are difficult to represent as likelihoods , many different losses in the community have a natural probabilistic interpretation . Often , these probabilistic interpretations can be parametrized in a variety of ways . We explore two key axes of generality when building these loss functions : conditioning and dimensionality . Conditioning We represent the likelihood parameters by three functional classes : global , data , and predicted . Global parameters , φ = c , are independent of the data and model and define the same likelihood distribution for all points . Data parameters , φi , are conditioned on the index , i , of the data , xi , but not its value . Every training point is assigned an independent likelihood parameter , φi that define different likelihoods for each training point . Predicted parameters , φ ( x ) = gη ( x ) , are determined by a model , g , with parameters η ( not to be confused with the task model parameters θ ) . Global and predicted parameters can be used during training and testing , but data parameters are only assigned to each training point and are undefined for testing . We show a simple example of predicted temperature in Figure 4 , and an illustration of the parameter types in Figure 2 . We note that for certain global parameters like a learned Normal scale , changing the scale does not affect the optima , but does change the probabilistic interpretation . This invariance has led many authors to drop the scale from their formulations . However , when models can predict these scale parameters they can naturally remain calibrated in the presence of heteroskedasticity and outliers . conditioning : global , predicted , and data . Each represents a different way to parametrize the model ’ s temperature . Each represents a possible way to parametrize the additional scale parameter added to the loss . Dimensionality The dimensionality , |φ| , of likelihood parameters can vary with the dimension of the task prediction , ŷ . For example , image regressors can use a single likelihood parameter for each image |φ| = 1 , RGB image channel |φ| = C , or even every pixel |φ| = W × H × C as in Figure 3 . These choices correspond to different likelihood distribution classes . Dimensionality and Conditioning of likelihood parameters can interact . For example , data parameters with |φ| = W × H × C would result in N ×W × H × C additional parameters , where N is the size of the dataset . This can complicate implementations and slow down optimization due to disk I/O when their size exceeds memory . Table 5 in the appendix contrasts the computational requirements of different likelihood parameter types . The work of Barron ( 2019 ) explores both scalar and pixel-wise dimensionalities for his robust loss . 5 APPLICATIONS | This paper's starting point is a probabilistic interpretation of three losses: MSE, cross-entropy, and the loss introduced in reference (Barron 2019). It proposes the minimize the average loss jointly over the predictor's parameters $\theta$, but also the loss' own parameters $\phi$, vary, yielding an adaptive loss. It categorizes ways to define losses according to whether they depend on the data value, on the data index but not its value, or are independent of the data. The jointly optimized loss yields superior performance as re-calibrators (table 2 column CAL for regressors and table 5 for classifiers). It allows a natural definition of outlier detectors (sec 5.2) | SP:c3b3b5c69080aba6363c9120e42b3e68ea633c68 |
Rethinking Embedding Coupling in Pre-trained Language Models | 1 INTRODUCTION . The performance of models in natural language processing ( NLP ) has dramatically improved in recent years , mainly driven by advances in transfer learning from large amounts of unlabeled data ( Howard & Ruder , 2018 ; Devlin et al. , 2019 ) . The most successful paradigm consists of pre-training a large Transformer ( Vaswani et al. , 2017 ) model with a self-supervised loss and fine-tuning it on data of a downstream task ( Ruder et al. , 2019 ) . Despite its empirical success , inefficiencies have been observed related to the training duration ( Liu et al. , 2019b ) , pre-training objective ( Clark et al. , 2020b ) , and training data ( Conneau et al. , 2020a ) , among others . In this paper , we reconsider a modeling assumption that may have a similarly pervasive practical impact : the coupling of input and output embeddings1 in state-of-the-art pre-trained language models . State-of-the-art pre-trained language models ( Devlin et al. , 2019 ; Liu et al. , 2019b ) and their multilingual counterparts ( Devlin et al. , 2019 ; Conneau et al. , 2020a ) have inherited the practice of embedding coupling from their language model predecessors ( Press & Wolf , 2017 ; Inan et al. , 2017 ) . However , in contrast to their language model counterparts , embedding coupling in encoder-only pre-trained models such as Devlin et al . ( 2019 ) is only useful during pre-training since output embeddings are generally discarded after fine-tuning.2 In addition , given the willingness of researchers to exchange additional compute during pre-training for improved downstream performance ( Raffel ∗equal contribution †Work done as a member of the Google AI Residency Program . 1Output embedding is sometimes referred to as “ output weights ” , i.e. , the weight matrix in the output projection in a language model . 2We focus on encoder-only models , and do not consider encoder-decoder models like T5 ( Raffel et al. , 2020 ) where none of the embedding matrices are discarded after pre-training . Output embeddings may also be et al. , 2020 ; Brown et al. , 2020 ) and the fact that pre-trained models are often used for inference millions of times ( Wolf et al. , 2019 ) , pre-training-specific parameter savings are less important overall . On the other hand , tying input and output embeddings constrains the model to use the same dimensionality for both embeddings . This restriction limits the researcher ’ s flexibility in parameterizing the model and can lead to allocating too much capacity to the input embeddings , which may be wasteful . This is a problem particularly for multilingual models , which require large vocabularies with high-dimensional embeddings that make up between 47–71 % of the entire parameter budget ( Table 1 ) , suggesting an inefficient parameter allocation . In this paper , we systematically study the impact of embedding coupling on state-of-the-art pretrained language models , focusing on multilingual models . First , we observe that while naı̈vely decoupling the input and output embedding parameters does not consistently improve downstream evaluation metrics , decoupling their shapes comes with a host of benefits . In particular , it allows us to independently modify the input and output embedding dimensions . We show that the input embedding dimension can be safely reduced without affecting downstream performance . Since the output embedding is discarded after pre-training , we can increase its dimension , which improves fine-tuning accuracy and outperforms other capacity expansion strategies . By reinvesting saved parameters to the width and depth of the Transformer layers , we furthermore achieve significantly improved performance over a strong mBERT ( Devlin et al. , 2019 ) baseline on multilingual tasks from the XTREME benchmark ( Hu et al. , 2020 ) . Finally , we combine our techniques in a Rebalanced mBERT ( RemBERT ) model that outperforms XLM-R ( Conneau et al. , 2020a ) , the state-of-the-art cross-lingual model while having been pre-trained on 3.5× fewer tokens and 10 more languages . We thoroughly investigate reasons for the benefits of embedding decoupling . We observe that an increased output embedding size enables a model to improve on the pre-training task , which correlates with downstream performance . We also find that it leads to Transformers that are more transferable across tasks and languages—particularly for the upper-most layers . Overall , larger output embeddings prevent the model ’ s last layers from over-specializing to the pre-training task ( Zhang et al. , 2020 ; Tamkin et al. , 2020 ) , which enables training of more general Transformer models . 2 RELATED WORK . Embedding coupling Sharing input and output embeddings in neural language models was proposed to improve perplexity and motivated based on embedding similarity ( Press & Wolf , 2017 ) as well as by theoretically showing that the output probability space can be constrained to a subspace governed by the embedding matrix for a restricted case ( Inan et al. , 2017 ) . Embedding coupling is also common in neural machine translation models where it reduces model complexity ( Firat et al. , 2016 ) and saves memory ( Johnson et al. , 2017 ) , in recent state-of-the-art language models ( Melis et al. , 2020 ) , as well as all pre-trained models we are aware of ( Devlin et al. , 2019 ; Liu et al. , 2019b ) . Transferability of representations Representations of large pre-trained models in computer vision and NLP have been observed to transition from general to task-specific from the first to the useful for domain-adaptive pre-training ( Howard & Ruder , 2018 ; Gururangan et al. , 2020 ) , probing ( Elazar & Goldberg , 2019 ) , and tasks that can be cast in the pre-training objective ( Amrami & Goldberg , 2019 ) . last layer ( Yosinski et al. , 2014 ; Howard & Ruder , 2018 ; Liu et al. , 2019a ) . In Transformer models , the last few layers have been shown to become specialized to the MLM task and—as a result—less transferable ( Zhang et al. , 2020 ; Tamkin et al. , 2020 ) . Multilingual models Recent multilingual models are pre-trained on data covering around 100 languages using a subword vocabulary shared across all languages ( Devlin et al. , 2019 ; Pires et al. , 2019 ; Conneau et al. , 2020a ) . In order to achieve reasonable performance for most languages , these models need to allocate sufficient capacity for each language , known as the curse of multilinguality ( Conneau et al. , 2020a ; Pfeiffer et al. , 2020 ) . As a result , such multilingual models have large vocabularies with large embedding sizes to ensure that tokens in all languages are adequately represented . Efficient models Most work on more efficient pre-trained models focuses on pruning or distillation ( Hinton et al. , 2015 ) . Pruning approaches remove parts of the model , typically attention heads ( Michel et al. , 2019 ; Voita et al. , 2019 ) while distillation approaches distill a large pre-trained model into a smaller one ( Sun et al. , 2020 ) . Distillation can be seen as an alternative form of allocating pre-training capacity via a large teacher model . However , distilling a pre-trained model is expensive ( Sanh et al. , 2019 ) and requires overcoming architecture differences and balancing training data and loss terms ( Mukherjee & Awadallah , 2020 ) . Our proposed methods are simpler and complementary to distillation as they can improve the pre-training of compact student models ( Turc et al. , 2019 ) . 3 EXPERIMENTAL METHODOLOGY . Efficiency of models has been measured along different dimensions , from the number of floating point operations ( Schwartz et al. , 2019 ) to their runtime ( Zhou et al. , 2020 ) . We follow previous work ( Sun et al. , 2020 ) and compare models in terms of their number of parameters during finetuning ( see Appendix A.1 for further justification of this setting ) . For completeness , we generally report the number of pre-training ( PT ) and fine-tuning ( FT ) parameters . Baseline Our baseline has the same architecture as multilingual BERT ( mBERT ; Devlin et al. , 2019 ) . It consists of 12 Transformer layers with a hidden size H of 768 . Input and output embeddings are coupled and have the same dimensionality E as the hidden size , i.e . Eout = Ein = H . The total number of parameters during pre-training and fine-tuning is 177M ( see Appendix A.2 for further details ) . We train variants of this model that differ in certain hyper-parameters but otherwise are trained under the same conditions to ensure a fair comparison . Tasks For our experiments , we employ tasks from the XTREME benchmark ( Hu et al. , 2020 ) that require fine-tuning , including the XNLI ( Conneau et al. , 2018 ) , NER ( Pan et al. , 2017 ) , PAWS-X ( Yang et al. , 2019 ) , XQuAD ( Artetxe et al. , 2020 ) , MLQA ( Lewis et al. , 2020 ) , and TyDiQA-GoldP ( Clark et al. , 2020a ) datasets . We provide details for them in Appendix A.4 . We average results across three fine-tuning runs and evaluate on the dev sets unless otherwise stated . 4 EMBEDDING DECOUPLING REVISITED . Naı̈ve decoupling Embeddings make up a large fraction of the parameter budget in state-of-theart multilingual models ( see Table 1 ) . We now study the effect of embedding decoupling on such models . In Table 2 , we show the impact of decoupling the input and output embeddings in our baseline model ( §3 ) with coupled embeddings . Naı̈vely decoupling the output embedding matrix slightly improves the performance as evidenced by a 0.4 increase on average . However , the gain is not uniformly observed in all tasks . Overall , these results suggest that decoupling the embedding matrices naı̈vely while keeping the dimensionality fixed does not greatly affect the performance of the model . What is more important , however , is that decoupling the input and output embeddings decouples the shapes , endowing significant modeling flexibility , which we investigate in the following . Input vs output embeddings Decoupling input and output embeddings allows us to flexibly change the dimensionality of both matrices and to determine which one is more important for good transfer performance of the model . To this end , we compare the performance of a model with Ein = 768 , Eout = 128 to that of a model with Ein = 128 , Eout = 7683 ( the remaining hyperparameters are the same as the baseline in §3 ) . During fine-tuning , the latter model has 43 % fewer parameters . We show the results in Table 3 . Surprisingly , the model pre-trained with a larger output embedding size is competitive with the comparison method on average despite having 77M fewer parameters during fine-tuning.4 Reducing the input embedding dimension saves a significant number of parameters at a noticeably smaller cost to accuracy than reducing the output embedding size . In light of this , the parameter allocation of multilingual models ( see Table 1 ) seems particularly inefficient . For a multilingual model with coupled embeddings , reducing the input embedding dimension to save parameters as proposed by Lan et al . ( 2020 ) is very detrimental to performance ( see Appendix A.5 for details ) . The results in this section indicate that the output embedding plays an important role in the transferability of pre-trained representations . For multilingual models in particular , a small input embedding dimension frees up a significant number of parameters at a small cost to performance . In the next section , we study how to improve the performance of a model by resizing embeddings and layers . | This work studied the impact of embedding coupling in pre-trained language models, by taking a multilingual model as backbone. The major finding is that decoupling the input and output embedding shapes can bring benefits, and the output embedding plays an important role in the transferability of pre-trained representation. A rebalanced mBERT is designed by combing and scaling up the investigated techniques, achieving strong results on the XTREME benchmark. | SP:456ad1760ac9923417ff5158e569452b75036646 |
Rethinking Embedding Coupling in Pre-trained Language Models | 1 INTRODUCTION . The performance of models in natural language processing ( NLP ) has dramatically improved in recent years , mainly driven by advances in transfer learning from large amounts of unlabeled data ( Howard & Ruder , 2018 ; Devlin et al. , 2019 ) . The most successful paradigm consists of pre-training a large Transformer ( Vaswani et al. , 2017 ) model with a self-supervised loss and fine-tuning it on data of a downstream task ( Ruder et al. , 2019 ) . Despite its empirical success , inefficiencies have been observed related to the training duration ( Liu et al. , 2019b ) , pre-training objective ( Clark et al. , 2020b ) , and training data ( Conneau et al. , 2020a ) , among others . In this paper , we reconsider a modeling assumption that may have a similarly pervasive practical impact : the coupling of input and output embeddings1 in state-of-the-art pre-trained language models . State-of-the-art pre-trained language models ( Devlin et al. , 2019 ; Liu et al. , 2019b ) and their multilingual counterparts ( Devlin et al. , 2019 ; Conneau et al. , 2020a ) have inherited the practice of embedding coupling from their language model predecessors ( Press & Wolf , 2017 ; Inan et al. , 2017 ) . However , in contrast to their language model counterparts , embedding coupling in encoder-only pre-trained models such as Devlin et al . ( 2019 ) is only useful during pre-training since output embeddings are generally discarded after fine-tuning.2 In addition , given the willingness of researchers to exchange additional compute during pre-training for improved downstream performance ( Raffel ∗equal contribution †Work done as a member of the Google AI Residency Program . 1Output embedding is sometimes referred to as “ output weights ” , i.e. , the weight matrix in the output projection in a language model . 2We focus on encoder-only models , and do not consider encoder-decoder models like T5 ( Raffel et al. , 2020 ) where none of the embedding matrices are discarded after pre-training . Output embeddings may also be et al. , 2020 ; Brown et al. , 2020 ) and the fact that pre-trained models are often used for inference millions of times ( Wolf et al. , 2019 ) , pre-training-specific parameter savings are less important overall . On the other hand , tying input and output embeddings constrains the model to use the same dimensionality for both embeddings . This restriction limits the researcher ’ s flexibility in parameterizing the model and can lead to allocating too much capacity to the input embeddings , which may be wasteful . This is a problem particularly for multilingual models , which require large vocabularies with high-dimensional embeddings that make up between 47–71 % of the entire parameter budget ( Table 1 ) , suggesting an inefficient parameter allocation . In this paper , we systematically study the impact of embedding coupling on state-of-the-art pretrained language models , focusing on multilingual models . First , we observe that while naı̈vely decoupling the input and output embedding parameters does not consistently improve downstream evaluation metrics , decoupling their shapes comes with a host of benefits . In particular , it allows us to independently modify the input and output embedding dimensions . We show that the input embedding dimension can be safely reduced without affecting downstream performance . Since the output embedding is discarded after pre-training , we can increase its dimension , which improves fine-tuning accuracy and outperforms other capacity expansion strategies . By reinvesting saved parameters to the width and depth of the Transformer layers , we furthermore achieve significantly improved performance over a strong mBERT ( Devlin et al. , 2019 ) baseline on multilingual tasks from the XTREME benchmark ( Hu et al. , 2020 ) . Finally , we combine our techniques in a Rebalanced mBERT ( RemBERT ) model that outperforms XLM-R ( Conneau et al. , 2020a ) , the state-of-the-art cross-lingual model while having been pre-trained on 3.5× fewer tokens and 10 more languages . We thoroughly investigate reasons for the benefits of embedding decoupling . We observe that an increased output embedding size enables a model to improve on the pre-training task , which correlates with downstream performance . We also find that it leads to Transformers that are more transferable across tasks and languages—particularly for the upper-most layers . Overall , larger output embeddings prevent the model ’ s last layers from over-specializing to the pre-training task ( Zhang et al. , 2020 ; Tamkin et al. , 2020 ) , which enables training of more general Transformer models . 2 RELATED WORK . Embedding coupling Sharing input and output embeddings in neural language models was proposed to improve perplexity and motivated based on embedding similarity ( Press & Wolf , 2017 ) as well as by theoretically showing that the output probability space can be constrained to a subspace governed by the embedding matrix for a restricted case ( Inan et al. , 2017 ) . Embedding coupling is also common in neural machine translation models where it reduces model complexity ( Firat et al. , 2016 ) and saves memory ( Johnson et al. , 2017 ) , in recent state-of-the-art language models ( Melis et al. , 2020 ) , as well as all pre-trained models we are aware of ( Devlin et al. , 2019 ; Liu et al. , 2019b ) . Transferability of representations Representations of large pre-trained models in computer vision and NLP have been observed to transition from general to task-specific from the first to the useful for domain-adaptive pre-training ( Howard & Ruder , 2018 ; Gururangan et al. , 2020 ) , probing ( Elazar & Goldberg , 2019 ) , and tasks that can be cast in the pre-training objective ( Amrami & Goldberg , 2019 ) . last layer ( Yosinski et al. , 2014 ; Howard & Ruder , 2018 ; Liu et al. , 2019a ) . In Transformer models , the last few layers have been shown to become specialized to the MLM task and—as a result—less transferable ( Zhang et al. , 2020 ; Tamkin et al. , 2020 ) . Multilingual models Recent multilingual models are pre-trained on data covering around 100 languages using a subword vocabulary shared across all languages ( Devlin et al. , 2019 ; Pires et al. , 2019 ; Conneau et al. , 2020a ) . In order to achieve reasonable performance for most languages , these models need to allocate sufficient capacity for each language , known as the curse of multilinguality ( Conneau et al. , 2020a ; Pfeiffer et al. , 2020 ) . As a result , such multilingual models have large vocabularies with large embedding sizes to ensure that tokens in all languages are adequately represented . Efficient models Most work on more efficient pre-trained models focuses on pruning or distillation ( Hinton et al. , 2015 ) . Pruning approaches remove parts of the model , typically attention heads ( Michel et al. , 2019 ; Voita et al. , 2019 ) while distillation approaches distill a large pre-trained model into a smaller one ( Sun et al. , 2020 ) . Distillation can be seen as an alternative form of allocating pre-training capacity via a large teacher model . However , distilling a pre-trained model is expensive ( Sanh et al. , 2019 ) and requires overcoming architecture differences and balancing training data and loss terms ( Mukherjee & Awadallah , 2020 ) . Our proposed methods are simpler and complementary to distillation as they can improve the pre-training of compact student models ( Turc et al. , 2019 ) . 3 EXPERIMENTAL METHODOLOGY . Efficiency of models has been measured along different dimensions , from the number of floating point operations ( Schwartz et al. , 2019 ) to their runtime ( Zhou et al. , 2020 ) . We follow previous work ( Sun et al. , 2020 ) and compare models in terms of their number of parameters during finetuning ( see Appendix A.1 for further justification of this setting ) . For completeness , we generally report the number of pre-training ( PT ) and fine-tuning ( FT ) parameters . Baseline Our baseline has the same architecture as multilingual BERT ( mBERT ; Devlin et al. , 2019 ) . It consists of 12 Transformer layers with a hidden size H of 768 . Input and output embeddings are coupled and have the same dimensionality E as the hidden size , i.e . Eout = Ein = H . The total number of parameters during pre-training and fine-tuning is 177M ( see Appendix A.2 for further details ) . We train variants of this model that differ in certain hyper-parameters but otherwise are trained under the same conditions to ensure a fair comparison . Tasks For our experiments , we employ tasks from the XTREME benchmark ( Hu et al. , 2020 ) that require fine-tuning , including the XNLI ( Conneau et al. , 2018 ) , NER ( Pan et al. , 2017 ) , PAWS-X ( Yang et al. , 2019 ) , XQuAD ( Artetxe et al. , 2020 ) , MLQA ( Lewis et al. , 2020 ) , and TyDiQA-GoldP ( Clark et al. , 2020a ) datasets . We provide details for them in Appendix A.4 . We average results across three fine-tuning runs and evaluate on the dev sets unless otherwise stated . 4 EMBEDDING DECOUPLING REVISITED . Naı̈ve decoupling Embeddings make up a large fraction of the parameter budget in state-of-theart multilingual models ( see Table 1 ) . We now study the effect of embedding decoupling on such models . In Table 2 , we show the impact of decoupling the input and output embeddings in our baseline model ( §3 ) with coupled embeddings . Naı̈vely decoupling the output embedding matrix slightly improves the performance as evidenced by a 0.4 increase on average . However , the gain is not uniformly observed in all tasks . Overall , these results suggest that decoupling the embedding matrices naı̈vely while keeping the dimensionality fixed does not greatly affect the performance of the model . What is more important , however , is that decoupling the input and output embeddings decouples the shapes , endowing significant modeling flexibility , which we investigate in the following . Input vs output embeddings Decoupling input and output embeddings allows us to flexibly change the dimensionality of both matrices and to determine which one is more important for good transfer performance of the model . To this end , we compare the performance of a model with Ein = 768 , Eout = 128 to that of a model with Ein = 128 , Eout = 7683 ( the remaining hyperparameters are the same as the baseline in §3 ) . During fine-tuning , the latter model has 43 % fewer parameters . We show the results in Table 3 . Surprisingly , the model pre-trained with a larger output embedding size is competitive with the comparison method on average despite having 77M fewer parameters during fine-tuning.4 Reducing the input embedding dimension saves a significant number of parameters at a noticeably smaller cost to accuracy than reducing the output embedding size . In light of this , the parameter allocation of multilingual models ( see Table 1 ) seems particularly inefficient . For a multilingual model with coupled embeddings , reducing the input embedding dimension to save parameters as proposed by Lan et al . ( 2020 ) is very detrimental to performance ( see Appendix A.5 for details ) . The results in this section indicate that the output embedding plays an important role in the transferability of pre-trained representations . For multilingual models in particular , a small input embedding dimension frees up a significant number of parameters at a small cost to performance . In the next section , we study how to improve the performance of a model by resizing embeddings and layers . | This work investigated the strategy of reallocating parameters of multilingual language models for improving their cross lingual transferability. Authors first decoupled the input and output embeddings and showed that the capacity of output embedding is more important than input embedding. Then, they proposed a Rebalanced mBERT (RemBERT) model that reallocates the input embedding parameters of mBERT model to the output embedding and additional layers. Experimental results on XTREME benchmark showed that RemBERT significantly outperformed XLM-R with similar model size. | SP:456ad1760ac9923417ff5158e569452b75036646 |
Rethinking Embedding Coupling in Pre-trained Language Models | 1 INTRODUCTION . The performance of models in natural language processing ( NLP ) has dramatically improved in recent years , mainly driven by advances in transfer learning from large amounts of unlabeled data ( Howard & Ruder , 2018 ; Devlin et al. , 2019 ) . The most successful paradigm consists of pre-training a large Transformer ( Vaswani et al. , 2017 ) model with a self-supervised loss and fine-tuning it on data of a downstream task ( Ruder et al. , 2019 ) . Despite its empirical success , inefficiencies have been observed related to the training duration ( Liu et al. , 2019b ) , pre-training objective ( Clark et al. , 2020b ) , and training data ( Conneau et al. , 2020a ) , among others . In this paper , we reconsider a modeling assumption that may have a similarly pervasive practical impact : the coupling of input and output embeddings1 in state-of-the-art pre-trained language models . State-of-the-art pre-trained language models ( Devlin et al. , 2019 ; Liu et al. , 2019b ) and their multilingual counterparts ( Devlin et al. , 2019 ; Conneau et al. , 2020a ) have inherited the practice of embedding coupling from their language model predecessors ( Press & Wolf , 2017 ; Inan et al. , 2017 ) . However , in contrast to their language model counterparts , embedding coupling in encoder-only pre-trained models such as Devlin et al . ( 2019 ) is only useful during pre-training since output embeddings are generally discarded after fine-tuning.2 In addition , given the willingness of researchers to exchange additional compute during pre-training for improved downstream performance ( Raffel ∗equal contribution †Work done as a member of the Google AI Residency Program . 1Output embedding is sometimes referred to as “ output weights ” , i.e. , the weight matrix in the output projection in a language model . 2We focus on encoder-only models , and do not consider encoder-decoder models like T5 ( Raffel et al. , 2020 ) where none of the embedding matrices are discarded after pre-training . Output embeddings may also be et al. , 2020 ; Brown et al. , 2020 ) and the fact that pre-trained models are often used for inference millions of times ( Wolf et al. , 2019 ) , pre-training-specific parameter savings are less important overall . On the other hand , tying input and output embeddings constrains the model to use the same dimensionality for both embeddings . This restriction limits the researcher ’ s flexibility in parameterizing the model and can lead to allocating too much capacity to the input embeddings , which may be wasteful . This is a problem particularly for multilingual models , which require large vocabularies with high-dimensional embeddings that make up between 47–71 % of the entire parameter budget ( Table 1 ) , suggesting an inefficient parameter allocation . In this paper , we systematically study the impact of embedding coupling on state-of-the-art pretrained language models , focusing on multilingual models . First , we observe that while naı̈vely decoupling the input and output embedding parameters does not consistently improve downstream evaluation metrics , decoupling their shapes comes with a host of benefits . In particular , it allows us to independently modify the input and output embedding dimensions . We show that the input embedding dimension can be safely reduced without affecting downstream performance . Since the output embedding is discarded after pre-training , we can increase its dimension , which improves fine-tuning accuracy and outperforms other capacity expansion strategies . By reinvesting saved parameters to the width and depth of the Transformer layers , we furthermore achieve significantly improved performance over a strong mBERT ( Devlin et al. , 2019 ) baseline on multilingual tasks from the XTREME benchmark ( Hu et al. , 2020 ) . Finally , we combine our techniques in a Rebalanced mBERT ( RemBERT ) model that outperforms XLM-R ( Conneau et al. , 2020a ) , the state-of-the-art cross-lingual model while having been pre-trained on 3.5× fewer tokens and 10 more languages . We thoroughly investigate reasons for the benefits of embedding decoupling . We observe that an increased output embedding size enables a model to improve on the pre-training task , which correlates with downstream performance . We also find that it leads to Transformers that are more transferable across tasks and languages—particularly for the upper-most layers . Overall , larger output embeddings prevent the model ’ s last layers from over-specializing to the pre-training task ( Zhang et al. , 2020 ; Tamkin et al. , 2020 ) , which enables training of more general Transformer models . 2 RELATED WORK . Embedding coupling Sharing input and output embeddings in neural language models was proposed to improve perplexity and motivated based on embedding similarity ( Press & Wolf , 2017 ) as well as by theoretically showing that the output probability space can be constrained to a subspace governed by the embedding matrix for a restricted case ( Inan et al. , 2017 ) . Embedding coupling is also common in neural machine translation models where it reduces model complexity ( Firat et al. , 2016 ) and saves memory ( Johnson et al. , 2017 ) , in recent state-of-the-art language models ( Melis et al. , 2020 ) , as well as all pre-trained models we are aware of ( Devlin et al. , 2019 ; Liu et al. , 2019b ) . Transferability of representations Representations of large pre-trained models in computer vision and NLP have been observed to transition from general to task-specific from the first to the useful for domain-adaptive pre-training ( Howard & Ruder , 2018 ; Gururangan et al. , 2020 ) , probing ( Elazar & Goldberg , 2019 ) , and tasks that can be cast in the pre-training objective ( Amrami & Goldberg , 2019 ) . last layer ( Yosinski et al. , 2014 ; Howard & Ruder , 2018 ; Liu et al. , 2019a ) . In Transformer models , the last few layers have been shown to become specialized to the MLM task and—as a result—less transferable ( Zhang et al. , 2020 ; Tamkin et al. , 2020 ) . Multilingual models Recent multilingual models are pre-trained on data covering around 100 languages using a subword vocabulary shared across all languages ( Devlin et al. , 2019 ; Pires et al. , 2019 ; Conneau et al. , 2020a ) . In order to achieve reasonable performance for most languages , these models need to allocate sufficient capacity for each language , known as the curse of multilinguality ( Conneau et al. , 2020a ; Pfeiffer et al. , 2020 ) . As a result , such multilingual models have large vocabularies with large embedding sizes to ensure that tokens in all languages are adequately represented . Efficient models Most work on more efficient pre-trained models focuses on pruning or distillation ( Hinton et al. , 2015 ) . Pruning approaches remove parts of the model , typically attention heads ( Michel et al. , 2019 ; Voita et al. , 2019 ) while distillation approaches distill a large pre-trained model into a smaller one ( Sun et al. , 2020 ) . Distillation can be seen as an alternative form of allocating pre-training capacity via a large teacher model . However , distilling a pre-trained model is expensive ( Sanh et al. , 2019 ) and requires overcoming architecture differences and balancing training data and loss terms ( Mukherjee & Awadallah , 2020 ) . Our proposed methods are simpler and complementary to distillation as they can improve the pre-training of compact student models ( Turc et al. , 2019 ) . 3 EXPERIMENTAL METHODOLOGY . Efficiency of models has been measured along different dimensions , from the number of floating point operations ( Schwartz et al. , 2019 ) to their runtime ( Zhou et al. , 2020 ) . We follow previous work ( Sun et al. , 2020 ) and compare models in terms of their number of parameters during finetuning ( see Appendix A.1 for further justification of this setting ) . For completeness , we generally report the number of pre-training ( PT ) and fine-tuning ( FT ) parameters . Baseline Our baseline has the same architecture as multilingual BERT ( mBERT ; Devlin et al. , 2019 ) . It consists of 12 Transformer layers with a hidden size H of 768 . Input and output embeddings are coupled and have the same dimensionality E as the hidden size , i.e . Eout = Ein = H . The total number of parameters during pre-training and fine-tuning is 177M ( see Appendix A.2 for further details ) . We train variants of this model that differ in certain hyper-parameters but otherwise are trained under the same conditions to ensure a fair comparison . Tasks For our experiments , we employ tasks from the XTREME benchmark ( Hu et al. , 2020 ) that require fine-tuning , including the XNLI ( Conneau et al. , 2018 ) , NER ( Pan et al. , 2017 ) , PAWS-X ( Yang et al. , 2019 ) , XQuAD ( Artetxe et al. , 2020 ) , MLQA ( Lewis et al. , 2020 ) , and TyDiQA-GoldP ( Clark et al. , 2020a ) datasets . We provide details for them in Appendix A.4 . We average results across three fine-tuning runs and evaluate on the dev sets unless otherwise stated . 4 EMBEDDING DECOUPLING REVISITED . Naı̈ve decoupling Embeddings make up a large fraction of the parameter budget in state-of-theart multilingual models ( see Table 1 ) . We now study the effect of embedding decoupling on such models . In Table 2 , we show the impact of decoupling the input and output embeddings in our baseline model ( §3 ) with coupled embeddings . Naı̈vely decoupling the output embedding matrix slightly improves the performance as evidenced by a 0.4 increase on average . However , the gain is not uniformly observed in all tasks . Overall , these results suggest that decoupling the embedding matrices naı̈vely while keeping the dimensionality fixed does not greatly affect the performance of the model . What is more important , however , is that decoupling the input and output embeddings decouples the shapes , endowing significant modeling flexibility , which we investigate in the following . Input vs output embeddings Decoupling input and output embeddings allows us to flexibly change the dimensionality of both matrices and to determine which one is more important for good transfer performance of the model . To this end , we compare the performance of a model with Ein = 768 , Eout = 128 to that of a model with Ein = 128 , Eout = 7683 ( the remaining hyperparameters are the same as the baseline in §3 ) . During fine-tuning , the latter model has 43 % fewer parameters . We show the results in Table 3 . Surprisingly , the model pre-trained with a larger output embedding size is competitive with the comparison method on average despite having 77M fewer parameters during fine-tuning.4 Reducing the input embedding dimension saves a significant number of parameters at a noticeably smaller cost to accuracy than reducing the output embedding size . In light of this , the parameter allocation of multilingual models ( see Table 1 ) seems particularly inefficient . For a multilingual model with coupled embeddings , reducing the input embedding dimension to save parameters as proposed by Lan et al . ( 2020 ) is very detrimental to performance ( see Appendix A.5 for details ) . The results in this section indicate that the output embedding plays an important role in the transferability of pre-trained representations . For multilingual models in particular , a small input embedding dimension frees up a significant number of parameters at a small cost to performance . In the next section , we study how to improve the performance of a model by resizing embeddings and layers . | This paper systematically studies the impact of embedding coupling with multilingual language models. The authors observe that while na¨ıvely decoupling the input and output embedding parameters does not consistently improve downstream evaluation metrics, decoupling their shapes comes with a host of benefits. Moreover, they achieve significantly improved performance by reinvesting saved parameters to the width and depth of the Transformer layers on the XTREME benchmark. | SP:456ad1760ac9923417ff5158e569452b75036646 |
On the geometry of generalization and memorization in deep neural networks | 1 INTRODUCTION . Deep neural networks have many more learnable parameters than training examples , and could simply memorize the data instead of converging to a generalizable solution ( Novak et al. , 2018 ) . Moreover , standard regularization methods are insufficient to eliminate memorization of random labels , and network complexity measures fail to account for the generalizability of large neural networks ( Zhang et al. , 2016 ; Neyshabur et al. , 2014 ) . Yet , even though memorizing solutions exist , they are rarely learned in practice by neural networks ( Rolnick et al. , 2017 ) . Recent work have shown that a combination of architecture and stochastic gradient descent implicitly bias the training dynamics towards generalizable solutions ( Hardt et al. , 2016 ; Soudry et al. , 2018 ; Brutzkus et al. , 2017 ; Li and Liang , 2018 ; Saxe et al. , 2013 ; Lampinen and Ganguli , 2018 ) . However , these claims study either linear networks or two-layer non-linear networks . For deep neural networks , open questions remain on the structure of memorization , such as where and when in the layers of the network is memorization occurring ( e.g . evenly across all layers , gradually increasing with depth , or concentrated in early or late layers ) , and what are the drivers of this structure . Analytical tools for linear networks such as eigenvalue decomposition can not be directly applied to non-linear networks , so here we employ a recently developed geometric probe ( Chung et al. , 2018 ; Stephenson et al. , 2019 ) , based on replica mean field theory from statistical physics , to analyze the training dynamics and resulting structure of memorization . The probe measures not just the layer capacity , but also geometric properties of the object manifolds , explicitly linked by the theory . We find that deep neural networks ignore randomly labeled data in the early layers and epochs , instead learning generalizing features . Memorization occurs abruptly with depth in the final layers , caused by * : Equal contribution , + : Correspondence . decreasing manifold radius and dimension , whereas early layers are minimally affected . Notably , this structure does not arise due to gradients vanishing with depth . Instead , analytical analysis show that near initialization , the gradients from noise examples contribute minimally to the total gradient , and that networks are able to ignore noise due to the existence of ’ shared features ’ consisting of linear features shared by objects of the same class . Of practical consequence , generalization can then be re-gained by rolling back the parameters of the final layers of the network to an earlier epoch before the structural signatures of memorization occur . Moreover , the ’ double descent ’ phenomenon , where a model ’ s generalization performance initially decreases with model size before increasing , is linked to the non-monotonic dimensionality expansion of the object manifolds , as measured by the geometric probe . The manifold dimensionality also undergoes double descent , whereas other geometric measures , such as radius and center correlation are monotonic with model size . Our analysis reveals the structure of memorization in deep networks , and demonstrate the importance of measuring manifold geometric properties in tracing the effect of learning on neural networks . 2 RELATED WORK . By demonstrating that deep neural networks can easily fit random labels with standard training procedures , Zhang et al . ( 2016 ) showed that standard regularization strategies are not enough to prevent memorization . Since then , several works have explored the problem experimentally . Notably Arpit et al . ( 2017 ) examined the behavior of the network as a single unit when trained on random data , and observed that the training dynamics were qualitatively different when the network was trained on real data vs. noise . They observed experimentally that networks learn from ’ simple ’ patterns in the data first when trained with gradient descent , but do not give a rigorous explanation of this effect . In the case of deep linear models trained with mean squared error , more is known about the interplay between dynamics and generalization ( Saxe et al. , 2013 ) . While these models are linear , the training dynamics are not , and interestingly , these networks preferentially learn large singular values of the input-output correlation matrix first . During training , the dynamics act like a singular value detection wave ( Lampinen and Ganguli , 2018 ) , and so memorization of noisy modes happens late in training . Experimental works have explored the training dynamics using variants of Canonical Correlation Analysis ( Raghu et al. , 2017 ; Morcos et al. , 2018 ) , revealing different rates of learning across layers , and differences between networks that memorize or generalize ( Morcos et al. , 2018 ) . Using Centered Kernel Alignment , Kornblith et al . ( 2019 ) find that networks differ from each other the most in later layers . However , as these metrics measure similarity , experiments are limited to comparing different networks , offering limited insight into specific network instances . As noted in ( Wang et al. , 2018 ) , the similarity of networks trained on the same data with different initialization may be surprisingly low . Our work builds on this line of research by using a direct , rather than comparative , theory-based measure of the representation geometry ( Chung et al. , 2016 ; Cohen et al. , 2019 ) to probe the layerwise dynamics as learning gives way to memorization . With the direct theory-based measure , we can probe individual networks over the course of training , rather than comparing families of networks . 3 EXPERIMENTAL SETUP . As described in ( Arpit et al. , 2017 ) , we adopt the view of memorization as `` the behavior exhibited by DNNs trained on noise . '' We induce memorization by randomly permuting the labels for a fraction of the dataset . To fit these examples , a DNN must use spurious signals in the input to memorize the ‘ correct ’ random label . We train our models for either 1 , 000 epochs , or until they achieve > 99 % accuracy on the training set , implying that randomly labeled examples have been memorized . We do not use weight decay or any other regularization . Once a model has been trained with partially randomized labels , we apply the recently developed replica-based mean-field theoretic manifold analysis technique ( MFTMA hereafter ) ( Chung et al. , 2018 ) to analyze the hidden representations learned by the model at different layers and epochs of training . This quantitative measure of the underlying manifold geometry learned by the DNN provides insight into how information about learned features is encoded in the network . This method has been applied to pre-trained models ( Cohen et al. , 2019 ) , whereas here we study the training dynamics in the memorization regime . 3.1 DATASETS AND MODELS . We carried out experiments on a variety of neural network architectures and datasets . For CIFAR-100 ( Krizhevsky et al. , 2009 ) , we trained AlexNet ( Krizhevsky et al. , 2014 ) , VGG-16 ( Simonyan and Zisserman , 2014 ) and ResNet-18 ( He et al. , 2016 ) models , each slightly modified for use with the dataset . We also used Tiny ImageNet dataset1 , a reduced version of ImageNet ( Deng et al. , 2009 ) with ResNet-18 . Training methods similar to those used for the CIFAR-100 dataset did not result in complete memorization on Tiny ImageNet , owing to the larger and more complex dataset , and so we show results on partial memorization after training for 1,000 epochs . Due to space constraints , we present results for VGG-16 trained on CIFAR-100 . Other architectures and datasets have similar findings , as detailed in the Appendix . Our networks are trained on a dataset with some fraction of its labels randomly permuted . To analyze the behavior of the trained models , we define four subsets of examples as follows : Unpermuted examples : The set of labeled examples from the training set which did not have their labels permuted . That is , the networks were trained on these examples using the correct label . In the case of = 100 % permuted data , this set is empty , as we do not count examples with labels randomly assigned to the correct class . Permuted examples : The set of labeled examples from the training set which had their labels randomly permuted . The networks were trained to classify these examples according to their random labels . By design , there is some chance that the random assignment results in the label remaining unchanged , however these examples are still in the set of the permuted examples . The motivation for this choice can be found in the Appendix . Restored examples : These examples are the same as the permuted examples , except when carrying out analysis we restored the correct , unpermuted labels . For example , for a permuted example with 1This dataset is from the Tiny ImageNet Challenge : https : //tiny-imagenet.herokuapp.com/ an image of class ’ cat ’ that was trained with label ’ dog ’ , the corresponding restored example would be the same image with the label ’ cat ’ restored . A sampling of unpermuted , permuted , and restored examples is shown in Fig . 1A , with the denoted labels used for training and analysis . Finally , we define test examples : Test examples : The set of labeled examples from a holdout set not seen during training . All analyses on test examples are done using the correct label . 3.2 REPLICA-BASED MEAN FIELD THEORY MANIFOLD ANALYSIS . We apply the replica MFTMA analysis ( Chung et al. , 2018 ; Cohen et al. , 2019 ; Stephenson et al. , 2019 ) which formally connects object category manifolds ’ linear separability with the underlying geometric properties , such as manifold dimension , radius , and correlations . A key feature in object manifold capacity theory is that it generalises the notion of perceptron shattering capacity from discrete points to class manifolds . Given P object manifolds defined by the clouds of feature vectors in N feature dimension , where each manifold is assigned random binary labels where points within the same manifold have an identical label , rendering a total of 2P manifold dichotomies . The manifold capacity , αc = P/N is defined by the critical number of object manifolds where most of the manifold dichotomies can be shattered ( separated ) by a linear hyperplane . This is closely related to Cover ’ s function counting theorem , except in this theory , the units for counting P for capacity are category manifolds , rather than discrete point patterns . The manifold capacity , therefore , measures the linear separability of categories in the representation . Surprisingly , it ’ s been reported that the object manifold capacity for general point clouds can be formulated in a similar manner to the closed-form manifold capacity of D-dimensional balls of radius R in random orientations ( Chung et al. , 2016 ) , providing the closed form expressions for effective dimension DM and effective radius RM for the convex hulls of general point clouds in random orientation . More recently , the theory of manifolds has been refined to incorporate correlation structure in the manifold locations , allowing for the estimation of manifold capacities in real data with correlations ( Cohen et al. , 2019 ) . This analysis , based on the series of theoretical developments mentioned above , formally links the linear separability of category class manifolds ( manifold capacity , αM ) with the class manifolds ’ geometric properties ( manifold dimension , DM , manifold radius , RM , and the correlations between the manifold centers , ρcenter ) . The descriptions of the manifold capacity and the geometrical properties are summarized below ( for more details , see Appendix ) . Manifold Capacity αM = P/N is a measure of the decodable class information in a given data , defined by critical number of object manifolds ( P ) that can be linearly classified with random dichotomy labels for each manifold , in feature dimension N. Large αM implies well-separated manifolds in feature space . Using replica mean field theory , this quantity can be predicted ( Chung et al. , 2018 ) by object manifolds ’ dimension , radius , and their center correlation structure provided below ( see illustrations in Fig . 1C and Appendix ) . Note that the manifold capacity can also be computed empirically ( Empirical capacity , hereafter ) , by doing a bisection search to find the critical number of features N such that the fraction of linearly separable random manifold dichotomies is close to 1/2 . We show that theoretical predictions match empirical capacity with our data in Fig . 1B . Manifold Dimension DM captures the dimensions of the set of anchor points , which are representative support vectors that determine the optimal hyperplane separating the binary dichotomy of manifolds . These anchor points are estimated from the guiding Gaussian vectors ( Fig . 1C and Appendix ) , and the position of the anchor point changes as orientations of other manifolds are varied . The average of the dot product between anchor points and the Gaussian vector defines the effective manifold dimension of given point clouds , and it reflects the dimensionality of embedded anchor points in the optimal margin hyperplane . A small dimension implies that the anchor points occupy a low dimensional subspace . Manifold Radius RM is an average norm of the anchor points in the manifold subspace , capturing the manifold size seen by the decision boundary . Small RM implies tightly grouped anchor points . Center Correlation ρcenter measures the average of absolute values of pairwise correlations between various centers . A small correlation indicates that , on average , manifolds lie along different directions in feature space . In the rest of the text , we will refer to the quantities αM , DM , RM , and ρM as the Manifold Geometry Metrics ( MGMs ) . Small values for manifold radius , dimension and center correlation have been shown to result in higher values for manifold capacity ( Chung et al. , 2018 ; Cohen et al. , 2019 ) , and so represent a more favorable geometry for classification ( Fig . 1C ) . For all experiments , we evaluate these four quantities using P = 100 classes , with M = 50 randomly drawn examples per class . We define unpermuted , permuted , restored , and test manifolds for each class at each layer of the network . Given a neural network N ( x ) , we extract Nl ( x ) , the activation vector at layer l generated on input x . We then define a manifold by the point cloud of activation vectors generated by inputs of the same class . This results in P manifolds , one for each class . The set of unpermuted manifolds is then obtained by using the corresponding manifolds with examples and labels that were unpermuted . The set of permuted , restored , and test manifolds are defined similarly . We run the MFTMA on each set of manifolds following the procedures in ( Chung et al. , 2018 ; Cohen et al. , 2019 ; Stephenson et al. , 2019 ) . All results are conducted with 10 random seeds , which govern the network initialization , label permutation , and MFMTA analysis initial conditions . | This paper analyses memorization in DNNs, from the lens of memorization = fitting random labels, and finds that it seems to happen in later layers. These results are obtained using the MFTMA framework, a manifold analysis tool, testing geometric properties of individual layers. The analysis also attempts to explain why such a phenomenon exists, and makes a few interesting observations. | SP:75052bcb31029d6f128915eedcb3c9ee5143a9a4 |
On the geometry of generalization and memorization in deep neural networks | 1 INTRODUCTION . Deep neural networks have many more learnable parameters than training examples , and could simply memorize the data instead of converging to a generalizable solution ( Novak et al. , 2018 ) . Moreover , standard regularization methods are insufficient to eliminate memorization of random labels , and network complexity measures fail to account for the generalizability of large neural networks ( Zhang et al. , 2016 ; Neyshabur et al. , 2014 ) . Yet , even though memorizing solutions exist , they are rarely learned in practice by neural networks ( Rolnick et al. , 2017 ) . Recent work have shown that a combination of architecture and stochastic gradient descent implicitly bias the training dynamics towards generalizable solutions ( Hardt et al. , 2016 ; Soudry et al. , 2018 ; Brutzkus et al. , 2017 ; Li and Liang , 2018 ; Saxe et al. , 2013 ; Lampinen and Ganguli , 2018 ) . However , these claims study either linear networks or two-layer non-linear networks . For deep neural networks , open questions remain on the structure of memorization , such as where and when in the layers of the network is memorization occurring ( e.g . evenly across all layers , gradually increasing with depth , or concentrated in early or late layers ) , and what are the drivers of this structure . Analytical tools for linear networks such as eigenvalue decomposition can not be directly applied to non-linear networks , so here we employ a recently developed geometric probe ( Chung et al. , 2018 ; Stephenson et al. , 2019 ) , based on replica mean field theory from statistical physics , to analyze the training dynamics and resulting structure of memorization . The probe measures not just the layer capacity , but also geometric properties of the object manifolds , explicitly linked by the theory . We find that deep neural networks ignore randomly labeled data in the early layers and epochs , instead learning generalizing features . Memorization occurs abruptly with depth in the final layers , caused by * : Equal contribution , + : Correspondence . decreasing manifold radius and dimension , whereas early layers are minimally affected . Notably , this structure does not arise due to gradients vanishing with depth . Instead , analytical analysis show that near initialization , the gradients from noise examples contribute minimally to the total gradient , and that networks are able to ignore noise due to the existence of ’ shared features ’ consisting of linear features shared by objects of the same class . Of practical consequence , generalization can then be re-gained by rolling back the parameters of the final layers of the network to an earlier epoch before the structural signatures of memorization occur . Moreover , the ’ double descent ’ phenomenon , where a model ’ s generalization performance initially decreases with model size before increasing , is linked to the non-monotonic dimensionality expansion of the object manifolds , as measured by the geometric probe . The manifold dimensionality also undergoes double descent , whereas other geometric measures , such as radius and center correlation are monotonic with model size . Our analysis reveals the structure of memorization in deep networks , and demonstrate the importance of measuring manifold geometric properties in tracing the effect of learning on neural networks . 2 RELATED WORK . By demonstrating that deep neural networks can easily fit random labels with standard training procedures , Zhang et al . ( 2016 ) showed that standard regularization strategies are not enough to prevent memorization . Since then , several works have explored the problem experimentally . Notably Arpit et al . ( 2017 ) examined the behavior of the network as a single unit when trained on random data , and observed that the training dynamics were qualitatively different when the network was trained on real data vs. noise . They observed experimentally that networks learn from ’ simple ’ patterns in the data first when trained with gradient descent , but do not give a rigorous explanation of this effect . In the case of deep linear models trained with mean squared error , more is known about the interplay between dynamics and generalization ( Saxe et al. , 2013 ) . While these models are linear , the training dynamics are not , and interestingly , these networks preferentially learn large singular values of the input-output correlation matrix first . During training , the dynamics act like a singular value detection wave ( Lampinen and Ganguli , 2018 ) , and so memorization of noisy modes happens late in training . Experimental works have explored the training dynamics using variants of Canonical Correlation Analysis ( Raghu et al. , 2017 ; Morcos et al. , 2018 ) , revealing different rates of learning across layers , and differences between networks that memorize or generalize ( Morcos et al. , 2018 ) . Using Centered Kernel Alignment , Kornblith et al . ( 2019 ) find that networks differ from each other the most in later layers . However , as these metrics measure similarity , experiments are limited to comparing different networks , offering limited insight into specific network instances . As noted in ( Wang et al. , 2018 ) , the similarity of networks trained on the same data with different initialization may be surprisingly low . Our work builds on this line of research by using a direct , rather than comparative , theory-based measure of the representation geometry ( Chung et al. , 2016 ; Cohen et al. , 2019 ) to probe the layerwise dynamics as learning gives way to memorization . With the direct theory-based measure , we can probe individual networks over the course of training , rather than comparing families of networks . 3 EXPERIMENTAL SETUP . As described in ( Arpit et al. , 2017 ) , we adopt the view of memorization as `` the behavior exhibited by DNNs trained on noise . '' We induce memorization by randomly permuting the labels for a fraction of the dataset . To fit these examples , a DNN must use spurious signals in the input to memorize the ‘ correct ’ random label . We train our models for either 1 , 000 epochs , or until they achieve > 99 % accuracy on the training set , implying that randomly labeled examples have been memorized . We do not use weight decay or any other regularization . Once a model has been trained with partially randomized labels , we apply the recently developed replica-based mean-field theoretic manifold analysis technique ( MFTMA hereafter ) ( Chung et al. , 2018 ) to analyze the hidden representations learned by the model at different layers and epochs of training . This quantitative measure of the underlying manifold geometry learned by the DNN provides insight into how information about learned features is encoded in the network . This method has been applied to pre-trained models ( Cohen et al. , 2019 ) , whereas here we study the training dynamics in the memorization regime . 3.1 DATASETS AND MODELS . We carried out experiments on a variety of neural network architectures and datasets . For CIFAR-100 ( Krizhevsky et al. , 2009 ) , we trained AlexNet ( Krizhevsky et al. , 2014 ) , VGG-16 ( Simonyan and Zisserman , 2014 ) and ResNet-18 ( He et al. , 2016 ) models , each slightly modified for use with the dataset . We also used Tiny ImageNet dataset1 , a reduced version of ImageNet ( Deng et al. , 2009 ) with ResNet-18 . Training methods similar to those used for the CIFAR-100 dataset did not result in complete memorization on Tiny ImageNet , owing to the larger and more complex dataset , and so we show results on partial memorization after training for 1,000 epochs . Due to space constraints , we present results for VGG-16 trained on CIFAR-100 . Other architectures and datasets have similar findings , as detailed in the Appendix . Our networks are trained on a dataset with some fraction of its labels randomly permuted . To analyze the behavior of the trained models , we define four subsets of examples as follows : Unpermuted examples : The set of labeled examples from the training set which did not have their labels permuted . That is , the networks were trained on these examples using the correct label . In the case of = 100 % permuted data , this set is empty , as we do not count examples with labels randomly assigned to the correct class . Permuted examples : The set of labeled examples from the training set which had their labels randomly permuted . The networks were trained to classify these examples according to their random labels . By design , there is some chance that the random assignment results in the label remaining unchanged , however these examples are still in the set of the permuted examples . The motivation for this choice can be found in the Appendix . Restored examples : These examples are the same as the permuted examples , except when carrying out analysis we restored the correct , unpermuted labels . For example , for a permuted example with 1This dataset is from the Tiny ImageNet Challenge : https : //tiny-imagenet.herokuapp.com/ an image of class ’ cat ’ that was trained with label ’ dog ’ , the corresponding restored example would be the same image with the label ’ cat ’ restored . A sampling of unpermuted , permuted , and restored examples is shown in Fig . 1A , with the denoted labels used for training and analysis . Finally , we define test examples : Test examples : The set of labeled examples from a holdout set not seen during training . All analyses on test examples are done using the correct label . 3.2 REPLICA-BASED MEAN FIELD THEORY MANIFOLD ANALYSIS . We apply the replica MFTMA analysis ( Chung et al. , 2018 ; Cohen et al. , 2019 ; Stephenson et al. , 2019 ) which formally connects object category manifolds ’ linear separability with the underlying geometric properties , such as manifold dimension , radius , and correlations . A key feature in object manifold capacity theory is that it generalises the notion of perceptron shattering capacity from discrete points to class manifolds . Given P object manifolds defined by the clouds of feature vectors in N feature dimension , where each manifold is assigned random binary labels where points within the same manifold have an identical label , rendering a total of 2P manifold dichotomies . The manifold capacity , αc = P/N is defined by the critical number of object manifolds where most of the manifold dichotomies can be shattered ( separated ) by a linear hyperplane . This is closely related to Cover ’ s function counting theorem , except in this theory , the units for counting P for capacity are category manifolds , rather than discrete point patterns . The manifold capacity , therefore , measures the linear separability of categories in the representation . Surprisingly , it ’ s been reported that the object manifold capacity for general point clouds can be formulated in a similar manner to the closed-form manifold capacity of D-dimensional balls of radius R in random orientations ( Chung et al. , 2016 ) , providing the closed form expressions for effective dimension DM and effective radius RM for the convex hulls of general point clouds in random orientation . More recently , the theory of manifolds has been refined to incorporate correlation structure in the manifold locations , allowing for the estimation of manifold capacities in real data with correlations ( Cohen et al. , 2019 ) . This analysis , based on the series of theoretical developments mentioned above , formally links the linear separability of category class manifolds ( manifold capacity , αM ) with the class manifolds ’ geometric properties ( manifold dimension , DM , manifold radius , RM , and the correlations between the manifold centers , ρcenter ) . The descriptions of the manifold capacity and the geometrical properties are summarized below ( for more details , see Appendix ) . Manifold Capacity αM = P/N is a measure of the decodable class information in a given data , defined by critical number of object manifolds ( P ) that can be linearly classified with random dichotomy labels for each manifold , in feature dimension N. Large αM implies well-separated manifolds in feature space . Using replica mean field theory , this quantity can be predicted ( Chung et al. , 2018 ) by object manifolds ’ dimension , radius , and their center correlation structure provided below ( see illustrations in Fig . 1C and Appendix ) . Note that the manifold capacity can also be computed empirically ( Empirical capacity , hereafter ) , by doing a bisection search to find the critical number of features N such that the fraction of linearly separable random manifold dichotomies is close to 1/2 . We show that theoretical predictions match empirical capacity with our data in Fig . 1B . Manifold Dimension DM captures the dimensions of the set of anchor points , which are representative support vectors that determine the optimal hyperplane separating the binary dichotomy of manifolds . These anchor points are estimated from the guiding Gaussian vectors ( Fig . 1C and Appendix ) , and the position of the anchor point changes as orientations of other manifolds are varied . The average of the dot product between anchor points and the Gaussian vector defines the effective manifold dimension of given point clouds , and it reflects the dimensionality of embedded anchor points in the optimal margin hyperplane . A small dimension implies that the anchor points occupy a low dimensional subspace . Manifold Radius RM is an average norm of the anchor points in the manifold subspace , capturing the manifold size seen by the decision boundary . Small RM implies tightly grouped anchor points . Center Correlation ρcenter measures the average of absolute values of pairwise correlations between various centers . A small correlation indicates that , on average , manifolds lie along different directions in feature space . In the rest of the text , we will refer to the quantities αM , DM , RM , and ρM as the Manifold Geometry Metrics ( MGMs ) . Small values for manifold radius , dimension and center correlation have been shown to result in higher values for manifold capacity ( Chung et al. , 2018 ; Cohen et al. , 2019 ) , and so represent a more favorable geometry for classification ( Fig . 1C ) . For all experiments , we evaluate these four quantities using P = 100 classes , with M = 50 randomly drawn examples per class . We define unpermuted , permuted , restored , and test manifolds for each class at each layer of the network . Given a neural network N ( x ) , we extract Nl ( x ) , the activation vector at layer l generated on input x . We then define a manifold by the point cloud of activation vectors generated by inputs of the same class . This results in P manifolds , one for each class . The set of unpermuted manifolds is then obtained by using the corresponding manifolds with examples and labels that were unpermuted . The set of permuted , restored , and test manifolds are defined similarly . We run the MFTMA on each set of manifolds following the procedures in ( Chung et al. , 2018 ; Cohen et al. , 2019 ; Stephenson et al. , 2019 ) . All results are conducted with 10 random seeds , which govern the network initialization , label permutation , and MFMTA analysis initial conditions . | This paper investigates memorization in deep neural networks (DNNs). Authors leverage mean field theoretic geometric analysis method (MFTMA) to analyze when and where memorization occurs in a DNN. Through empirical analysis, they show that i) generalizing feature are learned initially and that memorization happen later in training mostly in the top layers ii) we can mitigate memorization by rewinding the top layers parameters to earlier values. They also show that their MFTMA metrics can highlight the phenomena of double decent. Finally, they demonstrate that gradient descent initially ignores noisy example and focus on correctly labeled examples. | SP:75052bcb31029d6f128915eedcb3c9ee5143a9a4 |
On the geometry of generalization and memorization in deep neural networks | 1 INTRODUCTION . Deep neural networks have many more learnable parameters than training examples , and could simply memorize the data instead of converging to a generalizable solution ( Novak et al. , 2018 ) . Moreover , standard regularization methods are insufficient to eliminate memorization of random labels , and network complexity measures fail to account for the generalizability of large neural networks ( Zhang et al. , 2016 ; Neyshabur et al. , 2014 ) . Yet , even though memorizing solutions exist , they are rarely learned in practice by neural networks ( Rolnick et al. , 2017 ) . Recent work have shown that a combination of architecture and stochastic gradient descent implicitly bias the training dynamics towards generalizable solutions ( Hardt et al. , 2016 ; Soudry et al. , 2018 ; Brutzkus et al. , 2017 ; Li and Liang , 2018 ; Saxe et al. , 2013 ; Lampinen and Ganguli , 2018 ) . However , these claims study either linear networks or two-layer non-linear networks . For deep neural networks , open questions remain on the structure of memorization , such as where and when in the layers of the network is memorization occurring ( e.g . evenly across all layers , gradually increasing with depth , or concentrated in early or late layers ) , and what are the drivers of this structure . Analytical tools for linear networks such as eigenvalue decomposition can not be directly applied to non-linear networks , so here we employ a recently developed geometric probe ( Chung et al. , 2018 ; Stephenson et al. , 2019 ) , based on replica mean field theory from statistical physics , to analyze the training dynamics and resulting structure of memorization . The probe measures not just the layer capacity , but also geometric properties of the object manifolds , explicitly linked by the theory . We find that deep neural networks ignore randomly labeled data in the early layers and epochs , instead learning generalizing features . Memorization occurs abruptly with depth in the final layers , caused by * : Equal contribution , + : Correspondence . decreasing manifold radius and dimension , whereas early layers are minimally affected . Notably , this structure does not arise due to gradients vanishing with depth . Instead , analytical analysis show that near initialization , the gradients from noise examples contribute minimally to the total gradient , and that networks are able to ignore noise due to the existence of ’ shared features ’ consisting of linear features shared by objects of the same class . Of practical consequence , generalization can then be re-gained by rolling back the parameters of the final layers of the network to an earlier epoch before the structural signatures of memorization occur . Moreover , the ’ double descent ’ phenomenon , where a model ’ s generalization performance initially decreases with model size before increasing , is linked to the non-monotonic dimensionality expansion of the object manifolds , as measured by the geometric probe . The manifold dimensionality also undergoes double descent , whereas other geometric measures , such as radius and center correlation are monotonic with model size . Our analysis reveals the structure of memorization in deep networks , and demonstrate the importance of measuring manifold geometric properties in tracing the effect of learning on neural networks . 2 RELATED WORK . By demonstrating that deep neural networks can easily fit random labels with standard training procedures , Zhang et al . ( 2016 ) showed that standard regularization strategies are not enough to prevent memorization . Since then , several works have explored the problem experimentally . Notably Arpit et al . ( 2017 ) examined the behavior of the network as a single unit when trained on random data , and observed that the training dynamics were qualitatively different when the network was trained on real data vs. noise . They observed experimentally that networks learn from ’ simple ’ patterns in the data first when trained with gradient descent , but do not give a rigorous explanation of this effect . In the case of deep linear models trained with mean squared error , more is known about the interplay between dynamics and generalization ( Saxe et al. , 2013 ) . While these models are linear , the training dynamics are not , and interestingly , these networks preferentially learn large singular values of the input-output correlation matrix first . During training , the dynamics act like a singular value detection wave ( Lampinen and Ganguli , 2018 ) , and so memorization of noisy modes happens late in training . Experimental works have explored the training dynamics using variants of Canonical Correlation Analysis ( Raghu et al. , 2017 ; Morcos et al. , 2018 ) , revealing different rates of learning across layers , and differences between networks that memorize or generalize ( Morcos et al. , 2018 ) . Using Centered Kernel Alignment , Kornblith et al . ( 2019 ) find that networks differ from each other the most in later layers . However , as these metrics measure similarity , experiments are limited to comparing different networks , offering limited insight into specific network instances . As noted in ( Wang et al. , 2018 ) , the similarity of networks trained on the same data with different initialization may be surprisingly low . Our work builds on this line of research by using a direct , rather than comparative , theory-based measure of the representation geometry ( Chung et al. , 2016 ; Cohen et al. , 2019 ) to probe the layerwise dynamics as learning gives way to memorization . With the direct theory-based measure , we can probe individual networks over the course of training , rather than comparing families of networks . 3 EXPERIMENTAL SETUP . As described in ( Arpit et al. , 2017 ) , we adopt the view of memorization as `` the behavior exhibited by DNNs trained on noise . '' We induce memorization by randomly permuting the labels for a fraction of the dataset . To fit these examples , a DNN must use spurious signals in the input to memorize the ‘ correct ’ random label . We train our models for either 1 , 000 epochs , or until they achieve > 99 % accuracy on the training set , implying that randomly labeled examples have been memorized . We do not use weight decay or any other regularization . Once a model has been trained with partially randomized labels , we apply the recently developed replica-based mean-field theoretic manifold analysis technique ( MFTMA hereafter ) ( Chung et al. , 2018 ) to analyze the hidden representations learned by the model at different layers and epochs of training . This quantitative measure of the underlying manifold geometry learned by the DNN provides insight into how information about learned features is encoded in the network . This method has been applied to pre-trained models ( Cohen et al. , 2019 ) , whereas here we study the training dynamics in the memorization regime . 3.1 DATASETS AND MODELS . We carried out experiments on a variety of neural network architectures and datasets . For CIFAR-100 ( Krizhevsky et al. , 2009 ) , we trained AlexNet ( Krizhevsky et al. , 2014 ) , VGG-16 ( Simonyan and Zisserman , 2014 ) and ResNet-18 ( He et al. , 2016 ) models , each slightly modified for use with the dataset . We also used Tiny ImageNet dataset1 , a reduced version of ImageNet ( Deng et al. , 2009 ) with ResNet-18 . Training methods similar to those used for the CIFAR-100 dataset did not result in complete memorization on Tiny ImageNet , owing to the larger and more complex dataset , and so we show results on partial memorization after training for 1,000 epochs . Due to space constraints , we present results for VGG-16 trained on CIFAR-100 . Other architectures and datasets have similar findings , as detailed in the Appendix . Our networks are trained on a dataset with some fraction of its labels randomly permuted . To analyze the behavior of the trained models , we define four subsets of examples as follows : Unpermuted examples : The set of labeled examples from the training set which did not have their labels permuted . That is , the networks were trained on these examples using the correct label . In the case of = 100 % permuted data , this set is empty , as we do not count examples with labels randomly assigned to the correct class . Permuted examples : The set of labeled examples from the training set which had their labels randomly permuted . The networks were trained to classify these examples according to their random labels . By design , there is some chance that the random assignment results in the label remaining unchanged , however these examples are still in the set of the permuted examples . The motivation for this choice can be found in the Appendix . Restored examples : These examples are the same as the permuted examples , except when carrying out analysis we restored the correct , unpermuted labels . For example , for a permuted example with 1This dataset is from the Tiny ImageNet Challenge : https : //tiny-imagenet.herokuapp.com/ an image of class ’ cat ’ that was trained with label ’ dog ’ , the corresponding restored example would be the same image with the label ’ cat ’ restored . A sampling of unpermuted , permuted , and restored examples is shown in Fig . 1A , with the denoted labels used for training and analysis . Finally , we define test examples : Test examples : The set of labeled examples from a holdout set not seen during training . All analyses on test examples are done using the correct label . 3.2 REPLICA-BASED MEAN FIELD THEORY MANIFOLD ANALYSIS . We apply the replica MFTMA analysis ( Chung et al. , 2018 ; Cohen et al. , 2019 ; Stephenson et al. , 2019 ) which formally connects object category manifolds ’ linear separability with the underlying geometric properties , such as manifold dimension , radius , and correlations . A key feature in object manifold capacity theory is that it generalises the notion of perceptron shattering capacity from discrete points to class manifolds . Given P object manifolds defined by the clouds of feature vectors in N feature dimension , where each manifold is assigned random binary labels where points within the same manifold have an identical label , rendering a total of 2P manifold dichotomies . The manifold capacity , αc = P/N is defined by the critical number of object manifolds where most of the manifold dichotomies can be shattered ( separated ) by a linear hyperplane . This is closely related to Cover ’ s function counting theorem , except in this theory , the units for counting P for capacity are category manifolds , rather than discrete point patterns . The manifold capacity , therefore , measures the linear separability of categories in the representation . Surprisingly , it ’ s been reported that the object manifold capacity for general point clouds can be formulated in a similar manner to the closed-form manifold capacity of D-dimensional balls of radius R in random orientations ( Chung et al. , 2016 ) , providing the closed form expressions for effective dimension DM and effective radius RM for the convex hulls of general point clouds in random orientation . More recently , the theory of manifolds has been refined to incorporate correlation structure in the manifold locations , allowing for the estimation of manifold capacities in real data with correlations ( Cohen et al. , 2019 ) . This analysis , based on the series of theoretical developments mentioned above , formally links the linear separability of category class manifolds ( manifold capacity , αM ) with the class manifolds ’ geometric properties ( manifold dimension , DM , manifold radius , RM , and the correlations between the manifold centers , ρcenter ) . The descriptions of the manifold capacity and the geometrical properties are summarized below ( for more details , see Appendix ) . Manifold Capacity αM = P/N is a measure of the decodable class information in a given data , defined by critical number of object manifolds ( P ) that can be linearly classified with random dichotomy labels for each manifold , in feature dimension N. Large αM implies well-separated manifolds in feature space . Using replica mean field theory , this quantity can be predicted ( Chung et al. , 2018 ) by object manifolds ’ dimension , radius , and their center correlation structure provided below ( see illustrations in Fig . 1C and Appendix ) . Note that the manifold capacity can also be computed empirically ( Empirical capacity , hereafter ) , by doing a bisection search to find the critical number of features N such that the fraction of linearly separable random manifold dichotomies is close to 1/2 . We show that theoretical predictions match empirical capacity with our data in Fig . 1B . Manifold Dimension DM captures the dimensions of the set of anchor points , which are representative support vectors that determine the optimal hyperplane separating the binary dichotomy of manifolds . These anchor points are estimated from the guiding Gaussian vectors ( Fig . 1C and Appendix ) , and the position of the anchor point changes as orientations of other manifolds are varied . The average of the dot product between anchor points and the Gaussian vector defines the effective manifold dimension of given point clouds , and it reflects the dimensionality of embedded anchor points in the optimal margin hyperplane . A small dimension implies that the anchor points occupy a low dimensional subspace . Manifold Radius RM is an average norm of the anchor points in the manifold subspace , capturing the manifold size seen by the decision boundary . Small RM implies tightly grouped anchor points . Center Correlation ρcenter measures the average of absolute values of pairwise correlations between various centers . A small correlation indicates that , on average , manifolds lie along different directions in feature space . In the rest of the text , we will refer to the quantities αM , DM , RM , and ρM as the Manifold Geometry Metrics ( MGMs ) . Small values for manifold radius , dimension and center correlation have been shown to result in higher values for manifold capacity ( Chung et al. , 2018 ; Cohen et al. , 2019 ) , and so represent a more favorable geometry for classification ( Fig . 1C ) . For all experiments , we evaluate these four quantities using P = 100 classes , with M = 50 randomly drawn examples per class . We define unpermuted , permuted , restored , and test manifolds for each class at each layer of the network . Given a neural network N ( x ) , we extract Nl ( x ) , the activation vector at layer l generated on input x . We then define a manifold by the point cloud of activation vectors generated by inputs of the same class . This results in P manifolds , one for each class . The set of unpermuted manifolds is then obtained by using the corresponding manifolds with examples and labels that were unpermuted . The set of permuted , restored , and test manifolds are defined similarly . We run the MFTMA on each set of manifolds following the procedures in ( Chung et al. , 2018 ; Cohen et al. , 2019 ; Stephenson et al. , 2019 ) . All results are conducted with 10 random seeds , which govern the network initialization , label permutation , and MFMTA analysis initial conditions . | The authors apply MFTMA to DNNs trained on CIFAR with label noise to analyze their behaviors between generalization and memorization. Based on experimental results, they claim that what is involved in memorization are not lower layers but higher layers. This claim is convincing. Another claim that this is not caused by a vanishing gradient effect is plausible, too. I'm sure these results give some insights into understanding generalization and memorization by DNNs. | SP:75052bcb31029d6f128915eedcb3c9ee5143a9a4 |
Grounding Physical Concepts of Objects and Events Through Dynamic Visual Reasoning | 1 INTRODUCTION . Visual reasoning in dynamic scenes involves both the understanding of compositional properties , relationships , and events of objects , and the inference and prediction of their temporal and causal structures . As depicted in Fig . 1 , to answer the question “ What will happen next ? ” based on the observed video frames , one needs to detect the object trajectories , predict their dynamics , analyze the temporal structures , and ground visual objects and events to get the answer “ The blue sphere and the yellow object collide ” . Recently , various end-to-end neural network-based approaches have been proposed for joint understanding of video and language ( Lei et al. , 2018 ; Fan et al. , 2019 ) . While these methods have shown great success in learning to recognize visually complex concepts , such as human activities ( Xu et al. , 2017 ; Ye et al. , 2017 ) , they typically fail on benchmarks that require the understanding of compositional and causal structures in the videos and text ( Yi et al. , 2020 ) . Another line of research has been focusing on building modular neural networks that can represent the compositional structures in scenes and questions , such as object-centric scene structures and multi-hop reasoning ( Andreas et al. , 2016 ; Johnson et al. , 2017b ; Hudson & Manning , 2019 ) . However , these methods are designed for static images and do not handle the temporal and causal structure in dynamic scenes well , leading to inferior performance on video causal reasoning benchmark CLEVRER ( Yi et al. , 2020 ) . To model the temporal and causal structures in dynamic scenes , Yi et al . ( 2020 ) proposed an oracle model to combine symbolic representation with video dynamics modeling and achieved state-ofthe-art performance on CLEVRER . However , this model requires videos with dense annotations for visual attributes and physical events , which are impractical or extremely labor-intensive in real scenes . Project page : http : //dcl.csail.mit.edu We argue that such dense explicit video annotations are unnecessary for video reasoning , since they are naturally encoded in the question answer pairs associated with the videos . For example , the question answer pair and the video in Fig . 1 can implicitly inform a model what the concepts “ sphere ” , “ blue ” , “ yellow ” and “ collide ” really mean . However , a video may contain multiple fast-moving occluded objects and complex object interactions , and the questions and answers have diverse forms . It remains an open and challenging problem to simultaneously represent objects over time , train an accurate dynamic model from raw videos , and align objects with visual properties and events for accurate temporal and causal reasoning , using vision and language as the only supervision . Our main ideas are to factorize video perception and reasoning into several modules : object tracking , object and event concept grounding , and dynamics prediction . We first detect objects in the video , associating them into object tracks across the frames . We can then ground various object and event concepts from language , train a dynamic model on top of object tracks for future and counterfactual predictions , analyze relationships between events , and answer queries based on these extracted representations . All these modules can be trained jointly by watching videos and reading paired questions and answers . To achieve this goal , we introduce Dynamic Concept Learner ( DCL ) , a unified neural-symbolic framework for recognizing objects and events in videos and analyzing their temporal and causal structures , without explicit annotations on visual attributes and physical events such as collisions during training . To facilitate model training , a multi-step training paradigm has been proposed . We first run an object detector on individual frames and associate objects across frames based on a motion-based correspondence . Next , our model learns concepts about object properties , relationships , and events by reading paired questions and answers that describe or explain the events in the video . Then , we leverage the acquired visual concepts in the previous steps to refine the object association across frames . Finally , we train a dynamics prediction network ( Li et al. , 2019b ) based on the refined object trajectories and optimize it jointly with other learning parts in this unified framework . Such a training paradigm ensures that all neural modules share the same latent space for representing concepts and they can bootstrap the learning of each other . We evaluate DCL ’ s performance on CLEVRER , a video reasoning benchmark that includes descriptive , explanatory , predictive , and counterfactual reasoning with a uniform language interface . DCL achieves state-of-the-art performance on all question categories and requires no scene supervision such as object properties and collision events . To further examine the grounding accuracy and transferability of the acquired concepts , we introduce two new benchmarks for video-text retrieval and spatial-temporal grounding and localization on the CLEVRER videos , namely CLEVRERRetrieval and CLEVRER-Grounding . Without any further training , our model generalizes well to these benchmarks , surpassing the baseline by a noticeable margin . 2 RELATED WORK . Our work is related to reasoning and answering questions about visual content . Early studies like ( Wu et al. , 2016 ; Zhu et al. , 2016 ; Gan et al. , 2017 ) typically adopted monolithic network architectures and mainly focused on visual understanding . To perform deeper visual reasoning , neural module networks were extensively studied in recent works ( Johnson et al. , 2017a ; Hu et al. , 2018 ; Hudson & Manning , 2018 ; Amizadeh et al. , 2020 ) , where they represent symbolic operations with small neural networks and perform multi-hop reasoning . Some previous research has also attempted to learn visual concepts through visual question answering ( Mao et al. , 2019 ) . However , it mainly focused on learning static concepts in images , while our DCL aims at learning dynamic concepts like moving and collision in videos and at making use of these concepts for temporal and causal reasoning . Later , visual reasoning was extended to more complex dynamic videos ( Lei et al. , 2018 ; Fan et al. , 2019 ; Li et al. , 2020 ; 2019a ; Huang et al. , 2020 ) . Recently , Yi et al . ( 2020 ) proposed CLEVRER , a new video reasoning benchmark for evaluating computational models ’ comprehension of the causal structure behind physical object interaction . They also developed an oracle model , combining the neuro-symbolic visual question-answering model ( Yi et al. , 2018 ) with the dynamics prediction model ( Li et al. , 2019b ) , showing competitive performance . However , this model requires explicit labels for object attributes , masks , and spatio-temporal localization of events during training . Instead , our DCL has no reliance on any labels for objects and events and can learn these concepts through natural supervision ( i.e. , videos and question-answer pairs ) . Our work is also related to temporal and relational reasoning in videos via neural networks ( Wang & Gupta , 2018 ; Materzynska et al. , 2020 ; Ji et al. , 2020 ) . These works typically rely on specific action annotations , while our DCL learns to ground object and event concepts and analyze their temporal relations through question answering . Recently , various benchmarks ( Riochet et al. , 2018 ; Bakhtin et al. , 2019 ; Girdhar & Ramanan , 2020 ; Baradel et al. , 2020 ; Gan et al. , 2020 ) have been proposed to study dynamics and reasoning in physical scenes . However , these datasets mainly target at pure video understanding and do not contain natural language question answering . Much research has been studying dynamic modeling for physical scenes ( Lerer et al. , 2016 ; Battaglia et al. , 2013 ; Mottaghi et al. , 2016 ; Finn et al. , 2016 ; Shao et al. , 2014 ; Fire & Zhu , 2015 ; Ye et al. , 2018 ; Li et al. , 2019b ) . We adopt PropNet ( Li et al. , 2019b ) for dynamics prediction and feed the predicted scenes to the video feature extractor and the neuro-symbolic executor for event prediction and question answering . While many works ( Zhou et al. , 2019 ; 2018 ; Gan et al. , 2015 ) have been studying on the problems of understanding human actions and activities ( e.g. , running , cooking , cleaning ) in videos , our work ’ s primary goal is to design a unified framework for learning physical object and event concepts ( e.g. , collision , falling , stability ) . These tasks are of great importance in practical applications such as industrial robot manipulation which requires AI systems with human-like physical common sense . 3 DYNAMIC CONCEPT LEARNER . In this section , we introduce a new video reasoning model , Dynamic Concept Learner ( DCL ) , which learns to recognize video attributes , events , and dynamics and to analyze their temporal and causal structures , all through watching videos and answering corresponding questions . DCL contains five modules , 1 ) an object trajectory detector , 2 ) video feature extractor , 3 ) a dynamic predictor , 4 ) a language program parser , and 5 ) a neural symbolic executor . As shown in Fig . 2 , given an input video , the trajectory detector detects objects in each frame and associates them into trajectories ; the feature extractor then represents them as latent feature vectors . After that , DCL quantizes the objects ’ static concepts ( i.e. , color , shape , and material ) by matching the latent object features with the corresponding concept embeddings in the executor . As these static concepts are motion-independent , they can be adopted as an additional criteria to refine the object trajectories . Based on the refined trajectories , the dynamics predictor predicts the objects ’ movement and interactions in future and counterfactual scenes . The language parser parses the question and choices into functional programs , which are executed by the program executor on the latent representation space to get answers . The object and event concept embeddings and the object-centric representation share the same latent space ; answering questions associated with videos can directly optimize them through backpropagation . The object trajectories and dynamics can be refined by the object static attributes predicted by DCL . Our framework enjoys the advantages of both transparency and efficiency , since it enables step-by-step investigations of the whole reasoning process and has no requirements for explicit annotations of visual attributes , events , and object masks . 3.1 MODEL DETAILS . Object Detection and Tracking . Given a video , the object trajectory detector detects object proposals in each frame and connects them into object trajectories O = { on } Nn=1 , where on = { bnt } Tt=1 and N is the number of objects in the video . bt = [ xnt , ynt , wnt , hnt ] is an object proposal at frame t and T is the frame number , where ( xnt , y n t ) denotes the normalized proposal coordinate center and wnt and h n t denote the normalized width and height , respectively . The object detector first uses a pre-trained region proposal network ( Ren et al. , 2015 ) to generate object proposals in all frames , which are further linked across connective frames to get all objects ’ trajectories . Let { bit } Ni=1 and { b j t+1 } Nj=1 to be two sets of proposals in two connective frames . Inspired by Gkioxari & Malik ( 2015 ) , we define a connection score sl between bit and b j t+1 to be sl ( b i t , b j t+1 ) = sc ( b i t ) + sc ( b j t+1 ) + λ1 · IoU ( bit , b j t+1 ) , ( 1 ) where sc ( bit ) is the confidence score of the proposal b i t , IoU is the intersection over union and λ1 is a scalar . Gkioxari & Malik ( 2015 ) adopts a greedy algorithm to connect the proposals without global optimization . Instead , we assign boxes { bjt+1 } Nj=1 at the t + 1 frame to { bit } Ni=1 by a linear sum assignment . Video Feature Extraction . Given an input video and its detected object trajectories , we extract three kinds of latent features for grounding object and event concepts . It includes 1 ) the average visual feature fv ∈ RN×D1 for static attribute prediction , 2 ) temporal sequence feature fs ∈ RN×4T for dynamic attribute and unary event prediction , and 3 ) interactive feature f c ∈ RK×N×N×D2 for collision event prediction , where D1 and D2 denote dimensions of the features and K is the number of sampled frames . We give more details on how to extract these features in Appendix B. Grounding Object and Event Concepts . Video Reasoning requires a model to ground object and event concepts in videos . DCL achieves this by matching object and event representation with object and event embeddings in the symbolic executor . Specifically , DCL calculates the confidence score that the n-th object is moving by [ cos ( smoving , mda ( f s n ) ) − δ ] /λ , where fsn denotes the temporal sequence feature for the n-th object , smoving denotes a vector embedding for concept moving , and mda denotes a linear transformation , mapping fsn into the dynamic concept representation space . δ and λ are the shifting and scaling scalars , and cos ( ) calculates the cosine similarity between two vectors . DCL grounds static attributes and the collision event similarly , matching average visual features and interactive features with their corresponding concept embeddings in the latent space . We give more details on the concept and event quantization in Appendix E. Trajectory Refinement . The connection score in Eq . 1 ensures the continuity of the detected object trajectories . However , it does not consider the objects ’ visual appearance ; therefore , it may fail to track the objects and may connect inconsistent objects when different objects are close to each other and moving rapidly . To detect better object trajectories and to ensure the consistency of visual appearance along the track , we add a new term to Eq . 1 and re-define the connection score to be sl ( { bim } tm=0 , b j t+1 ) = sc ( b i t ) + sc ( b j t+1 ) + λ1 · IoU ( bit , b j t+1 ) + λ2 · fappear ( { bim } tm=0 , b j t+1 ) , ( 2 ) where fappear ( { bim } tm=0 , b j t+1 ) measures the attribute similarity between the newly added proposal bjt+1 and all proposals ( { bim } tm=0 in previous frames . We define fappear as fappear ( { bim } tm=0 , bjt+1 ) = 1 3× t ∑ attr t∑ m=0 fattr ( b i m , b j t+1 ) , ( 3 ) where attr ∈ { color , material , shape } . fattr ( bm , bt+1 ) equals to 1 when bim and b j t+1 have the same attribute , and 0 otherwise . In Eq . 2 , fappear ensures that the detected trajectories have consistent visual appearance and helps to distinguish the correct object when different objects are close to each other in the same frame . These additional static attributes , including color , material , and shape , are extracted without explicit annotation during training . Specifically , we quantize the attributes by choosing the concept whose concept embedding has the best cosine similarity with the object feature . We iteratively connect proposals at the t + 1 frame to proposals at the t frame and get a set of object trajectories O = { on } Nn=1 , where on = { bnt } Tt=1 . Dynamic Prediction . Given an input video and the refined trajectories of objects , we predict the locations and RGB patches of the objects in future or counterfactual scenes with a Propagation Network ( Li et al. , 2019b ) . We then generate the predicted scenes by pasting RGB patches into the predicted locations . The generated scenes are fed to the feature extractor to extract the corresponding features . Such a design enables the question answer pairs associated with the predicted scenes to optimize the concept embeddings and requires no explicit labels for collision prediction , leading to better optimization . This is different from Yi et al . ( 2020 ) , which requires dense collision event labels to train a collision classifier . To predict the locations and RGB patches , the dynamic predictor maintains a directed graph 〈V , D〉 =〈 { vn } Nn=1 , { dn1 , n2 } N , N n1=1 , n2=1 〉 . The n-th vertex vn is represented by a concatenation of tuple 〈bnt , pnt 〉 over a small time window w , where bnt = [ xnt , ynt , wnt , hnt ] is the n-th object ’ s normalized coordinates and pnt is a cropped RGB patch centering at ( x n t , y n t ) . The edge dn1 , n2 denotes the relation between the n1-th and n2-th objects and is represented by the concatenation of the normalized coordinate difference bn1t − b n2 t . The dynamic predictor performs multi-step message passing to simulate instantaneous propagation effects . During inference , the dynamics predictor predicts the locations and patches at frame k + 1 using the features of the last w observed frames in the original video . We get the predictions at frame k + 2 by autoregressively feeding the predicted results at frame k + 1 as the input to the predictor . To get the counterfactual scenes where the n-th object is removed , we remove the n-th vertex and its associated edges from the input to predict counterfactual dynamics . Iteratively , we get the predicted normalized coordinates { b̂nk′ } N , K′ n=1 , k′=1 and RGB patches { p̂nk′ } N , K n=1 , k′=1 at all predicted K ′ frames . We give more details on the dynamic predictor at Appendix C. Language Program Parsing . The language program parser aims to translate the questions and choices into executable symbolic programs . Each executable program consists of a series of operations like selecting objects with certain properties , filtering events happening at a specific moment , finding the causes of an event , and eventually enabling transparent and step-by-step visual reasoning . Moreover , these operations are compositional and can be combined to represent questions with various compositionality and complexity . We adopt a seq2seq model ( Bahdanau et al. , 2015 ) with an attention mechanism to translate word sequences into a set of symbolic programs and treat questions and choices , separately . We give detailed implementation of the program parser in Appendix D. Symbolic Execution . Given a parsed program , the symbolic executor explicitly runs it on the latent features extracted from the observed and predicted scenes to answer the question . The executor consists of a series of functional modules to realize the operators in symbolic programs . The last operator ’ s output is the answer to the question . Similar to Mao et al . ( 2019 ) , we represent all object states , events , and results of all operators in a probabilistic manner during training . This makes the whole execution process differential w.r.t . the latent representations from the observed and predicted scenes . It enables the optimization of the feature extractor and concept embeddings in the symbolic executor . We provide the implementation of all the operators in Appendix E . | The paper presents a neural-symbolic approach for video question answering. In particular, the authors propose the Dynamic Concept Learner (DCL), a network architecture to localize object trajectories over time and further build a graph network to model the physical interaction between objects and events. Finally, a standard symbolic executor is used to reason across visual and language cues for question answering. The proposed method is evaluated on CLEVRER dataset in which it achieves new state of the art performance. | SP:a403544a76c5222b75621e25723ec8d7c9d98e5f |
Grounding Physical Concepts of Objects and Events Through Dynamic Visual Reasoning | 1 INTRODUCTION . Visual reasoning in dynamic scenes involves both the understanding of compositional properties , relationships , and events of objects , and the inference and prediction of their temporal and causal structures . As depicted in Fig . 1 , to answer the question “ What will happen next ? ” based on the observed video frames , one needs to detect the object trajectories , predict their dynamics , analyze the temporal structures , and ground visual objects and events to get the answer “ The blue sphere and the yellow object collide ” . Recently , various end-to-end neural network-based approaches have been proposed for joint understanding of video and language ( Lei et al. , 2018 ; Fan et al. , 2019 ) . While these methods have shown great success in learning to recognize visually complex concepts , such as human activities ( Xu et al. , 2017 ; Ye et al. , 2017 ) , they typically fail on benchmarks that require the understanding of compositional and causal structures in the videos and text ( Yi et al. , 2020 ) . Another line of research has been focusing on building modular neural networks that can represent the compositional structures in scenes and questions , such as object-centric scene structures and multi-hop reasoning ( Andreas et al. , 2016 ; Johnson et al. , 2017b ; Hudson & Manning , 2019 ) . However , these methods are designed for static images and do not handle the temporal and causal structure in dynamic scenes well , leading to inferior performance on video causal reasoning benchmark CLEVRER ( Yi et al. , 2020 ) . To model the temporal and causal structures in dynamic scenes , Yi et al . ( 2020 ) proposed an oracle model to combine symbolic representation with video dynamics modeling and achieved state-ofthe-art performance on CLEVRER . However , this model requires videos with dense annotations for visual attributes and physical events , which are impractical or extremely labor-intensive in real scenes . Project page : http : //dcl.csail.mit.edu We argue that such dense explicit video annotations are unnecessary for video reasoning , since they are naturally encoded in the question answer pairs associated with the videos . For example , the question answer pair and the video in Fig . 1 can implicitly inform a model what the concepts “ sphere ” , “ blue ” , “ yellow ” and “ collide ” really mean . However , a video may contain multiple fast-moving occluded objects and complex object interactions , and the questions and answers have diverse forms . It remains an open and challenging problem to simultaneously represent objects over time , train an accurate dynamic model from raw videos , and align objects with visual properties and events for accurate temporal and causal reasoning , using vision and language as the only supervision . Our main ideas are to factorize video perception and reasoning into several modules : object tracking , object and event concept grounding , and dynamics prediction . We first detect objects in the video , associating them into object tracks across the frames . We can then ground various object and event concepts from language , train a dynamic model on top of object tracks for future and counterfactual predictions , analyze relationships between events , and answer queries based on these extracted representations . All these modules can be trained jointly by watching videos and reading paired questions and answers . To achieve this goal , we introduce Dynamic Concept Learner ( DCL ) , a unified neural-symbolic framework for recognizing objects and events in videos and analyzing their temporal and causal structures , without explicit annotations on visual attributes and physical events such as collisions during training . To facilitate model training , a multi-step training paradigm has been proposed . We first run an object detector on individual frames and associate objects across frames based on a motion-based correspondence . Next , our model learns concepts about object properties , relationships , and events by reading paired questions and answers that describe or explain the events in the video . Then , we leverage the acquired visual concepts in the previous steps to refine the object association across frames . Finally , we train a dynamics prediction network ( Li et al. , 2019b ) based on the refined object trajectories and optimize it jointly with other learning parts in this unified framework . Such a training paradigm ensures that all neural modules share the same latent space for representing concepts and they can bootstrap the learning of each other . We evaluate DCL ’ s performance on CLEVRER , a video reasoning benchmark that includes descriptive , explanatory , predictive , and counterfactual reasoning with a uniform language interface . DCL achieves state-of-the-art performance on all question categories and requires no scene supervision such as object properties and collision events . To further examine the grounding accuracy and transferability of the acquired concepts , we introduce two new benchmarks for video-text retrieval and spatial-temporal grounding and localization on the CLEVRER videos , namely CLEVRERRetrieval and CLEVRER-Grounding . Without any further training , our model generalizes well to these benchmarks , surpassing the baseline by a noticeable margin . 2 RELATED WORK . Our work is related to reasoning and answering questions about visual content . Early studies like ( Wu et al. , 2016 ; Zhu et al. , 2016 ; Gan et al. , 2017 ) typically adopted monolithic network architectures and mainly focused on visual understanding . To perform deeper visual reasoning , neural module networks were extensively studied in recent works ( Johnson et al. , 2017a ; Hu et al. , 2018 ; Hudson & Manning , 2018 ; Amizadeh et al. , 2020 ) , where they represent symbolic operations with small neural networks and perform multi-hop reasoning . Some previous research has also attempted to learn visual concepts through visual question answering ( Mao et al. , 2019 ) . However , it mainly focused on learning static concepts in images , while our DCL aims at learning dynamic concepts like moving and collision in videos and at making use of these concepts for temporal and causal reasoning . Later , visual reasoning was extended to more complex dynamic videos ( Lei et al. , 2018 ; Fan et al. , 2019 ; Li et al. , 2020 ; 2019a ; Huang et al. , 2020 ) . Recently , Yi et al . ( 2020 ) proposed CLEVRER , a new video reasoning benchmark for evaluating computational models ’ comprehension of the causal structure behind physical object interaction . They also developed an oracle model , combining the neuro-symbolic visual question-answering model ( Yi et al. , 2018 ) with the dynamics prediction model ( Li et al. , 2019b ) , showing competitive performance . However , this model requires explicit labels for object attributes , masks , and spatio-temporal localization of events during training . Instead , our DCL has no reliance on any labels for objects and events and can learn these concepts through natural supervision ( i.e. , videos and question-answer pairs ) . Our work is also related to temporal and relational reasoning in videos via neural networks ( Wang & Gupta , 2018 ; Materzynska et al. , 2020 ; Ji et al. , 2020 ) . These works typically rely on specific action annotations , while our DCL learns to ground object and event concepts and analyze their temporal relations through question answering . Recently , various benchmarks ( Riochet et al. , 2018 ; Bakhtin et al. , 2019 ; Girdhar & Ramanan , 2020 ; Baradel et al. , 2020 ; Gan et al. , 2020 ) have been proposed to study dynamics and reasoning in physical scenes . However , these datasets mainly target at pure video understanding and do not contain natural language question answering . Much research has been studying dynamic modeling for physical scenes ( Lerer et al. , 2016 ; Battaglia et al. , 2013 ; Mottaghi et al. , 2016 ; Finn et al. , 2016 ; Shao et al. , 2014 ; Fire & Zhu , 2015 ; Ye et al. , 2018 ; Li et al. , 2019b ) . We adopt PropNet ( Li et al. , 2019b ) for dynamics prediction and feed the predicted scenes to the video feature extractor and the neuro-symbolic executor for event prediction and question answering . While many works ( Zhou et al. , 2019 ; 2018 ; Gan et al. , 2015 ) have been studying on the problems of understanding human actions and activities ( e.g. , running , cooking , cleaning ) in videos , our work ’ s primary goal is to design a unified framework for learning physical object and event concepts ( e.g. , collision , falling , stability ) . These tasks are of great importance in practical applications such as industrial robot manipulation which requires AI systems with human-like physical common sense . 3 DYNAMIC CONCEPT LEARNER . In this section , we introduce a new video reasoning model , Dynamic Concept Learner ( DCL ) , which learns to recognize video attributes , events , and dynamics and to analyze their temporal and causal structures , all through watching videos and answering corresponding questions . DCL contains five modules , 1 ) an object trajectory detector , 2 ) video feature extractor , 3 ) a dynamic predictor , 4 ) a language program parser , and 5 ) a neural symbolic executor . As shown in Fig . 2 , given an input video , the trajectory detector detects objects in each frame and associates them into trajectories ; the feature extractor then represents them as latent feature vectors . After that , DCL quantizes the objects ’ static concepts ( i.e. , color , shape , and material ) by matching the latent object features with the corresponding concept embeddings in the executor . As these static concepts are motion-independent , they can be adopted as an additional criteria to refine the object trajectories . Based on the refined trajectories , the dynamics predictor predicts the objects ’ movement and interactions in future and counterfactual scenes . The language parser parses the question and choices into functional programs , which are executed by the program executor on the latent representation space to get answers . The object and event concept embeddings and the object-centric representation share the same latent space ; answering questions associated with videos can directly optimize them through backpropagation . The object trajectories and dynamics can be refined by the object static attributes predicted by DCL . Our framework enjoys the advantages of both transparency and efficiency , since it enables step-by-step investigations of the whole reasoning process and has no requirements for explicit annotations of visual attributes , events , and object masks . 3.1 MODEL DETAILS . Object Detection and Tracking . Given a video , the object trajectory detector detects object proposals in each frame and connects them into object trajectories O = { on } Nn=1 , where on = { bnt } Tt=1 and N is the number of objects in the video . bt = [ xnt , ynt , wnt , hnt ] is an object proposal at frame t and T is the frame number , where ( xnt , y n t ) denotes the normalized proposal coordinate center and wnt and h n t denote the normalized width and height , respectively . The object detector first uses a pre-trained region proposal network ( Ren et al. , 2015 ) to generate object proposals in all frames , which are further linked across connective frames to get all objects ’ trajectories . Let { bit } Ni=1 and { b j t+1 } Nj=1 to be two sets of proposals in two connective frames . Inspired by Gkioxari & Malik ( 2015 ) , we define a connection score sl between bit and b j t+1 to be sl ( b i t , b j t+1 ) = sc ( b i t ) + sc ( b j t+1 ) + λ1 · IoU ( bit , b j t+1 ) , ( 1 ) where sc ( bit ) is the confidence score of the proposal b i t , IoU is the intersection over union and λ1 is a scalar . Gkioxari & Malik ( 2015 ) adopts a greedy algorithm to connect the proposals without global optimization . Instead , we assign boxes { bjt+1 } Nj=1 at the t + 1 frame to { bit } Ni=1 by a linear sum assignment . Video Feature Extraction . Given an input video and its detected object trajectories , we extract three kinds of latent features for grounding object and event concepts . It includes 1 ) the average visual feature fv ∈ RN×D1 for static attribute prediction , 2 ) temporal sequence feature fs ∈ RN×4T for dynamic attribute and unary event prediction , and 3 ) interactive feature f c ∈ RK×N×N×D2 for collision event prediction , where D1 and D2 denote dimensions of the features and K is the number of sampled frames . We give more details on how to extract these features in Appendix B. Grounding Object and Event Concepts . Video Reasoning requires a model to ground object and event concepts in videos . DCL achieves this by matching object and event representation with object and event embeddings in the symbolic executor . Specifically , DCL calculates the confidence score that the n-th object is moving by [ cos ( smoving , mda ( f s n ) ) − δ ] /λ , where fsn denotes the temporal sequence feature for the n-th object , smoving denotes a vector embedding for concept moving , and mda denotes a linear transformation , mapping fsn into the dynamic concept representation space . δ and λ are the shifting and scaling scalars , and cos ( ) calculates the cosine similarity between two vectors . DCL grounds static attributes and the collision event similarly , matching average visual features and interactive features with their corresponding concept embeddings in the latent space . We give more details on the concept and event quantization in Appendix E. Trajectory Refinement . The connection score in Eq . 1 ensures the continuity of the detected object trajectories . However , it does not consider the objects ’ visual appearance ; therefore , it may fail to track the objects and may connect inconsistent objects when different objects are close to each other and moving rapidly . To detect better object trajectories and to ensure the consistency of visual appearance along the track , we add a new term to Eq . 1 and re-define the connection score to be sl ( { bim } tm=0 , b j t+1 ) = sc ( b i t ) + sc ( b j t+1 ) + λ1 · IoU ( bit , b j t+1 ) + λ2 · fappear ( { bim } tm=0 , b j t+1 ) , ( 2 ) where fappear ( { bim } tm=0 , b j t+1 ) measures the attribute similarity between the newly added proposal bjt+1 and all proposals ( { bim } tm=0 in previous frames . We define fappear as fappear ( { bim } tm=0 , bjt+1 ) = 1 3× t ∑ attr t∑ m=0 fattr ( b i m , b j t+1 ) , ( 3 ) where attr ∈ { color , material , shape } . fattr ( bm , bt+1 ) equals to 1 when bim and b j t+1 have the same attribute , and 0 otherwise . In Eq . 2 , fappear ensures that the detected trajectories have consistent visual appearance and helps to distinguish the correct object when different objects are close to each other in the same frame . These additional static attributes , including color , material , and shape , are extracted without explicit annotation during training . Specifically , we quantize the attributes by choosing the concept whose concept embedding has the best cosine similarity with the object feature . We iteratively connect proposals at the t + 1 frame to proposals at the t frame and get a set of object trajectories O = { on } Nn=1 , where on = { bnt } Tt=1 . Dynamic Prediction . Given an input video and the refined trajectories of objects , we predict the locations and RGB patches of the objects in future or counterfactual scenes with a Propagation Network ( Li et al. , 2019b ) . We then generate the predicted scenes by pasting RGB patches into the predicted locations . The generated scenes are fed to the feature extractor to extract the corresponding features . Such a design enables the question answer pairs associated with the predicted scenes to optimize the concept embeddings and requires no explicit labels for collision prediction , leading to better optimization . This is different from Yi et al . ( 2020 ) , which requires dense collision event labels to train a collision classifier . To predict the locations and RGB patches , the dynamic predictor maintains a directed graph 〈V , D〉 =〈 { vn } Nn=1 , { dn1 , n2 } N , N n1=1 , n2=1 〉 . The n-th vertex vn is represented by a concatenation of tuple 〈bnt , pnt 〉 over a small time window w , where bnt = [ xnt , ynt , wnt , hnt ] is the n-th object ’ s normalized coordinates and pnt is a cropped RGB patch centering at ( x n t , y n t ) . The edge dn1 , n2 denotes the relation between the n1-th and n2-th objects and is represented by the concatenation of the normalized coordinate difference bn1t − b n2 t . The dynamic predictor performs multi-step message passing to simulate instantaneous propagation effects . During inference , the dynamics predictor predicts the locations and patches at frame k + 1 using the features of the last w observed frames in the original video . We get the predictions at frame k + 2 by autoregressively feeding the predicted results at frame k + 1 as the input to the predictor . To get the counterfactual scenes where the n-th object is removed , we remove the n-th vertex and its associated edges from the input to predict counterfactual dynamics . Iteratively , we get the predicted normalized coordinates { b̂nk′ } N , K′ n=1 , k′=1 and RGB patches { p̂nk′ } N , K n=1 , k′=1 at all predicted K ′ frames . We give more details on the dynamic predictor at Appendix C. Language Program Parsing . The language program parser aims to translate the questions and choices into executable symbolic programs . Each executable program consists of a series of operations like selecting objects with certain properties , filtering events happening at a specific moment , finding the causes of an event , and eventually enabling transparent and step-by-step visual reasoning . Moreover , these operations are compositional and can be combined to represent questions with various compositionality and complexity . We adopt a seq2seq model ( Bahdanau et al. , 2015 ) with an attention mechanism to translate word sequences into a set of symbolic programs and treat questions and choices , separately . We give detailed implementation of the program parser in Appendix D. Symbolic Execution . Given a parsed program , the symbolic executor explicitly runs it on the latent features extracted from the observed and predicted scenes to answer the question . The executor consists of a series of functional modules to realize the operators in symbolic programs . The last operator ’ s output is the answer to the question . Similar to Mao et al . ( 2019 ) , we represent all object states , events , and results of all operators in a probabilistic manner during training . This makes the whole execution process differential w.r.t . the latent representations from the observed and predicted scenes . It enables the optimization of the feature extractor and concept embeddings in the symbolic executor . We provide the implementation of all the operators in Appendix E . | The paper studies the problem of dynamic visual reasoning on the recently proposed synthetic video QA dataset CLEVRER for understanding visual properties, physical events, the causal relationship between events, and making future and counterfactual predictions. The paper proposes a joint framework called Dynamic Concept Learner which contains five modules (object trajectory detector, video feature extractor, dynamic predictor, language program parser, and neural symbolic executor) and follows a multi-step training paradigm to train the model purely from the question-answer pairs in CLEVRER train split. The object trajectory detector module, the concept embedding/quantization, and the dynamic predictor module play a very important role in DCL. These modules enable the dynamic & causal reasoning abilities for DCL. The neural program parsing & execution part of DCL is similar to that in Neuro-Symbolic Concept Learner (NS-CL) (Mao et al., 2019) and thus DCL can be regarded as the dynamic extended version of NS-CL. | SP:a403544a76c5222b75621e25723ec8d7c9d98e5f |
Grounding Physical Concepts of Objects and Events Through Dynamic Visual Reasoning | 1 INTRODUCTION . Visual reasoning in dynamic scenes involves both the understanding of compositional properties , relationships , and events of objects , and the inference and prediction of their temporal and causal structures . As depicted in Fig . 1 , to answer the question “ What will happen next ? ” based on the observed video frames , one needs to detect the object trajectories , predict their dynamics , analyze the temporal structures , and ground visual objects and events to get the answer “ The blue sphere and the yellow object collide ” . Recently , various end-to-end neural network-based approaches have been proposed for joint understanding of video and language ( Lei et al. , 2018 ; Fan et al. , 2019 ) . While these methods have shown great success in learning to recognize visually complex concepts , such as human activities ( Xu et al. , 2017 ; Ye et al. , 2017 ) , they typically fail on benchmarks that require the understanding of compositional and causal structures in the videos and text ( Yi et al. , 2020 ) . Another line of research has been focusing on building modular neural networks that can represent the compositional structures in scenes and questions , such as object-centric scene structures and multi-hop reasoning ( Andreas et al. , 2016 ; Johnson et al. , 2017b ; Hudson & Manning , 2019 ) . However , these methods are designed for static images and do not handle the temporal and causal structure in dynamic scenes well , leading to inferior performance on video causal reasoning benchmark CLEVRER ( Yi et al. , 2020 ) . To model the temporal and causal structures in dynamic scenes , Yi et al . ( 2020 ) proposed an oracle model to combine symbolic representation with video dynamics modeling and achieved state-ofthe-art performance on CLEVRER . However , this model requires videos with dense annotations for visual attributes and physical events , which are impractical or extremely labor-intensive in real scenes . Project page : http : //dcl.csail.mit.edu We argue that such dense explicit video annotations are unnecessary for video reasoning , since they are naturally encoded in the question answer pairs associated with the videos . For example , the question answer pair and the video in Fig . 1 can implicitly inform a model what the concepts “ sphere ” , “ blue ” , “ yellow ” and “ collide ” really mean . However , a video may contain multiple fast-moving occluded objects and complex object interactions , and the questions and answers have diverse forms . It remains an open and challenging problem to simultaneously represent objects over time , train an accurate dynamic model from raw videos , and align objects with visual properties and events for accurate temporal and causal reasoning , using vision and language as the only supervision . Our main ideas are to factorize video perception and reasoning into several modules : object tracking , object and event concept grounding , and dynamics prediction . We first detect objects in the video , associating them into object tracks across the frames . We can then ground various object and event concepts from language , train a dynamic model on top of object tracks for future and counterfactual predictions , analyze relationships between events , and answer queries based on these extracted representations . All these modules can be trained jointly by watching videos and reading paired questions and answers . To achieve this goal , we introduce Dynamic Concept Learner ( DCL ) , a unified neural-symbolic framework for recognizing objects and events in videos and analyzing their temporal and causal structures , without explicit annotations on visual attributes and physical events such as collisions during training . To facilitate model training , a multi-step training paradigm has been proposed . We first run an object detector on individual frames and associate objects across frames based on a motion-based correspondence . Next , our model learns concepts about object properties , relationships , and events by reading paired questions and answers that describe or explain the events in the video . Then , we leverage the acquired visual concepts in the previous steps to refine the object association across frames . Finally , we train a dynamics prediction network ( Li et al. , 2019b ) based on the refined object trajectories and optimize it jointly with other learning parts in this unified framework . Such a training paradigm ensures that all neural modules share the same latent space for representing concepts and they can bootstrap the learning of each other . We evaluate DCL ’ s performance on CLEVRER , a video reasoning benchmark that includes descriptive , explanatory , predictive , and counterfactual reasoning with a uniform language interface . DCL achieves state-of-the-art performance on all question categories and requires no scene supervision such as object properties and collision events . To further examine the grounding accuracy and transferability of the acquired concepts , we introduce two new benchmarks for video-text retrieval and spatial-temporal grounding and localization on the CLEVRER videos , namely CLEVRERRetrieval and CLEVRER-Grounding . Without any further training , our model generalizes well to these benchmarks , surpassing the baseline by a noticeable margin . 2 RELATED WORK . Our work is related to reasoning and answering questions about visual content . Early studies like ( Wu et al. , 2016 ; Zhu et al. , 2016 ; Gan et al. , 2017 ) typically adopted monolithic network architectures and mainly focused on visual understanding . To perform deeper visual reasoning , neural module networks were extensively studied in recent works ( Johnson et al. , 2017a ; Hu et al. , 2018 ; Hudson & Manning , 2018 ; Amizadeh et al. , 2020 ) , where they represent symbolic operations with small neural networks and perform multi-hop reasoning . Some previous research has also attempted to learn visual concepts through visual question answering ( Mao et al. , 2019 ) . However , it mainly focused on learning static concepts in images , while our DCL aims at learning dynamic concepts like moving and collision in videos and at making use of these concepts for temporal and causal reasoning . Later , visual reasoning was extended to more complex dynamic videos ( Lei et al. , 2018 ; Fan et al. , 2019 ; Li et al. , 2020 ; 2019a ; Huang et al. , 2020 ) . Recently , Yi et al . ( 2020 ) proposed CLEVRER , a new video reasoning benchmark for evaluating computational models ’ comprehension of the causal structure behind physical object interaction . They also developed an oracle model , combining the neuro-symbolic visual question-answering model ( Yi et al. , 2018 ) with the dynamics prediction model ( Li et al. , 2019b ) , showing competitive performance . However , this model requires explicit labels for object attributes , masks , and spatio-temporal localization of events during training . Instead , our DCL has no reliance on any labels for objects and events and can learn these concepts through natural supervision ( i.e. , videos and question-answer pairs ) . Our work is also related to temporal and relational reasoning in videos via neural networks ( Wang & Gupta , 2018 ; Materzynska et al. , 2020 ; Ji et al. , 2020 ) . These works typically rely on specific action annotations , while our DCL learns to ground object and event concepts and analyze their temporal relations through question answering . Recently , various benchmarks ( Riochet et al. , 2018 ; Bakhtin et al. , 2019 ; Girdhar & Ramanan , 2020 ; Baradel et al. , 2020 ; Gan et al. , 2020 ) have been proposed to study dynamics and reasoning in physical scenes . However , these datasets mainly target at pure video understanding and do not contain natural language question answering . Much research has been studying dynamic modeling for physical scenes ( Lerer et al. , 2016 ; Battaglia et al. , 2013 ; Mottaghi et al. , 2016 ; Finn et al. , 2016 ; Shao et al. , 2014 ; Fire & Zhu , 2015 ; Ye et al. , 2018 ; Li et al. , 2019b ) . We adopt PropNet ( Li et al. , 2019b ) for dynamics prediction and feed the predicted scenes to the video feature extractor and the neuro-symbolic executor for event prediction and question answering . While many works ( Zhou et al. , 2019 ; 2018 ; Gan et al. , 2015 ) have been studying on the problems of understanding human actions and activities ( e.g. , running , cooking , cleaning ) in videos , our work ’ s primary goal is to design a unified framework for learning physical object and event concepts ( e.g. , collision , falling , stability ) . These tasks are of great importance in practical applications such as industrial robot manipulation which requires AI systems with human-like physical common sense . 3 DYNAMIC CONCEPT LEARNER . In this section , we introduce a new video reasoning model , Dynamic Concept Learner ( DCL ) , which learns to recognize video attributes , events , and dynamics and to analyze their temporal and causal structures , all through watching videos and answering corresponding questions . DCL contains five modules , 1 ) an object trajectory detector , 2 ) video feature extractor , 3 ) a dynamic predictor , 4 ) a language program parser , and 5 ) a neural symbolic executor . As shown in Fig . 2 , given an input video , the trajectory detector detects objects in each frame and associates them into trajectories ; the feature extractor then represents them as latent feature vectors . After that , DCL quantizes the objects ’ static concepts ( i.e. , color , shape , and material ) by matching the latent object features with the corresponding concept embeddings in the executor . As these static concepts are motion-independent , they can be adopted as an additional criteria to refine the object trajectories . Based on the refined trajectories , the dynamics predictor predicts the objects ’ movement and interactions in future and counterfactual scenes . The language parser parses the question and choices into functional programs , which are executed by the program executor on the latent representation space to get answers . The object and event concept embeddings and the object-centric representation share the same latent space ; answering questions associated with videos can directly optimize them through backpropagation . The object trajectories and dynamics can be refined by the object static attributes predicted by DCL . Our framework enjoys the advantages of both transparency and efficiency , since it enables step-by-step investigations of the whole reasoning process and has no requirements for explicit annotations of visual attributes , events , and object masks . 3.1 MODEL DETAILS . Object Detection and Tracking . Given a video , the object trajectory detector detects object proposals in each frame and connects them into object trajectories O = { on } Nn=1 , where on = { bnt } Tt=1 and N is the number of objects in the video . bt = [ xnt , ynt , wnt , hnt ] is an object proposal at frame t and T is the frame number , where ( xnt , y n t ) denotes the normalized proposal coordinate center and wnt and h n t denote the normalized width and height , respectively . The object detector first uses a pre-trained region proposal network ( Ren et al. , 2015 ) to generate object proposals in all frames , which are further linked across connective frames to get all objects ’ trajectories . Let { bit } Ni=1 and { b j t+1 } Nj=1 to be two sets of proposals in two connective frames . Inspired by Gkioxari & Malik ( 2015 ) , we define a connection score sl between bit and b j t+1 to be sl ( b i t , b j t+1 ) = sc ( b i t ) + sc ( b j t+1 ) + λ1 · IoU ( bit , b j t+1 ) , ( 1 ) where sc ( bit ) is the confidence score of the proposal b i t , IoU is the intersection over union and λ1 is a scalar . Gkioxari & Malik ( 2015 ) adopts a greedy algorithm to connect the proposals without global optimization . Instead , we assign boxes { bjt+1 } Nj=1 at the t + 1 frame to { bit } Ni=1 by a linear sum assignment . Video Feature Extraction . Given an input video and its detected object trajectories , we extract three kinds of latent features for grounding object and event concepts . It includes 1 ) the average visual feature fv ∈ RN×D1 for static attribute prediction , 2 ) temporal sequence feature fs ∈ RN×4T for dynamic attribute and unary event prediction , and 3 ) interactive feature f c ∈ RK×N×N×D2 for collision event prediction , where D1 and D2 denote dimensions of the features and K is the number of sampled frames . We give more details on how to extract these features in Appendix B. Grounding Object and Event Concepts . Video Reasoning requires a model to ground object and event concepts in videos . DCL achieves this by matching object and event representation with object and event embeddings in the symbolic executor . Specifically , DCL calculates the confidence score that the n-th object is moving by [ cos ( smoving , mda ( f s n ) ) − δ ] /λ , where fsn denotes the temporal sequence feature for the n-th object , smoving denotes a vector embedding for concept moving , and mda denotes a linear transformation , mapping fsn into the dynamic concept representation space . δ and λ are the shifting and scaling scalars , and cos ( ) calculates the cosine similarity between two vectors . DCL grounds static attributes and the collision event similarly , matching average visual features and interactive features with their corresponding concept embeddings in the latent space . We give more details on the concept and event quantization in Appendix E. Trajectory Refinement . The connection score in Eq . 1 ensures the continuity of the detected object trajectories . However , it does not consider the objects ’ visual appearance ; therefore , it may fail to track the objects and may connect inconsistent objects when different objects are close to each other and moving rapidly . To detect better object trajectories and to ensure the consistency of visual appearance along the track , we add a new term to Eq . 1 and re-define the connection score to be sl ( { bim } tm=0 , b j t+1 ) = sc ( b i t ) + sc ( b j t+1 ) + λ1 · IoU ( bit , b j t+1 ) + λ2 · fappear ( { bim } tm=0 , b j t+1 ) , ( 2 ) where fappear ( { bim } tm=0 , b j t+1 ) measures the attribute similarity between the newly added proposal bjt+1 and all proposals ( { bim } tm=0 in previous frames . We define fappear as fappear ( { bim } tm=0 , bjt+1 ) = 1 3× t ∑ attr t∑ m=0 fattr ( b i m , b j t+1 ) , ( 3 ) where attr ∈ { color , material , shape } . fattr ( bm , bt+1 ) equals to 1 when bim and b j t+1 have the same attribute , and 0 otherwise . In Eq . 2 , fappear ensures that the detected trajectories have consistent visual appearance and helps to distinguish the correct object when different objects are close to each other in the same frame . These additional static attributes , including color , material , and shape , are extracted without explicit annotation during training . Specifically , we quantize the attributes by choosing the concept whose concept embedding has the best cosine similarity with the object feature . We iteratively connect proposals at the t + 1 frame to proposals at the t frame and get a set of object trajectories O = { on } Nn=1 , where on = { bnt } Tt=1 . Dynamic Prediction . Given an input video and the refined trajectories of objects , we predict the locations and RGB patches of the objects in future or counterfactual scenes with a Propagation Network ( Li et al. , 2019b ) . We then generate the predicted scenes by pasting RGB patches into the predicted locations . The generated scenes are fed to the feature extractor to extract the corresponding features . Such a design enables the question answer pairs associated with the predicted scenes to optimize the concept embeddings and requires no explicit labels for collision prediction , leading to better optimization . This is different from Yi et al . ( 2020 ) , which requires dense collision event labels to train a collision classifier . To predict the locations and RGB patches , the dynamic predictor maintains a directed graph 〈V , D〉 =〈 { vn } Nn=1 , { dn1 , n2 } N , N n1=1 , n2=1 〉 . The n-th vertex vn is represented by a concatenation of tuple 〈bnt , pnt 〉 over a small time window w , where bnt = [ xnt , ynt , wnt , hnt ] is the n-th object ’ s normalized coordinates and pnt is a cropped RGB patch centering at ( x n t , y n t ) . The edge dn1 , n2 denotes the relation between the n1-th and n2-th objects and is represented by the concatenation of the normalized coordinate difference bn1t − b n2 t . The dynamic predictor performs multi-step message passing to simulate instantaneous propagation effects . During inference , the dynamics predictor predicts the locations and patches at frame k + 1 using the features of the last w observed frames in the original video . We get the predictions at frame k + 2 by autoregressively feeding the predicted results at frame k + 1 as the input to the predictor . To get the counterfactual scenes where the n-th object is removed , we remove the n-th vertex and its associated edges from the input to predict counterfactual dynamics . Iteratively , we get the predicted normalized coordinates { b̂nk′ } N , K′ n=1 , k′=1 and RGB patches { p̂nk′ } N , K n=1 , k′=1 at all predicted K ′ frames . We give more details on the dynamic predictor at Appendix C. Language Program Parsing . The language program parser aims to translate the questions and choices into executable symbolic programs . Each executable program consists of a series of operations like selecting objects with certain properties , filtering events happening at a specific moment , finding the causes of an event , and eventually enabling transparent and step-by-step visual reasoning . Moreover , these operations are compositional and can be combined to represent questions with various compositionality and complexity . We adopt a seq2seq model ( Bahdanau et al. , 2015 ) with an attention mechanism to translate word sequences into a set of symbolic programs and treat questions and choices , separately . We give detailed implementation of the program parser in Appendix D. Symbolic Execution . Given a parsed program , the symbolic executor explicitly runs it on the latent features extracted from the observed and predicted scenes to answer the question . The executor consists of a series of functional modules to realize the operators in symbolic programs . The last operator ’ s output is the answer to the question . Similar to Mao et al . ( 2019 ) , we represent all object states , events , and results of all operators in a probabilistic manner during training . This makes the whole execution process differential w.r.t . the latent representations from the observed and predicted scenes . It enables the optimization of the feature extractor and concept embeddings in the symbolic executor . We provide the implementation of all the operators in Appendix E . | The paper proposes a new framework, Dynamic Concept Learner (DCL), which learns by watching videos and reading questions/answers. It is inspired by prior work which combines symbolic representations with video dynamics modeling, but unlike prior work, here the authors do not use any additional supervision except for question/answer pairs. DCL is quiet complex, involving multiple components, including program parser (transforms the question/answer into executable symbolic programs), object detection&tracking, object-centric feature extractor (with static and dynamic components), object/event concept embeddings (share the same latent space as the visual features), trajectory refinement (based on static cues) and dynamic predictor (for future and counterfactual scenes), and, finally, symbolic executor (to predict whether the answer is correct), which runs on the latent features. DCL achieves state-of-the-art results on the CLEVRER dataset. The learned representations are also shown to be useful for other tasks, such as grounding and retrieval. | SP:a403544a76c5222b75621e25723ec8d7c9d98e5f |
GeDi: Generative Discriminator Guided Sequence Generation | 1 INTRODUCTION . Natural language generation has seen great progress with the advent of Transformers ( Vaswani et al. , 2017 ) and large scale training ( Radford et al. , 2017 ; 2018 ; 2019 ; Brown et al. , 2020 ) . Large language models ( LMs ) like GPT-2 ( Radford et al. , 2019 ) and GPT-3 ( Brown et al. , 2020 ) are able to learn the distribution of their training set well enough to generate realistic text . However , simply imitating the distribution of the training data during generation has many drawbacks ; large-scale text training sets are crawled from the web which is imbued with toxicity , bias , hate , and misinformation . Methods for better controlling or filtering generation are valuable for making LMs trained on such data safer and more generally useful for downstream applications . Existing approaches to controlling LMs have limitations . Class-conditional LMs ( CC-LMs ) such as CTRL ( Keskar et al. , 2019 ) attempt to control text generation by conditioning on a control code , which is an attribute variable representing a data source . However , CTRL is not as useful for controlling what not to generate ( i.e . toxicity ) . Furthermore , using a specific control code can reduce sample diversity across prompts , as samples will generally resemble the data source of the control code . Another approach is to use discriminators to steer generation , but existing methods to do this are very computationally intensive . Weighted decoding ( Holtzman et al. , 2018 ) requires feeding candidate next tokens into a discriminator , and thus scales linearly in computation with the number of tokens to be re-weighted . Plug and Play LM ( Dathathri et al. , 2020 , PPLM ) applies up to 10 updates to the generating LM ’ s latent states per time step using gradients from a discriminator , also making it many times slower than generating from the LM directly . We present GeDi1 as an algorithm for efficiently guiding generation from large LMs to make them safer and more controllable . Our proposed method uses CC-LMs as generative discriminators ( GeDis ) to guide language generation towards desired attributes . We use GeDis to compute classification likelihoods for all candidate next tokens during generation using Bayes rule , saving many 1pronounced “ Jedi ” thousand-fold in computation as compared with using a standard ( non-generative ) discriminator to compute this for large vocabulary sizes . We then show how these likelihoods can guide generation from large language models via weighted decoding and filtering . Our experimental results verify the ability of GeDi to control generation in a variety of settings while maintaining linguistic quality on par with strong language models . We apply GeDi ( 345M parameters ) to guide generation from larger language models , and find that : • GeDi trained on sentiment of movie reviews can generate book text with a positive or negative tone better than or equivalently to state of the art baselines [ Section 5.1 ] . Guiding towards positivity also has potential applications towards making LMs friendlier . • GeDi is able to significantly reduce the toxicity of GPT-2 and GPT-3 generation [ Section 5.2 ] , without sacrificing linguistic quality as compared with generating from GPT-2 and GPT-3 directly , suggesting applications towards safer language modeling . • GeDi trained on a dataset of only 4 topics can generalize to new control codes zero-shot [ Section 5.3 ] , allowing them to guide generation towards a wide variety of topics . • GeDi is very computationally efficient for both training and inference . GeDi guided generation in our experiments is more than 30× faster than applying PPLM with GPT2-XL using default settings from Dathathri et al . ( 2020 ) . Additionally , smaller GeDis fine-tuned for less than a day on a single GPU are effective and computationally efficient for controlling larger language models . This provides a cheap alternative to finetuning large LMs directly ( Ziegler et al. , 2019 ) . 2 BACKGROUND . 2.1 LANGUAGE MODELING . Language models ( LMs ) rely on an auto-regressive factorization to perform density estimation and generation of language data . Auto-regressive sequence models with parameters θ assign a probability to a sequence x1 : T = { x1 , . . . , xT } by factorizing it using the chain rule as follows : Pθ ( x1 : T ) = T∏ t=1 Pθ ( xt|x < t ) . ( 1 ) Models can assign probabilities to sequences by iteratively predicting a distribution over the next token given the previous tokens . Generating from language models requires iteratively sampling from Pθ ( xt|x < t ) , and then feeding xt back into the model as input for the next step . 2.2 CLASS-CONDITIONAL LANGUAGE MODELING . Class-conditional language models ( CC-LMs ) such as CTRL ( Keskar et al. , 2019 ) are a way for language models to generate while conditioning on an attribute variable . CC-LMs predict a probability distribution Pθ ( x1 : T |c ) , where c is a class variable or a “ control code ” that describes an attribute of the text in x1 : T , which could , for instance , describe sentiment or topic . The auto-regressive factorization for a CC-LM is given by the following equation : Pθ ( x1 : T |c ) = T∏ t=1 Pθ ( xt|x < t , c ) . ( 2 ) When training a CC-LM on a training set of sequences { x ( 1 ) 1 : T1 , . . . , x ( i ) 1 : Ti , . . . , x ( N ) 1 : TN } , each sequence x ( i ) 1 : T is paired with a control code c ( i ) , which is a label or category of the sequence . The LM is trained to minimize the average negative log-likelihood , L. L = − 1 N N∑ i=1 1 Ti Ti∑ t=1 logPθ ( x ( i ) t |x ( i ) < t , c ( i ) ) . ( 3 ) In addition to class-conditional generation , CC-LMs can be used as generative classifiers by applying Bayes rule to compute Pθ ( c|x1 : T ) ∝ P ( c ) Pθ ( x1 : T |c ) , as is done by Keskar et al . ( 2019 ) for source attribution . 3 GEDI . GeDi assumes we have a CC-LM with desired control code c and an undesired or anti-control code c̄ , and uses the contrast between Pθ ( x1 : t|c ) and Pθ ( x1 : t|c̄ ) to guide sampling from an LM that gives PLM ( x1 : t ) . Specifically , when predicting the next token during generation , GeDi uses this contrast to compute the probability that every candidate next token xt belongs to the desired class , given by Pθ ( c|xt , x < t ) . Our key insight is that this distribution can be computed very efficiently when using CC-LMs as GeDis via application of Bayes rule for partial sequences during generation . Pθ ( c|x1 : t ) = P ( c ) ∏t j=1 Pθ ( xj |x < j , c ) ∑ c′∈ { c , c̄ } ∏t j=1 P ( c ′ ) Pθ ( xj |x < j , c′ ) . ( 4 ) When computing this online during sequence generation , the model will have already computed Pθ ( xj |x < j , c′ ) for any j < t from the previous time-steps , and it will only need to compute Pθ ( xt|x < t , c′ ) . This can be computed in two parallel forward passes ; one conditioning on c and one conditioning on c̄ ( both conditioning on the same x < t ) . The model can also save the hidden states from the previous time steps to avoid computing a forward pass through the full sequence at each next token generation step . Applying a unidirectional classifier such as GPT ( Radford et al. , 2018 ) to compute Pθ ( c|xt , x < t ) directly ( i.e . discriminatively ) would require feeding in every possible input xt ∈ V into the classifier , and thus would require |V| forward passes for a vocab set V . A bidirectional classifier such as BERT ( Devlin et al. , 2018 ) would require t × |V| forward passes because it would need to recompute attention states from earlier time-steps . For typical vocab sizes of 20k+ , GeDi ’ s online classification trick can compute Pθ ( c|xt , x < t ) for every possible next token xt on the order of 10k fold less computation as compared with a unidirectional classifier ( because the unidirectional classifier would require 20k+ forward passes through the network , whereas the GeDi would only require 2 through the CC-LM and one through the base-LM ) . In practice , we find that applying Equation 4 to long sequences often results in poorly calibrated distributions later in the sequence that assign classification probabilities of 1 or 0 to on all candidate next words , which provides no useful signal . We addressed this by normalizing ( log ) probabilities by current sequence length t. To compute Pθ ( c|x1 : t ) for GeDi-guided generation , we use the following equation : Pθ ( c|x1 : t ) = ( Pθ ( x1 : t|c ) 1/t∑ c′∈ { c , c̄ } Pθ ( x1 : t|c′ ) 1/t . ( 5 ) where class priors P ( c ) are omitted . In practice , Pθ ( c|x1 : t ) is computed with log-probabilities ( see Appendix A ) . With the efficient estimation of Pθ ( c|xt , x < t ) , there are many possible heuristics that can be used to guide LM generation , so long as the LM and GeDi share the same tokenization . Heuristics that use Pθ ( c|xt , x < t ) inherently contrast predictions conditioned on c and c̄ , causing attributes common to c and c̄ to be cancelled out , more effectively allowing for the attribute described by c to be transferred across domains , as illustrated in Figure 1 . 3.1 HEURISTICS FOR GUIDING GENERATION . We consider a weighted decoding heuristic and a filtering heuristic to use Pθ ( c|xt , x < t ) to guide generation . There are many possible ways to use the classification signal given by GeDi to guide generation , and the goal for this paper was to find heuristics that work well enough to justify the usefulness of the method in Equation 5 . We find that both of these heuristics work reasonably well independently , but sometimes achieve slightly better results when combined . Our initial heuristic applies a weighted posterior given by Pw ( xt|x < t , c ) ∝ PLM ( xt|x < t ) Pθ ( c|xt , x < t ) ω , ( 6 ) where ω > 1 to bias generation more strongly towards the correct class . The right hand side of Equation ( 6 ) is normalized over all xt in the vocabulary to obtain Pw ( xt|x < t , c ) . We summarize the resulting scheme in Algorithm 1 . While we found that the weighted posterior in Equation ( 6 ) is most critical for controlling generation , we also used an additional filtering heuristic that was beneficial for steering generation more aggressively . This heuristic , inspired by nucleus sampling ( Holtzman et al. , 2020 ) , removes candidate next word tokens with lower values for Pθ ( c|xt , x < t ) while maintaining a minimum of at least 1 − ρ in cumulative probability mass in Pw ( xt|x < t , c ) , where 0 ≤ ρ < 1 is a parameter that decides the aggressiveness of the filtering . We define Vn as the set of n tokens with the highest Pθ ( c|xt , x < t ) . We define m as the minimum n such that∑ xt∈Vn Pw ( xt|x < t , c ) ≥ 1− ρ . ( 7 ) We define Vm as Vn for n = m , meaning that Vm will contain the minimum number of tokens possible at the head of the distribution for Pθ ( c|xt , x < t ) to maintain a minimum cumulative probability of ρ in Pw ( xt|x < t , c ) . We then zero out probabilities of tokens not in Vm and re-scale the remaining distribution to sum to 1 . Algorithm 1 Generative Discriminator Guided Sequence Generation Inputs : base LM PLM , CC-LM Pθ , vocabulary V , posterior mixing weight ω , decoding scheme 1 : P ( x|c ) ← 1 2 : P ( x|c̄ ) ← 1 3 : for t = 1 . . . , N do 4 : pLM ← [ PLM ( xt = v|x < t ) for v in V ] . base-LM prediction 5 : 6 : px1 : t|c ← [ ( P ( x|c ) Pθ ( xt = v|x < t , c ) ) 1/t for v in V ] . CC-LM with control code 7 : px1 : t|c̄ ← [ ( P ( x|c̄ ) Pθ ( xt = v|x < t , c̄ ) ) 1/t for v in V ] . CC-LM with anti control code 8 : 9 : pc|x1 : t ← px1 : t|c 1 ( px1 : t|c+px1 : t|c̄ ) 10 : 11 : pw ← pLM ( pc|x1 : t ) ω 12 : pw ← pw∑|V| i=1 pw [ i ] . normalize over the vocabulary 13 : vi ← Decode ( pw ) . Can be greedy or sampling , could include filtering in Eq . 7 14 : 15 : P ( x|c ) ← P ( x|c ) Pθ ( xt = vi|x < t , c ) 16 : P ( x|c̄ ) ← P ( x|c̄ ) Pθ ( xt = vi|x < t , c̄ ) 17 : xt ← vi | In this paper, the authors propose an efficient method for controllable language generation of large pre-trained LMs (e.g., GPT2). The main idea is to use a smaller, compared to the LM to control, language model trained with control code (Keskar et al., 2019) to generate a per-token score $P(c|x_{1:t}$) to steer the original Language Model distribution. The author proposes two ways, contrastive and discriminative, to approximate $P(c|x_{1:t})$ using bayesian rules. Experiments on open-ended language generation have been shown for positive/negative, detoxification, and topic-control, including a zero-shot topic-control. | SP:bd6cf6c4ef7d78b8f5d239f539d94f337c8ec4b1 |
GeDi: Generative Discriminator Guided Sequence Generation | 1 INTRODUCTION . Natural language generation has seen great progress with the advent of Transformers ( Vaswani et al. , 2017 ) and large scale training ( Radford et al. , 2017 ; 2018 ; 2019 ; Brown et al. , 2020 ) . Large language models ( LMs ) like GPT-2 ( Radford et al. , 2019 ) and GPT-3 ( Brown et al. , 2020 ) are able to learn the distribution of their training set well enough to generate realistic text . However , simply imitating the distribution of the training data during generation has many drawbacks ; large-scale text training sets are crawled from the web which is imbued with toxicity , bias , hate , and misinformation . Methods for better controlling or filtering generation are valuable for making LMs trained on such data safer and more generally useful for downstream applications . Existing approaches to controlling LMs have limitations . Class-conditional LMs ( CC-LMs ) such as CTRL ( Keskar et al. , 2019 ) attempt to control text generation by conditioning on a control code , which is an attribute variable representing a data source . However , CTRL is not as useful for controlling what not to generate ( i.e . toxicity ) . Furthermore , using a specific control code can reduce sample diversity across prompts , as samples will generally resemble the data source of the control code . Another approach is to use discriminators to steer generation , but existing methods to do this are very computationally intensive . Weighted decoding ( Holtzman et al. , 2018 ) requires feeding candidate next tokens into a discriminator , and thus scales linearly in computation with the number of tokens to be re-weighted . Plug and Play LM ( Dathathri et al. , 2020 , PPLM ) applies up to 10 updates to the generating LM ’ s latent states per time step using gradients from a discriminator , also making it many times slower than generating from the LM directly . We present GeDi1 as an algorithm for efficiently guiding generation from large LMs to make them safer and more controllable . Our proposed method uses CC-LMs as generative discriminators ( GeDis ) to guide language generation towards desired attributes . We use GeDis to compute classification likelihoods for all candidate next tokens during generation using Bayes rule , saving many 1pronounced “ Jedi ” thousand-fold in computation as compared with using a standard ( non-generative ) discriminator to compute this for large vocabulary sizes . We then show how these likelihoods can guide generation from large language models via weighted decoding and filtering . Our experimental results verify the ability of GeDi to control generation in a variety of settings while maintaining linguistic quality on par with strong language models . We apply GeDi ( 345M parameters ) to guide generation from larger language models , and find that : • GeDi trained on sentiment of movie reviews can generate book text with a positive or negative tone better than or equivalently to state of the art baselines [ Section 5.1 ] . Guiding towards positivity also has potential applications towards making LMs friendlier . • GeDi is able to significantly reduce the toxicity of GPT-2 and GPT-3 generation [ Section 5.2 ] , without sacrificing linguistic quality as compared with generating from GPT-2 and GPT-3 directly , suggesting applications towards safer language modeling . • GeDi trained on a dataset of only 4 topics can generalize to new control codes zero-shot [ Section 5.3 ] , allowing them to guide generation towards a wide variety of topics . • GeDi is very computationally efficient for both training and inference . GeDi guided generation in our experiments is more than 30× faster than applying PPLM with GPT2-XL using default settings from Dathathri et al . ( 2020 ) . Additionally , smaller GeDis fine-tuned for less than a day on a single GPU are effective and computationally efficient for controlling larger language models . This provides a cheap alternative to finetuning large LMs directly ( Ziegler et al. , 2019 ) . 2 BACKGROUND . 2.1 LANGUAGE MODELING . Language models ( LMs ) rely on an auto-regressive factorization to perform density estimation and generation of language data . Auto-regressive sequence models with parameters θ assign a probability to a sequence x1 : T = { x1 , . . . , xT } by factorizing it using the chain rule as follows : Pθ ( x1 : T ) = T∏ t=1 Pθ ( xt|x < t ) . ( 1 ) Models can assign probabilities to sequences by iteratively predicting a distribution over the next token given the previous tokens . Generating from language models requires iteratively sampling from Pθ ( xt|x < t ) , and then feeding xt back into the model as input for the next step . 2.2 CLASS-CONDITIONAL LANGUAGE MODELING . Class-conditional language models ( CC-LMs ) such as CTRL ( Keskar et al. , 2019 ) are a way for language models to generate while conditioning on an attribute variable . CC-LMs predict a probability distribution Pθ ( x1 : T |c ) , where c is a class variable or a “ control code ” that describes an attribute of the text in x1 : T , which could , for instance , describe sentiment or topic . The auto-regressive factorization for a CC-LM is given by the following equation : Pθ ( x1 : T |c ) = T∏ t=1 Pθ ( xt|x < t , c ) . ( 2 ) When training a CC-LM on a training set of sequences { x ( 1 ) 1 : T1 , . . . , x ( i ) 1 : Ti , . . . , x ( N ) 1 : TN } , each sequence x ( i ) 1 : T is paired with a control code c ( i ) , which is a label or category of the sequence . The LM is trained to minimize the average negative log-likelihood , L. L = − 1 N N∑ i=1 1 Ti Ti∑ t=1 logPθ ( x ( i ) t |x ( i ) < t , c ( i ) ) . ( 3 ) In addition to class-conditional generation , CC-LMs can be used as generative classifiers by applying Bayes rule to compute Pθ ( c|x1 : T ) ∝ P ( c ) Pθ ( x1 : T |c ) , as is done by Keskar et al . ( 2019 ) for source attribution . 3 GEDI . GeDi assumes we have a CC-LM with desired control code c and an undesired or anti-control code c̄ , and uses the contrast between Pθ ( x1 : t|c ) and Pθ ( x1 : t|c̄ ) to guide sampling from an LM that gives PLM ( x1 : t ) . Specifically , when predicting the next token during generation , GeDi uses this contrast to compute the probability that every candidate next token xt belongs to the desired class , given by Pθ ( c|xt , x < t ) . Our key insight is that this distribution can be computed very efficiently when using CC-LMs as GeDis via application of Bayes rule for partial sequences during generation . Pθ ( c|x1 : t ) = P ( c ) ∏t j=1 Pθ ( xj |x < j , c ) ∑ c′∈ { c , c̄ } ∏t j=1 P ( c ′ ) Pθ ( xj |x < j , c′ ) . ( 4 ) When computing this online during sequence generation , the model will have already computed Pθ ( xj |x < j , c′ ) for any j < t from the previous time-steps , and it will only need to compute Pθ ( xt|x < t , c′ ) . This can be computed in two parallel forward passes ; one conditioning on c and one conditioning on c̄ ( both conditioning on the same x < t ) . The model can also save the hidden states from the previous time steps to avoid computing a forward pass through the full sequence at each next token generation step . Applying a unidirectional classifier such as GPT ( Radford et al. , 2018 ) to compute Pθ ( c|xt , x < t ) directly ( i.e . discriminatively ) would require feeding in every possible input xt ∈ V into the classifier , and thus would require |V| forward passes for a vocab set V . A bidirectional classifier such as BERT ( Devlin et al. , 2018 ) would require t × |V| forward passes because it would need to recompute attention states from earlier time-steps . For typical vocab sizes of 20k+ , GeDi ’ s online classification trick can compute Pθ ( c|xt , x < t ) for every possible next token xt on the order of 10k fold less computation as compared with a unidirectional classifier ( because the unidirectional classifier would require 20k+ forward passes through the network , whereas the GeDi would only require 2 through the CC-LM and one through the base-LM ) . In practice , we find that applying Equation 4 to long sequences often results in poorly calibrated distributions later in the sequence that assign classification probabilities of 1 or 0 to on all candidate next words , which provides no useful signal . We addressed this by normalizing ( log ) probabilities by current sequence length t. To compute Pθ ( c|x1 : t ) for GeDi-guided generation , we use the following equation : Pθ ( c|x1 : t ) = ( Pθ ( x1 : t|c ) 1/t∑ c′∈ { c , c̄ } Pθ ( x1 : t|c′ ) 1/t . ( 5 ) where class priors P ( c ) are omitted . In practice , Pθ ( c|x1 : t ) is computed with log-probabilities ( see Appendix A ) . With the efficient estimation of Pθ ( c|xt , x < t ) , there are many possible heuristics that can be used to guide LM generation , so long as the LM and GeDi share the same tokenization . Heuristics that use Pθ ( c|xt , x < t ) inherently contrast predictions conditioned on c and c̄ , causing attributes common to c and c̄ to be cancelled out , more effectively allowing for the attribute described by c to be transferred across domains , as illustrated in Figure 1 . 3.1 HEURISTICS FOR GUIDING GENERATION . We consider a weighted decoding heuristic and a filtering heuristic to use Pθ ( c|xt , x < t ) to guide generation . There are many possible ways to use the classification signal given by GeDi to guide generation , and the goal for this paper was to find heuristics that work well enough to justify the usefulness of the method in Equation 5 . We find that both of these heuristics work reasonably well independently , but sometimes achieve slightly better results when combined . Our initial heuristic applies a weighted posterior given by Pw ( xt|x < t , c ) ∝ PLM ( xt|x < t ) Pθ ( c|xt , x < t ) ω , ( 6 ) where ω > 1 to bias generation more strongly towards the correct class . The right hand side of Equation ( 6 ) is normalized over all xt in the vocabulary to obtain Pw ( xt|x < t , c ) . We summarize the resulting scheme in Algorithm 1 . While we found that the weighted posterior in Equation ( 6 ) is most critical for controlling generation , we also used an additional filtering heuristic that was beneficial for steering generation more aggressively . This heuristic , inspired by nucleus sampling ( Holtzman et al. , 2020 ) , removes candidate next word tokens with lower values for Pθ ( c|xt , x < t ) while maintaining a minimum of at least 1 − ρ in cumulative probability mass in Pw ( xt|x < t , c ) , where 0 ≤ ρ < 1 is a parameter that decides the aggressiveness of the filtering . We define Vn as the set of n tokens with the highest Pθ ( c|xt , x < t ) . We define m as the minimum n such that∑ xt∈Vn Pw ( xt|x < t , c ) ≥ 1− ρ . ( 7 ) We define Vm as Vn for n = m , meaning that Vm will contain the minimum number of tokens possible at the head of the distribution for Pθ ( c|xt , x < t ) to maintain a minimum cumulative probability of ρ in Pw ( xt|x < t , c ) . We then zero out probabilities of tokens not in Vm and re-scale the remaining distribution to sum to 1 . Algorithm 1 Generative Discriminator Guided Sequence Generation Inputs : base LM PLM , CC-LM Pθ , vocabulary V , posterior mixing weight ω , decoding scheme 1 : P ( x|c ) ← 1 2 : P ( x|c̄ ) ← 1 3 : for t = 1 . . . , N do 4 : pLM ← [ PLM ( xt = v|x < t ) for v in V ] . base-LM prediction 5 : 6 : px1 : t|c ← [ ( P ( x|c ) Pθ ( xt = v|x < t , c ) ) 1/t for v in V ] . CC-LM with control code 7 : px1 : t|c̄ ← [ ( P ( x|c̄ ) Pθ ( xt = v|x < t , c̄ ) ) 1/t for v in V ] . CC-LM with anti control code 8 : 9 : pc|x1 : t ← px1 : t|c 1 ( px1 : t|c+px1 : t|c̄ ) 10 : 11 : pw ← pLM ( pc|x1 : t ) ω 12 : pw ← pw∑|V| i=1 pw [ i ] . normalize over the vocabulary 13 : vi ← Decode ( pw ) . Can be greedy or sampling , could include filtering in Eq . 7 14 : 15 : P ( x|c ) ← P ( x|c ) Pθ ( xt = vi|x < t , c ) 16 : P ( x|c̄ ) ← P ( x|c̄ ) Pθ ( xt = vi|x < t , c̄ ) 17 : xt ← vi | The paper proposed a method —- GeDi — to generate guided and controlled text from a large language model (LM). The method utilizes smaller LMs as generative discriminators to guide generation from large LMs to make them safer and more controllable. By safer and controllable they emphasis on the toxicity, hate, bias, and negativity contains in the training of the large LM. The proposed method guides generation at each time step by computing classification probabilities for all possible next tokens via Bayes rule by normalizing over two class-conditional distributions (i.e. contrastive discrimination); one conditioned on the desired attribute, or control code, and another conditioned on the undesired attribute (i.e. contrastive attribute), or anti-control code. | SP:bd6cf6c4ef7d78b8f5d239f539d94f337c8ec4b1 |
GeDi: Generative Discriminator Guided Sequence Generation | 1 INTRODUCTION . Natural language generation has seen great progress with the advent of Transformers ( Vaswani et al. , 2017 ) and large scale training ( Radford et al. , 2017 ; 2018 ; 2019 ; Brown et al. , 2020 ) . Large language models ( LMs ) like GPT-2 ( Radford et al. , 2019 ) and GPT-3 ( Brown et al. , 2020 ) are able to learn the distribution of their training set well enough to generate realistic text . However , simply imitating the distribution of the training data during generation has many drawbacks ; large-scale text training sets are crawled from the web which is imbued with toxicity , bias , hate , and misinformation . Methods for better controlling or filtering generation are valuable for making LMs trained on such data safer and more generally useful for downstream applications . Existing approaches to controlling LMs have limitations . Class-conditional LMs ( CC-LMs ) such as CTRL ( Keskar et al. , 2019 ) attempt to control text generation by conditioning on a control code , which is an attribute variable representing a data source . However , CTRL is not as useful for controlling what not to generate ( i.e . toxicity ) . Furthermore , using a specific control code can reduce sample diversity across prompts , as samples will generally resemble the data source of the control code . Another approach is to use discriminators to steer generation , but existing methods to do this are very computationally intensive . Weighted decoding ( Holtzman et al. , 2018 ) requires feeding candidate next tokens into a discriminator , and thus scales linearly in computation with the number of tokens to be re-weighted . Plug and Play LM ( Dathathri et al. , 2020 , PPLM ) applies up to 10 updates to the generating LM ’ s latent states per time step using gradients from a discriminator , also making it many times slower than generating from the LM directly . We present GeDi1 as an algorithm for efficiently guiding generation from large LMs to make them safer and more controllable . Our proposed method uses CC-LMs as generative discriminators ( GeDis ) to guide language generation towards desired attributes . We use GeDis to compute classification likelihoods for all candidate next tokens during generation using Bayes rule , saving many 1pronounced “ Jedi ” thousand-fold in computation as compared with using a standard ( non-generative ) discriminator to compute this for large vocabulary sizes . We then show how these likelihoods can guide generation from large language models via weighted decoding and filtering . Our experimental results verify the ability of GeDi to control generation in a variety of settings while maintaining linguistic quality on par with strong language models . We apply GeDi ( 345M parameters ) to guide generation from larger language models , and find that : • GeDi trained on sentiment of movie reviews can generate book text with a positive or negative tone better than or equivalently to state of the art baselines [ Section 5.1 ] . Guiding towards positivity also has potential applications towards making LMs friendlier . • GeDi is able to significantly reduce the toxicity of GPT-2 and GPT-3 generation [ Section 5.2 ] , without sacrificing linguistic quality as compared with generating from GPT-2 and GPT-3 directly , suggesting applications towards safer language modeling . • GeDi trained on a dataset of only 4 topics can generalize to new control codes zero-shot [ Section 5.3 ] , allowing them to guide generation towards a wide variety of topics . • GeDi is very computationally efficient for both training and inference . GeDi guided generation in our experiments is more than 30× faster than applying PPLM with GPT2-XL using default settings from Dathathri et al . ( 2020 ) . Additionally , smaller GeDis fine-tuned for less than a day on a single GPU are effective and computationally efficient for controlling larger language models . This provides a cheap alternative to finetuning large LMs directly ( Ziegler et al. , 2019 ) . 2 BACKGROUND . 2.1 LANGUAGE MODELING . Language models ( LMs ) rely on an auto-regressive factorization to perform density estimation and generation of language data . Auto-regressive sequence models with parameters θ assign a probability to a sequence x1 : T = { x1 , . . . , xT } by factorizing it using the chain rule as follows : Pθ ( x1 : T ) = T∏ t=1 Pθ ( xt|x < t ) . ( 1 ) Models can assign probabilities to sequences by iteratively predicting a distribution over the next token given the previous tokens . Generating from language models requires iteratively sampling from Pθ ( xt|x < t ) , and then feeding xt back into the model as input for the next step . 2.2 CLASS-CONDITIONAL LANGUAGE MODELING . Class-conditional language models ( CC-LMs ) such as CTRL ( Keskar et al. , 2019 ) are a way for language models to generate while conditioning on an attribute variable . CC-LMs predict a probability distribution Pθ ( x1 : T |c ) , where c is a class variable or a “ control code ” that describes an attribute of the text in x1 : T , which could , for instance , describe sentiment or topic . The auto-regressive factorization for a CC-LM is given by the following equation : Pθ ( x1 : T |c ) = T∏ t=1 Pθ ( xt|x < t , c ) . ( 2 ) When training a CC-LM on a training set of sequences { x ( 1 ) 1 : T1 , . . . , x ( i ) 1 : Ti , . . . , x ( N ) 1 : TN } , each sequence x ( i ) 1 : T is paired with a control code c ( i ) , which is a label or category of the sequence . The LM is trained to minimize the average negative log-likelihood , L. L = − 1 N N∑ i=1 1 Ti Ti∑ t=1 logPθ ( x ( i ) t |x ( i ) < t , c ( i ) ) . ( 3 ) In addition to class-conditional generation , CC-LMs can be used as generative classifiers by applying Bayes rule to compute Pθ ( c|x1 : T ) ∝ P ( c ) Pθ ( x1 : T |c ) , as is done by Keskar et al . ( 2019 ) for source attribution . 3 GEDI . GeDi assumes we have a CC-LM with desired control code c and an undesired or anti-control code c̄ , and uses the contrast between Pθ ( x1 : t|c ) and Pθ ( x1 : t|c̄ ) to guide sampling from an LM that gives PLM ( x1 : t ) . Specifically , when predicting the next token during generation , GeDi uses this contrast to compute the probability that every candidate next token xt belongs to the desired class , given by Pθ ( c|xt , x < t ) . Our key insight is that this distribution can be computed very efficiently when using CC-LMs as GeDis via application of Bayes rule for partial sequences during generation . Pθ ( c|x1 : t ) = P ( c ) ∏t j=1 Pθ ( xj |x < j , c ) ∑ c′∈ { c , c̄ } ∏t j=1 P ( c ′ ) Pθ ( xj |x < j , c′ ) . ( 4 ) When computing this online during sequence generation , the model will have already computed Pθ ( xj |x < j , c′ ) for any j < t from the previous time-steps , and it will only need to compute Pθ ( xt|x < t , c′ ) . This can be computed in two parallel forward passes ; one conditioning on c and one conditioning on c̄ ( both conditioning on the same x < t ) . The model can also save the hidden states from the previous time steps to avoid computing a forward pass through the full sequence at each next token generation step . Applying a unidirectional classifier such as GPT ( Radford et al. , 2018 ) to compute Pθ ( c|xt , x < t ) directly ( i.e . discriminatively ) would require feeding in every possible input xt ∈ V into the classifier , and thus would require |V| forward passes for a vocab set V . A bidirectional classifier such as BERT ( Devlin et al. , 2018 ) would require t × |V| forward passes because it would need to recompute attention states from earlier time-steps . For typical vocab sizes of 20k+ , GeDi ’ s online classification trick can compute Pθ ( c|xt , x < t ) for every possible next token xt on the order of 10k fold less computation as compared with a unidirectional classifier ( because the unidirectional classifier would require 20k+ forward passes through the network , whereas the GeDi would only require 2 through the CC-LM and one through the base-LM ) . In practice , we find that applying Equation 4 to long sequences often results in poorly calibrated distributions later in the sequence that assign classification probabilities of 1 or 0 to on all candidate next words , which provides no useful signal . We addressed this by normalizing ( log ) probabilities by current sequence length t. To compute Pθ ( c|x1 : t ) for GeDi-guided generation , we use the following equation : Pθ ( c|x1 : t ) = ( Pθ ( x1 : t|c ) 1/t∑ c′∈ { c , c̄ } Pθ ( x1 : t|c′ ) 1/t . ( 5 ) where class priors P ( c ) are omitted . In practice , Pθ ( c|x1 : t ) is computed with log-probabilities ( see Appendix A ) . With the efficient estimation of Pθ ( c|xt , x < t ) , there are many possible heuristics that can be used to guide LM generation , so long as the LM and GeDi share the same tokenization . Heuristics that use Pθ ( c|xt , x < t ) inherently contrast predictions conditioned on c and c̄ , causing attributes common to c and c̄ to be cancelled out , more effectively allowing for the attribute described by c to be transferred across domains , as illustrated in Figure 1 . 3.1 HEURISTICS FOR GUIDING GENERATION . We consider a weighted decoding heuristic and a filtering heuristic to use Pθ ( c|xt , x < t ) to guide generation . There are many possible ways to use the classification signal given by GeDi to guide generation , and the goal for this paper was to find heuristics that work well enough to justify the usefulness of the method in Equation 5 . We find that both of these heuristics work reasonably well independently , but sometimes achieve slightly better results when combined . Our initial heuristic applies a weighted posterior given by Pw ( xt|x < t , c ) ∝ PLM ( xt|x < t ) Pθ ( c|xt , x < t ) ω , ( 6 ) where ω > 1 to bias generation more strongly towards the correct class . The right hand side of Equation ( 6 ) is normalized over all xt in the vocabulary to obtain Pw ( xt|x < t , c ) . We summarize the resulting scheme in Algorithm 1 . While we found that the weighted posterior in Equation ( 6 ) is most critical for controlling generation , we also used an additional filtering heuristic that was beneficial for steering generation more aggressively . This heuristic , inspired by nucleus sampling ( Holtzman et al. , 2020 ) , removes candidate next word tokens with lower values for Pθ ( c|xt , x < t ) while maintaining a minimum of at least 1 − ρ in cumulative probability mass in Pw ( xt|x < t , c ) , where 0 ≤ ρ < 1 is a parameter that decides the aggressiveness of the filtering . We define Vn as the set of n tokens with the highest Pθ ( c|xt , x < t ) . We define m as the minimum n such that∑ xt∈Vn Pw ( xt|x < t , c ) ≥ 1− ρ . ( 7 ) We define Vm as Vn for n = m , meaning that Vm will contain the minimum number of tokens possible at the head of the distribution for Pθ ( c|xt , x < t ) to maintain a minimum cumulative probability of ρ in Pw ( xt|x < t , c ) . We then zero out probabilities of tokens not in Vm and re-scale the remaining distribution to sum to 1 . Algorithm 1 Generative Discriminator Guided Sequence Generation Inputs : base LM PLM , CC-LM Pθ , vocabulary V , posterior mixing weight ω , decoding scheme 1 : P ( x|c ) ← 1 2 : P ( x|c̄ ) ← 1 3 : for t = 1 . . . , N do 4 : pLM ← [ PLM ( xt = v|x < t ) for v in V ] . base-LM prediction 5 : 6 : px1 : t|c ← [ ( P ( x|c ) Pθ ( xt = v|x < t , c ) ) 1/t for v in V ] . CC-LM with control code 7 : px1 : t|c̄ ← [ ( P ( x|c̄ ) Pθ ( xt = v|x < t , c̄ ) ) 1/t for v in V ] . CC-LM with anti control code 8 : 9 : pc|x1 : t ← px1 : t|c 1 ( px1 : t|c+px1 : t|c̄ ) 10 : 11 : pw ← pLM ( pc|x1 : t ) ω 12 : pw ← pw∑|V| i=1 pw [ i ] . normalize over the vocabulary 13 : vi ← Decode ( pw ) . Can be greedy or sampling , could include filtering in Eq . 7 14 : 15 : P ( x|c ) ← P ( x|c ) Pθ ( xt = vi|x < t , c ) 16 : P ( x|c̄ ) ← P ( x|c̄ ) Pθ ( xt = vi|x < t , c̄ ) 17 : xt ← vi | The paper considers the problem of attribute-based sequence generation, particularly in language models. Authors propose a framework “GeDi” which learns a generative classifier for controlling generation from a large language model. With experiments on publicly available datasets and models, and including human-evaluation, the authors empirically demonstrate that the algorithm is computationally efficient and is competitive against strong baseline algorithms like CTRL, Plug&Play language models (PPLM). | SP:bd6cf6c4ef7d78b8f5d239f539d94f337c8ec4b1 |
Efficient Reinforcement Learning in Resource Allocation Problems Through Permutation Invariant Multi-task Learning | 1 INTRODUCTION . Sample efficiency in reinforcement learning ( RL ) is an elusive goal . Recent attempts at increasing the sample efficiency of RL implementations have focused to a large extent on incorporating models into the training process : Xu et al . ( 2019 ) ; Clavera et al . ( 2018 ) ; Zhang et al . ( 2018 ) ; Berkenkamp et al . ( 2017 ) ; Ke et al . ( 2019 ) ; Yarats et al . ( 2019 ) ; Huang et al . ( 2019 ) ; Chua et al . ( 2018 ) ; Serban et al . ( 2018 ) . The models encapsulate knowledge explicitly , complementing the experiences that are gained by sampling from the RL environment . Another means towards increasing the availability of samples for a reinforcement learner is by tilting the training towards one that will better transfer to related tasks : if the training process is sufficiently well adapted to more than one task , then the training of a particular task should be able to benefit from samples from the other related tasks . This idea was explored a decade ago in Lazaric & Ghavamzadeh ( 2010 ) and has been gaining traction ever since , as researchers try to increase the reach of deep reinforcement learning from its comfortable footing in solving games outrageously well to solving other important problems . Yu ( 2018 ) discusses a number of methods for increasing sample efficiency in RL and includes experience transfer as one important avenue , covering the transfer of samples , as we do here , transfer of representation or skills , and jumpstarting models which are then ready to be quickly , i.e . with few samples , updated to different tasks . D ’ Eramo et al . ( 2020 ) address the same idea , noting that multi-task learning can improve the learning of each individual task , motivated by robotics-type tasks with underlying commonality , such as balancing a single vs. a double pendulum , or hopping vs. walking . We are interested in exploiting the ability of multi-task learning to solve the sample efficiency problem of RL . Our setting does not apply to all problem classes nor does it seek to exploit the kind of physical similarities found in robotics tasks that form the motivation of Lazaric & Ghavamzadeh ( 2010 ) ; D ’ Eramo et al . ( 2020 ) . Rather , we show that there are a number of reinforcement learning tasks with a particular fundamental property that makes them ideal candidates for multi-task learning with the goal of increasing the availability of samples for their training . We refer to this property as permutation invariance . It is present in very diverse tasks : we illustrate it on a financial portfolio optimization problem , whereby trades are executed sequentially over a given time horizon , and on the problem of meta-learning in a federated supervised learning setting . Permutation invariance in the financial portfolio problem exhibits itself as follows : consider the task of allocating a portion of wealth to each of a number of financial instruments using a trading policy . If the trading policy is permutation invariant , one can change the order of the instruments without changing the policy . This allows one to generate multiple portfolio optimization tasks from a given set of financial instruments . A commonality between applications that have this property is that they concern sequential resource allocation : at each time step , the resource allocation scores the quality of each available candidate entity ( for example a financial instrument in the above example ) , then based on those scores , apportions out the resource ( the total wealth to invest , in the above example ) among the entities at that time step , so that over the horizon of interest , the reward is maximized . Sequential resource allocation problems include applications such as sequential allocation of budget , sequential allocation of space , e.g . in IT systems , hotels , delivery vehicles , sequential allocation of people to work slots or appointments , etc . Many such applications possess permutation invariance in that the ordering of the entities , i.e . where the resources are allocated , can change without changing the resulting optimal allocation . We show that under this form of permutation invariance , it is possible to derive a bound on the performance of the policy . The bound is an extension of that of Lazaric & Ghavamzadeh ( 2010 ) , and while similar to , provides additional information beyond the bound of D ’ Eramo et al . ( 2020 ) . We use the bound to motivate an algorithm that allows for substantially improved results as compared with solving each task on its own . The bound and the algorithm are first analyzed on a synthetic problem that validates the bound in our theorem and confirms the multi-task gain that the theory predicts . Hessel et al . ( 2018 ) ; Bram et al . ( 2019 ) have cautioned against degrading of the performance on each task when some tasks bias the updates to the detriment of others in multi-task learning . They claim that some tasks have a greater density or magnitude of in-task rewards and hence a disproportionate impact on the learning process . In our setting , deleterious effects of some tasks on others could also arise . The algorithm we propose handles this through a form of prioritized sampling , where priorities are put on the tasks themselves , and acts like a prioritized experience replay buffer , applied to a multi-task learning problem . We show empirically that the priorities thus defined protect the overall learning problem from the deleterious effects that unrelated or unhelpful tasks could otherwise have on the policy . The contributions of this work are as follows : ( 1 ) we identify the permutation invariance property of the class of reinforcement learning problems involving sequential resource allocation , ( 2 ) we define a method to increase sample efficiency in these reinforcement learning problems by leveraging this property of permutation invariance ; ( 3 ) we provide a theoretical performance bound for the class of problems ; ( 4 ) we validate experimentally the utility of permutation variance on sample efficiency as well as the validity of the bound on a synthetic problem ; and ( 5 ) we illustrate two real-world RL resource allocation tasks for which this property holds and demonstrate the benefits of the proposed method on sample efficiency and thus also on the overall performance of the models . 2 RELATED WORK . A notable first stream of work on leveraging multi-task learning for enhancing RL performance on single tasks can be found in Wilson et al . ( 2007 ) ; Lazaric & Ghavamzadeh ( 2010 ) which consider , as we do , that there is an underlying MDP from which the multiple tasks can be thought to derive . They use however a Bayesian approach and propose a different algorithmic method than ours . Our results extend performance bounds by Lazaric et al . ( 2012 ) on single-task RL . As noted by Yu ( 2018 ) , jumpstarting , or distilling experiences and representations of relevant policies is another means to increasing sample efficiency in solving a new but related problem . Rusu et al . ( 2016 ) uses this idea in so-called progressive neural networks and Parisotto et al . ( 2015 ) leverage multiple experts to guide the derivation of a general policy . With a similar objective , Teh et al . ( 2017 ) define a policy centroid , that is , a shared distilled policy , that captures the commonalities across the behaviors in the tasks . In all of these distillation-type methods , the tasks considered are simple or complex games . Teh et al . ( 2017 ) note that their policy centroid method , distral , is likely to be affected by task interference , in that differences across tasks may degrade the performance of the resulting policy of any of the constituent tasks . This topic was studied by Hessel et al . ( 2018 ) ; Bram et al . ( 2019 ) . Hessel et al . ( 2018 ) proposed a solution to this by extending the so-called PopArt normalization van Hasselt et al . ( 2016 ) to re-scale the updates of each task so that the different characteristics of the task-specific reward do not skew the learning process . Bram et al . ( 2019 ) use a different approach that learns attention weights of the sub-networks of each task and discards those that are not relevant or helpful . Vuong et al . ( 2019 ) ; D ’ Eramo et al . ( 2020 ) are , like our work , concerned with sharing of experiences to facilitate a more sample-efficient learning process . Vuong et al . ( 2019 ) suggest identifying the shared portions of tasks to allow sharing of samples in those portions . The work of D ’ Eramo et al . ( 2020 ) is in some ways quite similar to ours : the authors ’ goal is the same and they derive a bound as we do on the performance in this setting . However , their setting is different in that their tasks have both shared and task-specific components , and their bound becomes tighter only as the number of tasks increases . In our setting , we do not require a task-specific component , and we are able to show how the distance between the MDPs of each task , in addition to the number of tasks , affects the strength of the bound . Recently , permutation invariance has been exploited in deep multi-agent reinforcement learning ( Liu et al. , 2019 ) where the invariance properties arise naturally in a homogeneous multi-agent setting . Their work employs permutation invariance in learning the critic whereas in our case the entire learned policy employs permutation invariance . 3 PRELIMINARIES . We begin by defining notation . For a measurable space with domain X , let S ( X ) denote the set of probability measures over X , and B ( X ; L ) the space of bounded measurable functions with domain X and bound 0 < L < ∞ . For a measure ρ ∈ S ( X ) and a measurable function f : X → R , the l2 ( ρ ) -norm of f is ‖f‖ρ , and for a set of n points X1 , · · · , Xn ∈ X , the empirical norm , ‖f‖n is ‖f‖2ρ = ∫ f ( x ) 2ρ ( dx ) and ‖f‖2n = 1 n n∑ t=1 f ( Xt ) 2 . Let ‖f‖∞ = supx∈X |f ( x ) | be the supremum norm of f . Consider a set of MDPs indexed by t. Each MDP is denoted by a tupleMt = 〈X , A , Rt , Pt , γ〉 , where X , a bounded closed subset of the s-dimensional Euclidean space , is a common state space ; A is a common action space , Rt : X ×A → R is a task specific reward function uniformly bounded by Rmax , Pt is a task specific transition kernel such that Pt ( ·|x , a ) is a distribution over X for all x ∈ X and a ∈ A , and γ ∈ ( 0 , 1 ) is a common discount factor . Deterministic policies are denoted by π : X → A . For a given policy π , the MDPMt is reduced to a Markov chainMπt = 〈X , Rπt , Pπt , γ〉 with reward function Rπt ( x ) = Rt ( x , π ( x ) ) , transition kernel P π t ( ·|x ) = Pt ( ·|x , π ( x ) ) , and stationary distribution ρπt . The value function V πt for MDP t is defined as the unique fixed-point of the Bellman operator T πt : B ( X ; Vmax = Rmax/ ( 1− γ ) ) → B ( X ; Vmax ) , given by ( T πt V ) ( x ) = Rπt ( x ) + γ ∫ X Pπt ( dy|x ) V ( y ) . Let π∗t denote the optimal policy forMt . The optimal value function V π∗t t forMt is defined as the unique fixed-point of its optimal Bellman operator T π ∗ t t which is defined by ( T π ∗ t t V ) ( x ) = max a∈A [ Rt ( x , a ) + γ ∫ X Pt ( dy|x , a ) V ( y ) ] . To approximate the value function V , we use a linear approximation architecture with parameters α ∈ Rd and basis functions ϕi ∈ B ( X ; L ) for i = 1 , · · · , d. Let ϕ ( · ) = ( ϕ1 ( · ) , · · · , ϕd ( · ) ) T ∈ Rd be the feature vector and F the linear function space spanned by basis functions ϕi . Thus , F = { fα | α ∈ Rd and fα ( · ) = ϕ ( · ) Tα } . Consider a learning task to dynamically allocate a common resource across entities Ut ⊆ U . Each t corresponds to a task , but for now take t to be an arbitrary fixed index . At each time step n , the decision maker observes states xn = ( xi , n ) i∈Ut of the entities , where xi , n is the state of entity i , and takes action an = ( ai , n ) i∈Ut , where ai , n is the share of the resource allocated to entity i . The total resource capacity is normalized to 1 for convenience . Therefore , allocations satisfy 0 ≤ ai , n ≤ 1 and∑ i∈Ut ai , n = 1 . We consider policy πθ ( xn ) parameterized by θ . Assume that we have access to the reward function Rt as well as a simulator that generates a trajectory of length N given any arbitrary policy πθ . The objective of the learning task is to maximize Jt ( θ ) = E [ N∑ n=1 γn−1Rt ( xn , an ) ∣∣∣∣∣ an+1 = πθ ( xn ) , xn+1 ∼ Pt ( ·|xn , an ) , x1 ∼ Pt ( · ) ] . In many settings , N is small and simulators are inaccurate ; therefore , trajectories generated by the simulator are poor representations of the actual transition dynamics . This occurs in batch RL where trajectories are rollouts from a dataset . In these cases , policies overfit and generalize poorly . | This paper proposes an approach to reducing the sample complexity in multi-task reinforcement learning using permutation invariant policies. The main premise of the paper is that certain families of tasks exhibit approximate forms of symmetry, i.e., applying a permutation to the state/action variables would make all tasks similar in some metric sense. Then, the proposal is to learn a single permutation-invariant policy which will perform well on all of them simultaneously. An reinforcement learning algorithm to learn a permutation invariant policy is derived. | SP:2ab4f27ae293c71faa682bb0500dd42213f2694b |
Efficient Reinforcement Learning in Resource Allocation Problems Through Permutation Invariant Multi-task Learning | 1 INTRODUCTION . Sample efficiency in reinforcement learning ( RL ) is an elusive goal . Recent attempts at increasing the sample efficiency of RL implementations have focused to a large extent on incorporating models into the training process : Xu et al . ( 2019 ) ; Clavera et al . ( 2018 ) ; Zhang et al . ( 2018 ) ; Berkenkamp et al . ( 2017 ) ; Ke et al . ( 2019 ) ; Yarats et al . ( 2019 ) ; Huang et al . ( 2019 ) ; Chua et al . ( 2018 ) ; Serban et al . ( 2018 ) . The models encapsulate knowledge explicitly , complementing the experiences that are gained by sampling from the RL environment . Another means towards increasing the availability of samples for a reinforcement learner is by tilting the training towards one that will better transfer to related tasks : if the training process is sufficiently well adapted to more than one task , then the training of a particular task should be able to benefit from samples from the other related tasks . This idea was explored a decade ago in Lazaric & Ghavamzadeh ( 2010 ) and has been gaining traction ever since , as researchers try to increase the reach of deep reinforcement learning from its comfortable footing in solving games outrageously well to solving other important problems . Yu ( 2018 ) discusses a number of methods for increasing sample efficiency in RL and includes experience transfer as one important avenue , covering the transfer of samples , as we do here , transfer of representation or skills , and jumpstarting models which are then ready to be quickly , i.e . with few samples , updated to different tasks . D ’ Eramo et al . ( 2020 ) address the same idea , noting that multi-task learning can improve the learning of each individual task , motivated by robotics-type tasks with underlying commonality , such as balancing a single vs. a double pendulum , or hopping vs. walking . We are interested in exploiting the ability of multi-task learning to solve the sample efficiency problem of RL . Our setting does not apply to all problem classes nor does it seek to exploit the kind of physical similarities found in robotics tasks that form the motivation of Lazaric & Ghavamzadeh ( 2010 ) ; D ’ Eramo et al . ( 2020 ) . Rather , we show that there are a number of reinforcement learning tasks with a particular fundamental property that makes them ideal candidates for multi-task learning with the goal of increasing the availability of samples for their training . We refer to this property as permutation invariance . It is present in very diverse tasks : we illustrate it on a financial portfolio optimization problem , whereby trades are executed sequentially over a given time horizon , and on the problem of meta-learning in a federated supervised learning setting . Permutation invariance in the financial portfolio problem exhibits itself as follows : consider the task of allocating a portion of wealth to each of a number of financial instruments using a trading policy . If the trading policy is permutation invariant , one can change the order of the instruments without changing the policy . This allows one to generate multiple portfolio optimization tasks from a given set of financial instruments . A commonality between applications that have this property is that they concern sequential resource allocation : at each time step , the resource allocation scores the quality of each available candidate entity ( for example a financial instrument in the above example ) , then based on those scores , apportions out the resource ( the total wealth to invest , in the above example ) among the entities at that time step , so that over the horizon of interest , the reward is maximized . Sequential resource allocation problems include applications such as sequential allocation of budget , sequential allocation of space , e.g . in IT systems , hotels , delivery vehicles , sequential allocation of people to work slots or appointments , etc . Many such applications possess permutation invariance in that the ordering of the entities , i.e . where the resources are allocated , can change without changing the resulting optimal allocation . We show that under this form of permutation invariance , it is possible to derive a bound on the performance of the policy . The bound is an extension of that of Lazaric & Ghavamzadeh ( 2010 ) , and while similar to , provides additional information beyond the bound of D ’ Eramo et al . ( 2020 ) . We use the bound to motivate an algorithm that allows for substantially improved results as compared with solving each task on its own . The bound and the algorithm are first analyzed on a synthetic problem that validates the bound in our theorem and confirms the multi-task gain that the theory predicts . Hessel et al . ( 2018 ) ; Bram et al . ( 2019 ) have cautioned against degrading of the performance on each task when some tasks bias the updates to the detriment of others in multi-task learning . They claim that some tasks have a greater density or magnitude of in-task rewards and hence a disproportionate impact on the learning process . In our setting , deleterious effects of some tasks on others could also arise . The algorithm we propose handles this through a form of prioritized sampling , where priorities are put on the tasks themselves , and acts like a prioritized experience replay buffer , applied to a multi-task learning problem . We show empirically that the priorities thus defined protect the overall learning problem from the deleterious effects that unrelated or unhelpful tasks could otherwise have on the policy . The contributions of this work are as follows : ( 1 ) we identify the permutation invariance property of the class of reinforcement learning problems involving sequential resource allocation , ( 2 ) we define a method to increase sample efficiency in these reinforcement learning problems by leveraging this property of permutation invariance ; ( 3 ) we provide a theoretical performance bound for the class of problems ; ( 4 ) we validate experimentally the utility of permutation variance on sample efficiency as well as the validity of the bound on a synthetic problem ; and ( 5 ) we illustrate two real-world RL resource allocation tasks for which this property holds and demonstrate the benefits of the proposed method on sample efficiency and thus also on the overall performance of the models . 2 RELATED WORK . A notable first stream of work on leveraging multi-task learning for enhancing RL performance on single tasks can be found in Wilson et al . ( 2007 ) ; Lazaric & Ghavamzadeh ( 2010 ) which consider , as we do , that there is an underlying MDP from which the multiple tasks can be thought to derive . They use however a Bayesian approach and propose a different algorithmic method than ours . Our results extend performance bounds by Lazaric et al . ( 2012 ) on single-task RL . As noted by Yu ( 2018 ) , jumpstarting , or distilling experiences and representations of relevant policies is another means to increasing sample efficiency in solving a new but related problem . Rusu et al . ( 2016 ) uses this idea in so-called progressive neural networks and Parisotto et al . ( 2015 ) leverage multiple experts to guide the derivation of a general policy . With a similar objective , Teh et al . ( 2017 ) define a policy centroid , that is , a shared distilled policy , that captures the commonalities across the behaviors in the tasks . In all of these distillation-type methods , the tasks considered are simple or complex games . Teh et al . ( 2017 ) note that their policy centroid method , distral , is likely to be affected by task interference , in that differences across tasks may degrade the performance of the resulting policy of any of the constituent tasks . This topic was studied by Hessel et al . ( 2018 ) ; Bram et al . ( 2019 ) . Hessel et al . ( 2018 ) proposed a solution to this by extending the so-called PopArt normalization van Hasselt et al . ( 2016 ) to re-scale the updates of each task so that the different characteristics of the task-specific reward do not skew the learning process . Bram et al . ( 2019 ) use a different approach that learns attention weights of the sub-networks of each task and discards those that are not relevant or helpful . Vuong et al . ( 2019 ) ; D ’ Eramo et al . ( 2020 ) are , like our work , concerned with sharing of experiences to facilitate a more sample-efficient learning process . Vuong et al . ( 2019 ) suggest identifying the shared portions of tasks to allow sharing of samples in those portions . The work of D ’ Eramo et al . ( 2020 ) is in some ways quite similar to ours : the authors ’ goal is the same and they derive a bound as we do on the performance in this setting . However , their setting is different in that their tasks have both shared and task-specific components , and their bound becomes tighter only as the number of tasks increases . In our setting , we do not require a task-specific component , and we are able to show how the distance between the MDPs of each task , in addition to the number of tasks , affects the strength of the bound . Recently , permutation invariance has been exploited in deep multi-agent reinforcement learning ( Liu et al. , 2019 ) where the invariance properties arise naturally in a homogeneous multi-agent setting . Their work employs permutation invariance in learning the critic whereas in our case the entire learned policy employs permutation invariance . 3 PRELIMINARIES . We begin by defining notation . For a measurable space with domain X , let S ( X ) denote the set of probability measures over X , and B ( X ; L ) the space of bounded measurable functions with domain X and bound 0 < L < ∞ . For a measure ρ ∈ S ( X ) and a measurable function f : X → R , the l2 ( ρ ) -norm of f is ‖f‖ρ , and for a set of n points X1 , · · · , Xn ∈ X , the empirical norm , ‖f‖n is ‖f‖2ρ = ∫ f ( x ) 2ρ ( dx ) and ‖f‖2n = 1 n n∑ t=1 f ( Xt ) 2 . Let ‖f‖∞ = supx∈X |f ( x ) | be the supremum norm of f . Consider a set of MDPs indexed by t. Each MDP is denoted by a tupleMt = 〈X , A , Rt , Pt , γ〉 , where X , a bounded closed subset of the s-dimensional Euclidean space , is a common state space ; A is a common action space , Rt : X ×A → R is a task specific reward function uniformly bounded by Rmax , Pt is a task specific transition kernel such that Pt ( ·|x , a ) is a distribution over X for all x ∈ X and a ∈ A , and γ ∈ ( 0 , 1 ) is a common discount factor . Deterministic policies are denoted by π : X → A . For a given policy π , the MDPMt is reduced to a Markov chainMπt = 〈X , Rπt , Pπt , γ〉 with reward function Rπt ( x ) = Rt ( x , π ( x ) ) , transition kernel P π t ( ·|x ) = Pt ( ·|x , π ( x ) ) , and stationary distribution ρπt . The value function V πt for MDP t is defined as the unique fixed-point of the Bellman operator T πt : B ( X ; Vmax = Rmax/ ( 1− γ ) ) → B ( X ; Vmax ) , given by ( T πt V ) ( x ) = Rπt ( x ) + γ ∫ X Pπt ( dy|x ) V ( y ) . Let π∗t denote the optimal policy forMt . The optimal value function V π∗t t forMt is defined as the unique fixed-point of its optimal Bellman operator T π ∗ t t which is defined by ( T π ∗ t t V ) ( x ) = max a∈A [ Rt ( x , a ) + γ ∫ X Pt ( dy|x , a ) V ( y ) ] . To approximate the value function V , we use a linear approximation architecture with parameters α ∈ Rd and basis functions ϕi ∈ B ( X ; L ) for i = 1 , · · · , d. Let ϕ ( · ) = ( ϕ1 ( · ) , · · · , ϕd ( · ) ) T ∈ Rd be the feature vector and F the linear function space spanned by basis functions ϕi . Thus , F = { fα | α ∈ Rd and fα ( · ) = ϕ ( · ) Tα } . Consider a learning task to dynamically allocate a common resource across entities Ut ⊆ U . Each t corresponds to a task , but for now take t to be an arbitrary fixed index . At each time step n , the decision maker observes states xn = ( xi , n ) i∈Ut of the entities , where xi , n is the state of entity i , and takes action an = ( ai , n ) i∈Ut , where ai , n is the share of the resource allocated to entity i . The total resource capacity is normalized to 1 for convenience . Therefore , allocations satisfy 0 ≤ ai , n ≤ 1 and∑ i∈Ut ai , n = 1 . We consider policy πθ ( xn ) parameterized by θ . Assume that we have access to the reward function Rt as well as a simulator that generates a trajectory of length N given any arbitrary policy πθ . The objective of the learning task is to maximize Jt ( θ ) = E [ N∑ n=1 γn−1Rt ( xn , an ) ∣∣∣∣∣ an+1 = πθ ( xn ) , xn+1 ∼ Pt ( ·|xn , an ) , x1 ∼ Pt ( · ) ] . In many settings , N is small and simulators are inaccurate ; therefore , trajectories generated by the simulator are poor representations of the actual transition dynamics . This occurs in batch RL where trajectories are rollouts from a dataset . In these cases , policies overfit and generalize poorly . | This paper addresses sequential resource allocation problem using reinforcement learning, where sample efficiency is the focus of the paper. The authors identify a key property in the targeted resource allocation problems -- the permutation invariance -- which intrinsically implies the independency of samples at different time steps. From this property the paper extends the work of D’Eramo et al. (2020) and derives a potentially tighter bound for the gap between the optimal policy and the policy learned from multiple tasks. The paper also designs a new algorithms that prioritizes sampling in multi-task learning that addresses the bias between training and target tasks. Empirical evaluations on financial portfolio allocation and meta federated learning demonstrate the effectiveness of the proposed approach. | SP:2ab4f27ae293c71faa682bb0500dd42213f2694b |
Efficient Reinforcement Learning in Resource Allocation Problems Through Permutation Invariant Multi-task Learning | 1 INTRODUCTION . Sample efficiency in reinforcement learning ( RL ) is an elusive goal . Recent attempts at increasing the sample efficiency of RL implementations have focused to a large extent on incorporating models into the training process : Xu et al . ( 2019 ) ; Clavera et al . ( 2018 ) ; Zhang et al . ( 2018 ) ; Berkenkamp et al . ( 2017 ) ; Ke et al . ( 2019 ) ; Yarats et al . ( 2019 ) ; Huang et al . ( 2019 ) ; Chua et al . ( 2018 ) ; Serban et al . ( 2018 ) . The models encapsulate knowledge explicitly , complementing the experiences that are gained by sampling from the RL environment . Another means towards increasing the availability of samples for a reinforcement learner is by tilting the training towards one that will better transfer to related tasks : if the training process is sufficiently well adapted to more than one task , then the training of a particular task should be able to benefit from samples from the other related tasks . This idea was explored a decade ago in Lazaric & Ghavamzadeh ( 2010 ) and has been gaining traction ever since , as researchers try to increase the reach of deep reinforcement learning from its comfortable footing in solving games outrageously well to solving other important problems . Yu ( 2018 ) discusses a number of methods for increasing sample efficiency in RL and includes experience transfer as one important avenue , covering the transfer of samples , as we do here , transfer of representation or skills , and jumpstarting models which are then ready to be quickly , i.e . with few samples , updated to different tasks . D ’ Eramo et al . ( 2020 ) address the same idea , noting that multi-task learning can improve the learning of each individual task , motivated by robotics-type tasks with underlying commonality , such as balancing a single vs. a double pendulum , or hopping vs. walking . We are interested in exploiting the ability of multi-task learning to solve the sample efficiency problem of RL . Our setting does not apply to all problem classes nor does it seek to exploit the kind of physical similarities found in robotics tasks that form the motivation of Lazaric & Ghavamzadeh ( 2010 ) ; D ’ Eramo et al . ( 2020 ) . Rather , we show that there are a number of reinforcement learning tasks with a particular fundamental property that makes them ideal candidates for multi-task learning with the goal of increasing the availability of samples for their training . We refer to this property as permutation invariance . It is present in very diverse tasks : we illustrate it on a financial portfolio optimization problem , whereby trades are executed sequentially over a given time horizon , and on the problem of meta-learning in a federated supervised learning setting . Permutation invariance in the financial portfolio problem exhibits itself as follows : consider the task of allocating a portion of wealth to each of a number of financial instruments using a trading policy . If the trading policy is permutation invariant , one can change the order of the instruments without changing the policy . This allows one to generate multiple portfolio optimization tasks from a given set of financial instruments . A commonality between applications that have this property is that they concern sequential resource allocation : at each time step , the resource allocation scores the quality of each available candidate entity ( for example a financial instrument in the above example ) , then based on those scores , apportions out the resource ( the total wealth to invest , in the above example ) among the entities at that time step , so that over the horizon of interest , the reward is maximized . Sequential resource allocation problems include applications such as sequential allocation of budget , sequential allocation of space , e.g . in IT systems , hotels , delivery vehicles , sequential allocation of people to work slots or appointments , etc . Many such applications possess permutation invariance in that the ordering of the entities , i.e . where the resources are allocated , can change without changing the resulting optimal allocation . We show that under this form of permutation invariance , it is possible to derive a bound on the performance of the policy . The bound is an extension of that of Lazaric & Ghavamzadeh ( 2010 ) , and while similar to , provides additional information beyond the bound of D ’ Eramo et al . ( 2020 ) . We use the bound to motivate an algorithm that allows for substantially improved results as compared with solving each task on its own . The bound and the algorithm are first analyzed on a synthetic problem that validates the bound in our theorem and confirms the multi-task gain that the theory predicts . Hessel et al . ( 2018 ) ; Bram et al . ( 2019 ) have cautioned against degrading of the performance on each task when some tasks bias the updates to the detriment of others in multi-task learning . They claim that some tasks have a greater density or magnitude of in-task rewards and hence a disproportionate impact on the learning process . In our setting , deleterious effects of some tasks on others could also arise . The algorithm we propose handles this through a form of prioritized sampling , where priorities are put on the tasks themselves , and acts like a prioritized experience replay buffer , applied to a multi-task learning problem . We show empirically that the priorities thus defined protect the overall learning problem from the deleterious effects that unrelated or unhelpful tasks could otherwise have on the policy . The contributions of this work are as follows : ( 1 ) we identify the permutation invariance property of the class of reinforcement learning problems involving sequential resource allocation , ( 2 ) we define a method to increase sample efficiency in these reinforcement learning problems by leveraging this property of permutation invariance ; ( 3 ) we provide a theoretical performance bound for the class of problems ; ( 4 ) we validate experimentally the utility of permutation variance on sample efficiency as well as the validity of the bound on a synthetic problem ; and ( 5 ) we illustrate two real-world RL resource allocation tasks for which this property holds and demonstrate the benefits of the proposed method on sample efficiency and thus also on the overall performance of the models . 2 RELATED WORK . A notable first stream of work on leveraging multi-task learning for enhancing RL performance on single tasks can be found in Wilson et al . ( 2007 ) ; Lazaric & Ghavamzadeh ( 2010 ) which consider , as we do , that there is an underlying MDP from which the multiple tasks can be thought to derive . They use however a Bayesian approach and propose a different algorithmic method than ours . Our results extend performance bounds by Lazaric et al . ( 2012 ) on single-task RL . As noted by Yu ( 2018 ) , jumpstarting , or distilling experiences and representations of relevant policies is another means to increasing sample efficiency in solving a new but related problem . Rusu et al . ( 2016 ) uses this idea in so-called progressive neural networks and Parisotto et al . ( 2015 ) leverage multiple experts to guide the derivation of a general policy . With a similar objective , Teh et al . ( 2017 ) define a policy centroid , that is , a shared distilled policy , that captures the commonalities across the behaviors in the tasks . In all of these distillation-type methods , the tasks considered are simple or complex games . Teh et al . ( 2017 ) note that their policy centroid method , distral , is likely to be affected by task interference , in that differences across tasks may degrade the performance of the resulting policy of any of the constituent tasks . This topic was studied by Hessel et al . ( 2018 ) ; Bram et al . ( 2019 ) . Hessel et al . ( 2018 ) proposed a solution to this by extending the so-called PopArt normalization van Hasselt et al . ( 2016 ) to re-scale the updates of each task so that the different characteristics of the task-specific reward do not skew the learning process . Bram et al . ( 2019 ) use a different approach that learns attention weights of the sub-networks of each task and discards those that are not relevant or helpful . Vuong et al . ( 2019 ) ; D ’ Eramo et al . ( 2020 ) are , like our work , concerned with sharing of experiences to facilitate a more sample-efficient learning process . Vuong et al . ( 2019 ) suggest identifying the shared portions of tasks to allow sharing of samples in those portions . The work of D ’ Eramo et al . ( 2020 ) is in some ways quite similar to ours : the authors ’ goal is the same and they derive a bound as we do on the performance in this setting . However , their setting is different in that their tasks have both shared and task-specific components , and their bound becomes tighter only as the number of tasks increases . In our setting , we do not require a task-specific component , and we are able to show how the distance between the MDPs of each task , in addition to the number of tasks , affects the strength of the bound . Recently , permutation invariance has been exploited in deep multi-agent reinforcement learning ( Liu et al. , 2019 ) where the invariance properties arise naturally in a homogeneous multi-agent setting . Their work employs permutation invariance in learning the critic whereas in our case the entire learned policy employs permutation invariance . 3 PRELIMINARIES . We begin by defining notation . For a measurable space with domain X , let S ( X ) denote the set of probability measures over X , and B ( X ; L ) the space of bounded measurable functions with domain X and bound 0 < L < ∞ . For a measure ρ ∈ S ( X ) and a measurable function f : X → R , the l2 ( ρ ) -norm of f is ‖f‖ρ , and for a set of n points X1 , · · · , Xn ∈ X , the empirical norm , ‖f‖n is ‖f‖2ρ = ∫ f ( x ) 2ρ ( dx ) and ‖f‖2n = 1 n n∑ t=1 f ( Xt ) 2 . Let ‖f‖∞ = supx∈X |f ( x ) | be the supremum norm of f . Consider a set of MDPs indexed by t. Each MDP is denoted by a tupleMt = 〈X , A , Rt , Pt , γ〉 , where X , a bounded closed subset of the s-dimensional Euclidean space , is a common state space ; A is a common action space , Rt : X ×A → R is a task specific reward function uniformly bounded by Rmax , Pt is a task specific transition kernel such that Pt ( ·|x , a ) is a distribution over X for all x ∈ X and a ∈ A , and γ ∈ ( 0 , 1 ) is a common discount factor . Deterministic policies are denoted by π : X → A . For a given policy π , the MDPMt is reduced to a Markov chainMπt = 〈X , Rπt , Pπt , γ〉 with reward function Rπt ( x ) = Rt ( x , π ( x ) ) , transition kernel P π t ( ·|x ) = Pt ( ·|x , π ( x ) ) , and stationary distribution ρπt . The value function V πt for MDP t is defined as the unique fixed-point of the Bellman operator T πt : B ( X ; Vmax = Rmax/ ( 1− γ ) ) → B ( X ; Vmax ) , given by ( T πt V ) ( x ) = Rπt ( x ) + γ ∫ X Pπt ( dy|x ) V ( y ) . Let π∗t denote the optimal policy forMt . The optimal value function V π∗t t forMt is defined as the unique fixed-point of its optimal Bellman operator T π ∗ t t which is defined by ( T π ∗ t t V ) ( x ) = max a∈A [ Rt ( x , a ) + γ ∫ X Pt ( dy|x , a ) V ( y ) ] . To approximate the value function V , we use a linear approximation architecture with parameters α ∈ Rd and basis functions ϕi ∈ B ( X ; L ) for i = 1 , · · · , d. Let ϕ ( · ) = ( ϕ1 ( · ) , · · · , ϕd ( · ) ) T ∈ Rd be the feature vector and F the linear function space spanned by basis functions ϕi . Thus , F = { fα | α ∈ Rd and fα ( · ) = ϕ ( · ) Tα } . Consider a learning task to dynamically allocate a common resource across entities Ut ⊆ U . Each t corresponds to a task , but for now take t to be an arbitrary fixed index . At each time step n , the decision maker observes states xn = ( xi , n ) i∈Ut of the entities , where xi , n is the state of entity i , and takes action an = ( ai , n ) i∈Ut , where ai , n is the share of the resource allocated to entity i . The total resource capacity is normalized to 1 for convenience . Therefore , allocations satisfy 0 ≤ ai , n ≤ 1 and∑ i∈Ut ai , n = 1 . We consider policy πθ ( xn ) parameterized by θ . Assume that we have access to the reward function Rt as well as a simulator that generates a trajectory of length N given any arbitrary policy πθ . The objective of the learning task is to maximize Jt ( θ ) = E [ N∑ n=1 γn−1Rt ( xn , an ) ∣∣∣∣∣ an+1 = πθ ( xn ) , xn+1 ∼ Pt ( ·|xn , an ) , x1 ∼ Pt ( · ) ] . In many settings , N is small and simulators are inaccurate ; therefore , trajectories generated by the simulator are poor representations of the actual transition dynamics . This occurs in batch RL where trajectories are rollouts from a dataset . In these cases , policies overfit and generalize poorly . | The paper proposes an RL algorithm for multi-task learning. Under certain assumptions, the paper proves a sample complexity result for this setting. The paper presents a new algorithm based on this approach. The empirical results on the task of sequential portfolio optimization shows that this approach performs better than the policy of constantly rebalanced portfolio. | SP:2ab4f27ae293c71faa682bb0500dd42213f2694b |
Hellinger Distance Constrained Regression | 1 INTRODUCTION . Policy gradient algorithms are methods of model-free reinforcement learning that optimize policy through differentiating expected discounted return . Despite the simplicity , to converge , these methods should stay on-policy because of the first-order approximation of state visitation frequencies . This issue makes agents learn through trial-and-error , using data only once . To make policy gradient updates more off-policy , we can add a constraint on the update to decrease the step size if the current policy is too far from the sampling policy . One of the first methods was to add total variation distance squared as a constraint for mixture policies . Later it was proven that there is a lower bound for new policy ’ s expected discounted return ( Kakade & Langford , 2002 ) . Recently it was proven that this lower bound exists for all types of updates ( Schulman et al. , 2015 ) . Next , total variation distance squared was replaced by Kullback-Leibler divergence that is greater than or equal to the previous one ( Pinker ’ s inequality ( Levin & Peres , 2017 ) ) , so that the lower bound was decreased ( Schulman et al. , 2015 ) . Using Lagrangian , have been derived off-policy method called Advantage-Weighted Regression ( Peng et al. , 2019 ) , which also used KL as a constraint . This article proposes a new method whose lower bound of expected discounted return is greater than or equal to the bound with KL . We achieve this by replacing total variation distance by Hellinger distance , which decreases lower bound . Therefore strictness stays the same . Then we derive an offpolicy method called Hellinger Distance Constrained Regression using the new constraint . It can be used on discrete and continuous action spaces since derivation uses Lebesgue integrals rather than a summation or Riemann integrals . 2 PRELIMINARIES . To better present the problem , we start from basic definitions , go through the history of improvements , and then describe the disadvantages of using KL divergence as a constraint . We consider an infinite-horizon discounted Markov decision process ( MDP ) , defined by the tuple ( S , A , P , r , ρ0 , γ ) , where S is a set of states ( finite or infinite ) , A is a set of actions ( finite or infinite ) , P : S × A × S → R is the transition probability distribution , r : S → R is the reward function , ρ0 : S → R is the distribution of the initial state s0 , and γ ∈ ( 0 , 1 ) is the discount factor . Let π denote a stochastic policy π : S × A → [ 0 , 1 ] , and then its expected discounted return is : η ( π ) = Es0 , a0 , ... [ ∞∑ t=0 γtr ( st ) ] , where s0 ∼ ρ0 ( · ) , at ∼ π ( ·|st ) , st+1 ∼ P ( ·|st , at ) . ( 1 ) This paper uses state-action value function Qπ , state value function Vπ , and advantage function Aπ with the following definitions : Qπ ( st , at ) = Est+1 , at+1 , ... [ ∞∑ l=0 γlr ( st+l ) ] Vπ ( st ) = Eat , st+1 , at+1 , ... [ ∞∑ l=0 γlr ( st+l ) ] Aπ ( st , at ) = Qπ ( st , at ) − Vπ ( st ) . ( 2 ) Let ρπ ( s ) be unnormalized visitation frequencies of state s where actions are chosen according to π : ρπ ( s ) = ∞∑ t=0 γtP ( st = s ) . ( 3 ) Following identity expresses the expected return of another policy π̃ in terms of the advantage over π , accumulated over states ( see Schulman et al . ( 2015 ) for proof ) : η ( π̃ ) = η ( π ) + ∫ ρπ̃ ( s ) ∫ π̃ ( a|s ) Aπ ( s , a ) da ds . ( 4 ) In approximately optimal learning , we replace state visitation frequency ρπ̃ by ρπ , since this drastically decrease optimization complexity : Lπ ( π̃ ) = η ( π ) + ∫ ρπ ( s ) ∫ π̃ ( a|s ) Aπ ( s , a ) da ds . ( 5 ) Let πold denote current policy , then the lower bound for the expected discounted return for the new policy πnew will be ( see Schulman et al . ( 2015 ) for proof ) : η ( πnew ) ≥ Lπold ( πnew ) − 4 γ ( 1− γ ) 2 α2 where = max s , a |Aπ ( s , a ) | , α = max s DTV ( πold ( ·|s ) ||πnew ( ·|s ) ) , DTV ( πold ( ·|s ) ||πnew ( ·|s ) ) = 1 2 ∫ |πold ( a|s ) − πnew ( a|s ) | da . ( 6 ) Theoretical Trust-Region Policy Optimization algorithm relays on Pinsker ’ s inequality ( see ( Tsybakov , 2009 ) for proof ) : DKL ( πold ( ·|s ) ||πnew ( ·|s ) ) ≥ DTV ( πold ( ·|s ) ||πnew ( ·|s ) ) 2 where DKL ( πold ( ·|s ) ||πnew ( ·|s ) ) = ∫ πold ( a|s ) log πold ( a|s ) πnew ( a|s ) da . ( 7 ) To retain strictness and decrease calculation complexity , total variation distance squared was replaced with Kullback-Leibler divergence DKL ( πold ( ·|s ) ||πnew ( ·|s ) ) : η ( πnew ) ≥ Lπold ( πnew ) − CDmaxKL ( πold||πnew ) where = max s , a |Aπ ( s , a ) | , C = 4 γ ( 1− γ ) 2 , DmaxKL ( πold||πnew ) = max s DKL ( πold ( ·|s ) ||πnew ( ·|s ) ) . ( 8 ) However , this replacement greatly decreases the lower bound for the expected discounted return for the new policy . Moreover , Kullback-Leibler divergence has no upper bound . Therefore we have no policy-independent lower bound for this type of update . 3 HELLINGER DISTANCE IN POLICY OPTIMIZATION . We can improve lower bound ( compared to KL ) by replacing DTV ( πold ( · | s ) || πnew ( · | s ) ) with Hellinger distance H ( πold ( ·|s ) || πnew ( · | s ) ) : H ( πold ( ·|s ) || πnew ( ·|s ) ) 2 = 1− ∫ √ πold ( a|s ) πnew ( a|s ) da ( 9 ) Theorem 1 ( see Appendix A or ( Tsybakov , 2009 , section 2.4 ) for proof ) proves correctness and improvement ( compared to KL ) to the lower bound . Let p ( v ) and q ( v ) be two probability density functions then : DTV ( p ( · ) || q ( · ) ) 2 ≤ 2H ( p ( · ) || q ( · ) ) 2 ≤ DKL ( p ( · ) || q ( · ) ) ( 10 ) Replacing p ( v ) and q ( v ) with πold ( · | s ) and πnew ( · | s ) respectively , new lower bound follows : η ( πnew ) ≥ Lπold ( πnew ) − 8 γ ( 1− γ ) 2 α2 where = max s , a |Aπ ( s , a ) | , α = max s H ( πold ( ·|s ) ||πnew ( ·|s ) ) ( 11 ) It is worth to note that H ( πold ( · | s ) || πnew ( · | s ) ) ≤ 1 . 4 HELLINGER DISTANCE CONSTRAINED REGRESSION ( HDCR ) . We could use presented lower bound as in TRPO , but instead , we derive an offline regression algorithm by introducing the following optimization problem where µ is the sampling policy : arg max π ∫ ρµ ( s ) ∫ π ( a|s ) Aµ ( s , a ) da ds s.t . ∫ ρµ ( s ) H ( π ( ·|s ) ||µ ( ·|s ) ) ds ≤ , ∫ π ( a|s ) da = 1 , ∀s ∈ S. ( 12 ) Constructing Lagrangian , differentiating it with respect to π , and solving for π gives us the following optimal policy ( see Appendix B for derivation ) : π∗ ( a|s ) = µ ( a|s ) β 2 ( β − 2Aµ ( s , a ) ) 2 , where β is a Lagrangian multiplier . ( 13 ) Constructing a regression problem of KL divergence between optimal policy π∗ and current policy π and simplifying gives us the following supervised regression problem ( see Appendix B for derivation ) : arg max π Es∼ρµ ( · ) Ea∼µ ( ·|s ) log π ( a|s ) 1 ( β −Aµ ( s , a ) ) 2 ( 14 ) Using notation of ABM paper ( Siegel et al. , 2020 ) ” advantage-weighting ” function is f ( A ( s , a ) ) = 1 ( β−A ( s , a ) ) 2 . If we use HDCR with Experience Replay , in equation 14 , we replace µ ( ·|s ) in expectation Ea ∼ µ ( · | s ) and advantage function Aµ ( s , a ) . Let Π = { πi , πi+1 , ... , πi+N } be a set of sampling policies from which actions were sampled , w ( πi ) probability of selecting policy πi , then : µ ( s , a ) = ∫ Π w ( π ) ρπ ( s ) π ( a|s ) dπ Aµ ( s , a ) = ∫ Π w ( π ) ρπ ( s ) ( Qπ ( s , a ) − Vπ ( s ) ) dπ∫ Π w ( π ) ρπ ( s ) dπ V ( s ) = ∫ Π w ( π ) ρπ ( s ) Vπ ( s ) dπ∫ Π w ( π ) ρπ ( s ) dπ ( 15 ) The proof will repeat the proof for AWR with Experience Replay ( Peng et al. , 2019 ) . Practically we simply sample uniformly from the replay buffer and using a value function estimator . This type of sampling provides us an approximation of expectation and state value function . Let D denote a set of stored trajectories ( replay buffer ) , A ( s , a ; φ ) is an advantage function parameterized by vector φ . The most popular method to obtain A ( s , a ; φ ) for offline learning is to use state-action function estimator Q ( s , a ; φ ) parameterized by φ : A ( s , a ; φ ) = Q ( s , a ; φ ) − ∫ π ( a′|s ; θk ) Q ( s , a′ ; φk ) da′ ( 16 ) Despite Q ( s , a ; φ ) being closer to the expectation of discounted return following policy π ( because of ” taking ” the first action according to π rather then µ ) , we found Monte-Carlo return more efficient on tiny offline datasets . Greater performance using MC return can be explained by a lack of experience ” produced ” by certain actions . Monte-Carlo estimation of A ( s , a ; φ ) can be described as follows where RDst , at = ∑T l=0 γ lrt+l and V ( s ; φ ) is a state value function estimator parameterized by vector φ : A ( s , a ; φ ) = RDs , a − V ( s ; φ ) ( 17 ) Also , we can use Generalized Advantage Estimation ( Schulman et al. , 2016 ) , where γ ∈ [ 0 , 1 ] and δφkt is a one-step temporal difference for state st calculated using old vector φk : δφkt = rt + γV ( st+1 ; φk ) − V ( st ; φk ) Â ( st , at ; φk ) = T∑ l=0 ( γλ ) lδφkt+l A ( st , at ; φ ) = Â ( st , at ; φk ) + V ( st ; φk ) − V ( st ; φ ) ( 18 ) Finally , we propose the following reinforcement learning algorithm : Algorithm 1 : Hellinger Distance Constrained Regression θ1 ← random initial weights D ← ∅ for iteration k = 1 , ... , kmax do add trajectories { τi } sampled via πθk to D φk+1 ← arg minφ Es , a∼DA2 ( s , a ; φ ) θk+1 ← arg maxθ Es , a∼D [ log πθ ( a|s ) 1 ( β−A ( s , a ; φk ) ) 2 ] end | This paper proposes a supervised learning for off-policy reinforcement learning. It exploits the Hellinger distance instead of KL divergence. Thus it achieves tighter lower bound of the expected culmulative return than that using the KL divergence. Moreover, the new lower bound is policy independent. The experimental results show that the proposed method slightly outperforms other baselines when only small amount of data are given, while the algorithms fail to learn on several environments. | SP:ef7e83384f580d3bc6ad5104d87f7f42fb8bd5c6 |
Hellinger Distance Constrained Regression | 1 INTRODUCTION . Policy gradient algorithms are methods of model-free reinforcement learning that optimize policy through differentiating expected discounted return . Despite the simplicity , to converge , these methods should stay on-policy because of the first-order approximation of state visitation frequencies . This issue makes agents learn through trial-and-error , using data only once . To make policy gradient updates more off-policy , we can add a constraint on the update to decrease the step size if the current policy is too far from the sampling policy . One of the first methods was to add total variation distance squared as a constraint for mixture policies . Later it was proven that there is a lower bound for new policy ’ s expected discounted return ( Kakade & Langford , 2002 ) . Recently it was proven that this lower bound exists for all types of updates ( Schulman et al. , 2015 ) . Next , total variation distance squared was replaced by Kullback-Leibler divergence that is greater than or equal to the previous one ( Pinker ’ s inequality ( Levin & Peres , 2017 ) ) , so that the lower bound was decreased ( Schulman et al. , 2015 ) . Using Lagrangian , have been derived off-policy method called Advantage-Weighted Regression ( Peng et al. , 2019 ) , which also used KL as a constraint . This article proposes a new method whose lower bound of expected discounted return is greater than or equal to the bound with KL . We achieve this by replacing total variation distance by Hellinger distance , which decreases lower bound . Therefore strictness stays the same . Then we derive an offpolicy method called Hellinger Distance Constrained Regression using the new constraint . It can be used on discrete and continuous action spaces since derivation uses Lebesgue integrals rather than a summation or Riemann integrals . 2 PRELIMINARIES . To better present the problem , we start from basic definitions , go through the history of improvements , and then describe the disadvantages of using KL divergence as a constraint . We consider an infinite-horizon discounted Markov decision process ( MDP ) , defined by the tuple ( S , A , P , r , ρ0 , γ ) , where S is a set of states ( finite or infinite ) , A is a set of actions ( finite or infinite ) , P : S × A × S → R is the transition probability distribution , r : S → R is the reward function , ρ0 : S → R is the distribution of the initial state s0 , and γ ∈ ( 0 , 1 ) is the discount factor . Let π denote a stochastic policy π : S × A → [ 0 , 1 ] , and then its expected discounted return is : η ( π ) = Es0 , a0 , ... [ ∞∑ t=0 γtr ( st ) ] , where s0 ∼ ρ0 ( · ) , at ∼ π ( ·|st ) , st+1 ∼ P ( ·|st , at ) . ( 1 ) This paper uses state-action value function Qπ , state value function Vπ , and advantage function Aπ with the following definitions : Qπ ( st , at ) = Est+1 , at+1 , ... [ ∞∑ l=0 γlr ( st+l ) ] Vπ ( st ) = Eat , st+1 , at+1 , ... [ ∞∑ l=0 γlr ( st+l ) ] Aπ ( st , at ) = Qπ ( st , at ) − Vπ ( st ) . ( 2 ) Let ρπ ( s ) be unnormalized visitation frequencies of state s where actions are chosen according to π : ρπ ( s ) = ∞∑ t=0 γtP ( st = s ) . ( 3 ) Following identity expresses the expected return of another policy π̃ in terms of the advantage over π , accumulated over states ( see Schulman et al . ( 2015 ) for proof ) : η ( π̃ ) = η ( π ) + ∫ ρπ̃ ( s ) ∫ π̃ ( a|s ) Aπ ( s , a ) da ds . ( 4 ) In approximately optimal learning , we replace state visitation frequency ρπ̃ by ρπ , since this drastically decrease optimization complexity : Lπ ( π̃ ) = η ( π ) + ∫ ρπ ( s ) ∫ π̃ ( a|s ) Aπ ( s , a ) da ds . ( 5 ) Let πold denote current policy , then the lower bound for the expected discounted return for the new policy πnew will be ( see Schulman et al . ( 2015 ) for proof ) : η ( πnew ) ≥ Lπold ( πnew ) − 4 γ ( 1− γ ) 2 α2 where = max s , a |Aπ ( s , a ) | , α = max s DTV ( πold ( ·|s ) ||πnew ( ·|s ) ) , DTV ( πold ( ·|s ) ||πnew ( ·|s ) ) = 1 2 ∫ |πold ( a|s ) − πnew ( a|s ) | da . ( 6 ) Theoretical Trust-Region Policy Optimization algorithm relays on Pinsker ’ s inequality ( see ( Tsybakov , 2009 ) for proof ) : DKL ( πold ( ·|s ) ||πnew ( ·|s ) ) ≥ DTV ( πold ( ·|s ) ||πnew ( ·|s ) ) 2 where DKL ( πold ( ·|s ) ||πnew ( ·|s ) ) = ∫ πold ( a|s ) log πold ( a|s ) πnew ( a|s ) da . ( 7 ) To retain strictness and decrease calculation complexity , total variation distance squared was replaced with Kullback-Leibler divergence DKL ( πold ( ·|s ) ||πnew ( ·|s ) ) : η ( πnew ) ≥ Lπold ( πnew ) − CDmaxKL ( πold||πnew ) where = max s , a |Aπ ( s , a ) | , C = 4 γ ( 1− γ ) 2 , DmaxKL ( πold||πnew ) = max s DKL ( πold ( ·|s ) ||πnew ( ·|s ) ) . ( 8 ) However , this replacement greatly decreases the lower bound for the expected discounted return for the new policy . Moreover , Kullback-Leibler divergence has no upper bound . Therefore we have no policy-independent lower bound for this type of update . 3 HELLINGER DISTANCE IN POLICY OPTIMIZATION . We can improve lower bound ( compared to KL ) by replacing DTV ( πold ( · | s ) || πnew ( · | s ) ) with Hellinger distance H ( πold ( ·|s ) || πnew ( · | s ) ) : H ( πold ( ·|s ) || πnew ( ·|s ) ) 2 = 1− ∫ √ πold ( a|s ) πnew ( a|s ) da ( 9 ) Theorem 1 ( see Appendix A or ( Tsybakov , 2009 , section 2.4 ) for proof ) proves correctness and improvement ( compared to KL ) to the lower bound . Let p ( v ) and q ( v ) be two probability density functions then : DTV ( p ( · ) || q ( · ) ) 2 ≤ 2H ( p ( · ) || q ( · ) ) 2 ≤ DKL ( p ( · ) || q ( · ) ) ( 10 ) Replacing p ( v ) and q ( v ) with πold ( · | s ) and πnew ( · | s ) respectively , new lower bound follows : η ( πnew ) ≥ Lπold ( πnew ) − 8 γ ( 1− γ ) 2 α2 where = max s , a |Aπ ( s , a ) | , α = max s H ( πold ( ·|s ) ||πnew ( ·|s ) ) ( 11 ) It is worth to note that H ( πold ( · | s ) || πnew ( · | s ) ) ≤ 1 . 4 HELLINGER DISTANCE CONSTRAINED REGRESSION ( HDCR ) . We could use presented lower bound as in TRPO , but instead , we derive an offline regression algorithm by introducing the following optimization problem where µ is the sampling policy : arg max π ∫ ρµ ( s ) ∫ π ( a|s ) Aµ ( s , a ) da ds s.t . ∫ ρµ ( s ) H ( π ( ·|s ) ||µ ( ·|s ) ) ds ≤ , ∫ π ( a|s ) da = 1 , ∀s ∈ S. ( 12 ) Constructing Lagrangian , differentiating it with respect to π , and solving for π gives us the following optimal policy ( see Appendix B for derivation ) : π∗ ( a|s ) = µ ( a|s ) β 2 ( β − 2Aµ ( s , a ) ) 2 , where β is a Lagrangian multiplier . ( 13 ) Constructing a regression problem of KL divergence between optimal policy π∗ and current policy π and simplifying gives us the following supervised regression problem ( see Appendix B for derivation ) : arg max π Es∼ρµ ( · ) Ea∼µ ( ·|s ) log π ( a|s ) 1 ( β −Aµ ( s , a ) ) 2 ( 14 ) Using notation of ABM paper ( Siegel et al. , 2020 ) ” advantage-weighting ” function is f ( A ( s , a ) ) = 1 ( β−A ( s , a ) ) 2 . If we use HDCR with Experience Replay , in equation 14 , we replace µ ( ·|s ) in expectation Ea ∼ µ ( · | s ) and advantage function Aµ ( s , a ) . Let Π = { πi , πi+1 , ... , πi+N } be a set of sampling policies from which actions were sampled , w ( πi ) probability of selecting policy πi , then : µ ( s , a ) = ∫ Π w ( π ) ρπ ( s ) π ( a|s ) dπ Aµ ( s , a ) = ∫ Π w ( π ) ρπ ( s ) ( Qπ ( s , a ) − Vπ ( s ) ) dπ∫ Π w ( π ) ρπ ( s ) dπ V ( s ) = ∫ Π w ( π ) ρπ ( s ) Vπ ( s ) dπ∫ Π w ( π ) ρπ ( s ) dπ ( 15 ) The proof will repeat the proof for AWR with Experience Replay ( Peng et al. , 2019 ) . Practically we simply sample uniformly from the replay buffer and using a value function estimator . This type of sampling provides us an approximation of expectation and state value function . Let D denote a set of stored trajectories ( replay buffer ) , A ( s , a ; φ ) is an advantage function parameterized by vector φ . The most popular method to obtain A ( s , a ; φ ) for offline learning is to use state-action function estimator Q ( s , a ; φ ) parameterized by φ : A ( s , a ; φ ) = Q ( s , a ; φ ) − ∫ π ( a′|s ; θk ) Q ( s , a′ ; φk ) da′ ( 16 ) Despite Q ( s , a ; φ ) being closer to the expectation of discounted return following policy π ( because of ” taking ” the first action according to π rather then µ ) , we found Monte-Carlo return more efficient on tiny offline datasets . Greater performance using MC return can be explained by a lack of experience ” produced ” by certain actions . Monte-Carlo estimation of A ( s , a ; φ ) can be described as follows where RDst , at = ∑T l=0 γ lrt+l and V ( s ; φ ) is a state value function estimator parameterized by vector φ : A ( s , a ; φ ) = RDs , a − V ( s ; φ ) ( 17 ) Also , we can use Generalized Advantage Estimation ( Schulman et al. , 2016 ) , where γ ∈ [ 0 , 1 ] and δφkt is a one-step temporal difference for state st calculated using old vector φk : δφkt = rt + γV ( st+1 ; φk ) − V ( st ; φk ) Â ( st , at ; φk ) = T∑ l=0 ( γλ ) lδφkt+l A ( st , at ; φ ) = Â ( st , at ; φk ) + V ( st ; φk ) − V ( st ; φ ) ( 18 ) Finally , we propose the following reinforcement learning algorithm : Algorithm 1 : Hellinger Distance Constrained Regression θ1 ← random initial weights D ← ∅ for iteration k = 1 , ... , kmax do add trajectories { τi } sampled via πθk to D φk+1 ← arg minφ Es , a∼DA2 ( s , a ; φ ) θk+1 ← arg maxθ Es , a∼D [ log πθ ( a|s ) 1 ( β−A ( s , a ; φk ) ) 2 ] end | The authors propose the use of the Hellinger distance instead of KL divergence to constrain new policies to remain close to the behavior policy. The technical aspects are straightforward, noting that Hellinger provides tighter bounds on total variation than KL, and can straightforwardly be plugged into the CPI/TRPO bounds for policy improvement. They also propose an offline reinforcement learning algorithm based on enforcing a Hellinger constraint to the data policy, deriving iterative optimization procedure, and evaluate it on offline | SP:ef7e83384f580d3bc6ad5104d87f7f42fb8bd5c6 |
Hellinger Distance Constrained Regression | 1 INTRODUCTION . Policy gradient algorithms are methods of model-free reinforcement learning that optimize policy through differentiating expected discounted return . Despite the simplicity , to converge , these methods should stay on-policy because of the first-order approximation of state visitation frequencies . This issue makes agents learn through trial-and-error , using data only once . To make policy gradient updates more off-policy , we can add a constraint on the update to decrease the step size if the current policy is too far from the sampling policy . One of the first methods was to add total variation distance squared as a constraint for mixture policies . Later it was proven that there is a lower bound for new policy ’ s expected discounted return ( Kakade & Langford , 2002 ) . Recently it was proven that this lower bound exists for all types of updates ( Schulman et al. , 2015 ) . Next , total variation distance squared was replaced by Kullback-Leibler divergence that is greater than or equal to the previous one ( Pinker ’ s inequality ( Levin & Peres , 2017 ) ) , so that the lower bound was decreased ( Schulman et al. , 2015 ) . Using Lagrangian , have been derived off-policy method called Advantage-Weighted Regression ( Peng et al. , 2019 ) , which also used KL as a constraint . This article proposes a new method whose lower bound of expected discounted return is greater than or equal to the bound with KL . We achieve this by replacing total variation distance by Hellinger distance , which decreases lower bound . Therefore strictness stays the same . Then we derive an offpolicy method called Hellinger Distance Constrained Regression using the new constraint . It can be used on discrete and continuous action spaces since derivation uses Lebesgue integrals rather than a summation or Riemann integrals . 2 PRELIMINARIES . To better present the problem , we start from basic definitions , go through the history of improvements , and then describe the disadvantages of using KL divergence as a constraint . We consider an infinite-horizon discounted Markov decision process ( MDP ) , defined by the tuple ( S , A , P , r , ρ0 , γ ) , where S is a set of states ( finite or infinite ) , A is a set of actions ( finite or infinite ) , P : S × A × S → R is the transition probability distribution , r : S → R is the reward function , ρ0 : S → R is the distribution of the initial state s0 , and γ ∈ ( 0 , 1 ) is the discount factor . Let π denote a stochastic policy π : S × A → [ 0 , 1 ] , and then its expected discounted return is : η ( π ) = Es0 , a0 , ... [ ∞∑ t=0 γtr ( st ) ] , where s0 ∼ ρ0 ( · ) , at ∼ π ( ·|st ) , st+1 ∼ P ( ·|st , at ) . ( 1 ) This paper uses state-action value function Qπ , state value function Vπ , and advantage function Aπ with the following definitions : Qπ ( st , at ) = Est+1 , at+1 , ... [ ∞∑ l=0 γlr ( st+l ) ] Vπ ( st ) = Eat , st+1 , at+1 , ... [ ∞∑ l=0 γlr ( st+l ) ] Aπ ( st , at ) = Qπ ( st , at ) − Vπ ( st ) . ( 2 ) Let ρπ ( s ) be unnormalized visitation frequencies of state s where actions are chosen according to π : ρπ ( s ) = ∞∑ t=0 γtP ( st = s ) . ( 3 ) Following identity expresses the expected return of another policy π̃ in terms of the advantage over π , accumulated over states ( see Schulman et al . ( 2015 ) for proof ) : η ( π̃ ) = η ( π ) + ∫ ρπ̃ ( s ) ∫ π̃ ( a|s ) Aπ ( s , a ) da ds . ( 4 ) In approximately optimal learning , we replace state visitation frequency ρπ̃ by ρπ , since this drastically decrease optimization complexity : Lπ ( π̃ ) = η ( π ) + ∫ ρπ ( s ) ∫ π̃ ( a|s ) Aπ ( s , a ) da ds . ( 5 ) Let πold denote current policy , then the lower bound for the expected discounted return for the new policy πnew will be ( see Schulman et al . ( 2015 ) for proof ) : η ( πnew ) ≥ Lπold ( πnew ) − 4 γ ( 1− γ ) 2 α2 where = max s , a |Aπ ( s , a ) | , α = max s DTV ( πold ( ·|s ) ||πnew ( ·|s ) ) , DTV ( πold ( ·|s ) ||πnew ( ·|s ) ) = 1 2 ∫ |πold ( a|s ) − πnew ( a|s ) | da . ( 6 ) Theoretical Trust-Region Policy Optimization algorithm relays on Pinsker ’ s inequality ( see ( Tsybakov , 2009 ) for proof ) : DKL ( πold ( ·|s ) ||πnew ( ·|s ) ) ≥ DTV ( πold ( ·|s ) ||πnew ( ·|s ) ) 2 where DKL ( πold ( ·|s ) ||πnew ( ·|s ) ) = ∫ πold ( a|s ) log πold ( a|s ) πnew ( a|s ) da . ( 7 ) To retain strictness and decrease calculation complexity , total variation distance squared was replaced with Kullback-Leibler divergence DKL ( πold ( ·|s ) ||πnew ( ·|s ) ) : η ( πnew ) ≥ Lπold ( πnew ) − CDmaxKL ( πold||πnew ) where = max s , a |Aπ ( s , a ) | , C = 4 γ ( 1− γ ) 2 , DmaxKL ( πold||πnew ) = max s DKL ( πold ( ·|s ) ||πnew ( ·|s ) ) . ( 8 ) However , this replacement greatly decreases the lower bound for the expected discounted return for the new policy . Moreover , Kullback-Leibler divergence has no upper bound . Therefore we have no policy-independent lower bound for this type of update . 3 HELLINGER DISTANCE IN POLICY OPTIMIZATION . We can improve lower bound ( compared to KL ) by replacing DTV ( πold ( · | s ) || πnew ( · | s ) ) with Hellinger distance H ( πold ( ·|s ) || πnew ( · | s ) ) : H ( πold ( ·|s ) || πnew ( ·|s ) ) 2 = 1− ∫ √ πold ( a|s ) πnew ( a|s ) da ( 9 ) Theorem 1 ( see Appendix A or ( Tsybakov , 2009 , section 2.4 ) for proof ) proves correctness and improvement ( compared to KL ) to the lower bound . Let p ( v ) and q ( v ) be two probability density functions then : DTV ( p ( · ) || q ( · ) ) 2 ≤ 2H ( p ( · ) || q ( · ) ) 2 ≤ DKL ( p ( · ) || q ( · ) ) ( 10 ) Replacing p ( v ) and q ( v ) with πold ( · | s ) and πnew ( · | s ) respectively , new lower bound follows : η ( πnew ) ≥ Lπold ( πnew ) − 8 γ ( 1− γ ) 2 α2 where = max s , a |Aπ ( s , a ) | , α = max s H ( πold ( ·|s ) ||πnew ( ·|s ) ) ( 11 ) It is worth to note that H ( πold ( · | s ) || πnew ( · | s ) ) ≤ 1 . 4 HELLINGER DISTANCE CONSTRAINED REGRESSION ( HDCR ) . We could use presented lower bound as in TRPO , but instead , we derive an offline regression algorithm by introducing the following optimization problem where µ is the sampling policy : arg max π ∫ ρµ ( s ) ∫ π ( a|s ) Aµ ( s , a ) da ds s.t . ∫ ρµ ( s ) H ( π ( ·|s ) ||µ ( ·|s ) ) ds ≤ , ∫ π ( a|s ) da = 1 , ∀s ∈ S. ( 12 ) Constructing Lagrangian , differentiating it with respect to π , and solving for π gives us the following optimal policy ( see Appendix B for derivation ) : π∗ ( a|s ) = µ ( a|s ) β 2 ( β − 2Aµ ( s , a ) ) 2 , where β is a Lagrangian multiplier . ( 13 ) Constructing a regression problem of KL divergence between optimal policy π∗ and current policy π and simplifying gives us the following supervised regression problem ( see Appendix B for derivation ) : arg max π Es∼ρµ ( · ) Ea∼µ ( ·|s ) log π ( a|s ) 1 ( β −Aµ ( s , a ) ) 2 ( 14 ) Using notation of ABM paper ( Siegel et al. , 2020 ) ” advantage-weighting ” function is f ( A ( s , a ) ) = 1 ( β−A ( s , a ) ) 2 . If we use HDCR with Experience Replay , in equation 14 , we replace µ ( ·|s ) in expectation Ea ∼ µ ( · | s ) and advantage function Aµ ( s , a ) . Let Π = { πi , πi+1 , ... , πi+N } be a set of sampling policies from which actions were sampled , w ( πi ) probability of selecting policy πi , then : µ ( s , a ) = ∫ Π w ( π ) ρπ ( s ) π ( a|s ) dπ Aµ ( s , a ) = ∫ Π w ( π ) ρπ ( s ) ( Qπ ( s , a ) − Vπ ( s ) ) dπ∫ Π w ( π ) ρπ ( s ) dπ V ( s ) = ∫ Π w ( π ) ρπ ( s ) Vπ ( s ) dπ∫ Π w ( π ) ρπ ( s ) dπ ( 15 ) The proof will repeat the proof for AWR with Experience Replay ( Peng et al. , 2019 ) . Practically we simply sample uniformly from the replay buffer and using a value function estimator . This type of sampling provides us an approximation of expectation and state value function . Let D denote a set of stored trajectories ( replay buffer ) , A ( s , a ; φ ) is an advantage function parameterized by vector φ . The most popular method to obtain A ( s , a ; φ ) for offline learning is to use state-action function estimator Q ( s , a ; φ ) parameterized by φ : A ( s , a ; φ ) = Q ( s , a ; φ ) − ∫ π ( a′|s ; θk ) Q ( s , a′ ; φk ) da′ ( 16 ) Despite Q ( s , a ; φ ) being closer to the expectation of discounted return following policy π ( because of ” taking ” the first action according to π rather then µ ) , we found Monte-Carlo return more efficient on tiny offline datasets . Greater performance using MC return can be explained by a lack of experience ” produced ” by certain actions . Monte-Carlo estimation of A ( s , a ; φ ) can be described as follows where RDst , at = ∑T l=0 γ lrt+l and V ( s ; φ ) is a state value function estimator parameterized by vector φ : A ( s , a ; φ ) = RDs , a − V ( s ; φ ) ( 17 ) Also , we can use Generalized Advantage Estimation ( Schulman et al. , 2016 ) , where γ ∈ [ 0 , 1 ] and δφkt is a one-step temporal difference for state st calculated using old vector φk : δφkt = rt + γV ( st+1 ; φk ) − V ( st ; φk ) Â ( st , at ; φk ) = T∑ l=0 ( γλ ) lδφkt+l A ( st , at ; φ ) = Â ( st , at ; φk ) + V ( st ; φk ) − V ( st ; φ ) ( 18 ) Finally , we propose the following reinforcement learning algorithm : Algorithm 1 : Hellinger Distance Constrained Regression θ1 ← random initial weights D ← ∅ for iteration k = 1 , ... , kmax do add trajectories { τi } sampled via πθk to D φk+1 ← arg minφ Es , a∼DA2 ( s , a ; φ ) θk+1 ← arg maxθ Es , a∼D [ log πθ ( a|s ) 1 ( β−A ( s , a ; φk ) ) 2 ] end | The paper provides a new metric - Hellinger distance to be combined with trust region ideas in policy optimization. The major difference from prior work is the change of this distance metric. The paper shows that with this distance metric, along with Lagrangian relaxation, one could show analytic results of improved policies. The paper also shows similar lower bound improvement results and compared with baselines on offline rl tasks. | SP:ef7e83384f580d3bc6ad5104d87f7f42fb8bd5c6 |
Differentiable Segmentation of Sequences | 1 INTRODUCTION . Non-stationarity is a classical challenge in the analysis of sequential data . A common source of non-stationarity is the presence of change points , where the data-generating process switches its dynamics from one regime to another regime . In some applications , the detection of change points is of primary interest , since they may indicate important events in the data ( Page , 1954 ; Box & Tiao , 1965 ; Basseville & Nikiforov , 1986 ; Matteson & James , 2014 ; Li et al. , 2015 ; Arlot et al. , 2019 ; Scharwächter & Müller , 2020 ) . Other applications require models for the dynamics within each segment , which may yield more insights into the phenomenon under study and enable predictions . A plethora of segmented models for regression analysis ( McGee & Carleton , 1970 ; Hawkins , 1976 ; Lerman , 1980 ; Bai & Perron , 2003 ; Muggeo , 2003 ; Acharya et al. , 2016 ) and time series analysis ( Hamilton , 1990 ; Davis et al. , 2006 ; Aue & Horváth , 2013 ; Ding et al. , 2016 ) have been proposed in the literature , where the segmentation materializes either in the data dimensions or the index set . We adhere to the latter approach and consider models of the following form . Let x = ( x1 , ... , xT ) be a sequence of T observations , and let z = ( z1 , ... , zT ) be an additional sequence of covariates used to predict these observations . Observations and covariates may be scalars or vector-valued . We refer to the index t = 1 , ... , T as the time of observation . The data-generating process ( DGP ) of x given z is time-varying and follows a segmented model with K T segments on the time axis . Let τk denote the beginning of segment k. We assume that xt | zt iid∼ fDGP ( zt , θk ) , if τk ≤ t < τk+1 , ( 1 ) ∗corresponding author , e-mail : erik.scharwaechter @ cs.tu-dortmund.de where the DGP in segment k is parametrized by θk . This scenario is typically studied for change point detection ( Truong et al. , 2020 ; van den Burg & Williams , 2020 ) and modeling of non-stationary time series ( Guralnik & Srivastava , 1999 ; Cai , 1994 ; Kohlmorgen & Lemm , 2001 ; Davis et al. , 2006 ; Robinson & Hartemink , 2008 ; Saeedi et al. , 2016 ) , but also captures classification models with concept drift ( Gama et al. , 2013 ) . and segmented generalized linear models ( Muggeo , 2003 ) We express the segmentation of the time axis by a segmentation function ζ : { 1 , ... , T } −→ { 1 , ... , K } that maps each time point t to a segment identifier k. The segmentation function is monotonically increasing with boundary constraints ζ ( 1 ) = 1 and ζ ( T ) = K. We denote all segment-wise parameters by θ = ( θ1 , ... , θK ) . The ultimate goal is to find a segmentation ζ as well as segment-wise parameters θ that minimize a loss function L ( ζ , θ ) , for example , the negative log-likelihood of the observations x . Existing approaches exploit the fact that model estimation within a segment is often straightforward when the segmentation is known . These approaches decouple the search for an optimal segmentation ζ algorithmically from the estimation of the segment-wise parameters θ : min ζ , θ L ( ζ , θ ) = min ζ min θ L ( ζ , θ ) . ( 2 ) Various algorithmic search strategies have been explored for the outer minimization of ζ , including grid search ( Lerman , 1980 ) , dynamic programming ( Hawkins , 1976 ; Bai & Perron , 2003 ) , hierarchical clustering ( McGee & Carleton , 1970 ) and other greedy algorithms ( Acharya et al. , 2016 ) , some of which come with provable optimality guarantees . These algorithms are often tailored to a specific class of models like piecewise linear regression , and do not generalize beyond . Moreover , the use of non-standard optimization techniques in the outer minimization hinders the integration of such models with deep learning architectures , which usually perform joint optimization of all model parameters with gradient descent . In this work , we provide a continuous and differentiable relaxation of the segmented model from Equation 1 that allows joint optimization of all model parameters , including the segmentation function , using state-of-the-art gradient descent algorithms . Our formulation is inspired by the learnable warping functions proposed recently for sequence alignment ( Lohit et al. , 2019 ; Weber et al. , 2019 ) . In a nutshell , we replace the hard segmentation function ζ with a soft warping function γ . An optimal segmentation can be found by optimizing the parameters of the warping function . We propose a novel class of piecewise-constant warping functions based on the two-sided power ( TSP ) distribution ( Van Dorp & Kotz , 2002 ; Kotz & van Dorp , 2004 ) that can represent segmentation functions exactly . TSP-based warping functions are differentiable , have simple closed-form expressions that allow fast evaluation , and their parameters have a one-to-one correspondence with segment boundaries . Source codes for the model and all experiments can be found in the online supplementary material at https : //github.com/diozaka/diffseg . 2 RELAXED SEGMENTED MODELS . We relax the model definition from Equation 1 in the following way . We assume that xt | zt iid∼ fDGP ( zt , θ̂t ) , ( 3 ) where we substitute the actual parameter θk of the DGP at time step t in segment k by the predictor θ̂t . The predictor θ̂t is a weighted sum over the individual segment parameters θ̂t : = ∑ k ŵktθk ( 4 ) with weights ŵkt ∈ [ 0 , 1 ] such that ∑ k ŵkt = 1 for all t. The weights can be viewed as the entries of a ( soft ) alignment matrix that aligns every time step t to a segment identifier k. Given a ( hard ) segmentation function ζ , we can construct a ( hard ) alignment matrix by setting ŵkt = 1 if and only if ζ ( t ) = k. In our relaxed model , we employ a continuous predictor ζ̂t ∈ [ 1 , K ] for the value of the segmentation function ζ ( t ) and let the weight ŵkt depend on the difference between ζ̂t and k : ŵkt : = max ( 0 , 1− ∣∣∣ζ̂t − k∣∣∣ ) ( 5 ) The smaller the difference , the closer the alignment weight ŵkt will be to 1 . If k ≤ ζ̂t ≤ k + 1 , this choice of weights leads to a linear interpolation of the parameters θk and θk+1 in Equation 4 . Higher-order interpolations can be achieved by adapting the weight function accordingly . The key question is how to effectively parametrize the continuous predictors ζ̂t for the segmentation function . For this purpose , we observe that the continuous analogue of a monotonically increasing segmentation function is a warping function ( Ramsay & Li , 1998 ) . Warping functions describe monotonic alignments between closed continuous intervals . Formally , the function γ : [ 0 , 1 ] −→ [ 0 , 1 ] is a warping function if it is monotonically increasing and satisfies the boundary constraints γ ( 0 ) = 0 and γ ( 1 ) = 1 . Any warping function γ can be transformed into a continuous predictor ζ̂t by evaluating γ at T evenly-spaced grid points on the unit interval [ 0 , 1 ] and rescaling the result to the domain [ 1 , K ] . Let ut = ( t− 1 ) / ( T − 1 ) for t = 1 , ... , T be a unit grid . We define ζ̂t : = 1 + γ ( ut ) · ( K − 1 ) . ( 6 ) Similar transformations of warping functions have recently been applied for time series alignment with neural networks ( Weber et al. , 2019 ) . An example segmentation function and predictors based on several warping functions are visualized in Figure 1 . With the transformation from Equation 6 , our relaxed segmented model is parametrized by the segment parameters θ and the parameters of the warping function γ that approximates the segmentation . The discrete-continuous optimization problem from Equation 2 has changed to a continuous optimization problem that is amenable to gradient-based learning : min γ , θ L ( γ , θ ) . ( 7 ) Figure 1 illustrates that the ideal warping function for segmentation is piecewise constant—a formal argument is provided in Appendix A . Several families of warping functions have been proposed in the literature and can be employed within our model ( Aikawa , 1991 ; Ramsay & Li , 1998 ; Gervini & Gasser , 2004 ; Gaffney & Smyth , 2004 ; Claeskens et al. , 2010 ; Freifeld et al. , 2015 ; Detlefsen et al. , 2018 ; Weber et al. , 2019 ; Kurtek et al. , 2011 ; Lohit et al. , 2019 ) . However , none of them contains piecewise-constant functions , and many of them are more expressive than necessary for the segmentation task . Below , we define a novel family of piecewise-constant warping functions that is tailored specifically for the segmentation task , with only one parameter per change point . 3 TSP-BASED WARPING FUNCTIONS . Warping functions are similar to cumulative distribution functions ( cdfs ) for random variables ( Lohit et al. , 2019 ) . Cdfs are monotonically increasing , right-continuous , and normalized over their domain ( Wasserman , 2004 ) . If their support is bounded to [ 0 , 1 ] , they satisfy the same boundary constraints as warping functions . Therefore , we can exploit the vast literature on statistical distributions to define and characterize families of warping functions . Our family of warping functions is based on the two-sided power ( TSP ) distribution ( Van Dorp & Kotz , 2002 ; Kotz & van Dorp , 2004 ) . 3.1 BACKGROUND : TWO-SIDED POWER DISTRIBUTION . The TSP distribution has been proposed recently to model continuous random variables with bounded support [ a , b ] ⊂ R. It generalizes the triangular distribution and can be viewed as a peaked alternative to the beta distribution ( Johnson et al. , 1994 ) . In its most illustrative form , its probability density function ( pdf ) is unimodal with power-law decay on both sides , but it can yield U-shaped and J-shaped pdfs as well , depending on the parametrization . Formally , the pdf is given by fTSP ( u ; a , m , b , n ) = n b−a ( u−a m−a ) n−1 , for a < u ≤ m n b−a ( b−u b−m ) n−1 , for m ≤ u < b 0 , elsewhere , ( 8 ) with a ≤ m ≤ b. a and b define the boundaries of the support , m is the mode ( anti-mode ) of the distribution , and n > 0 is the power parameter that tapers the distribution . The triangular distribution is the special case with n = 2 . In the following , we restrict our attention to the unimodal regime with a < m < b and n > 1 . In this case , the cdf is given by FTSP ( u ; a , m , b , n ) = 0 , for u ≤ a m−a b−a ( u−a m−a ) n , for a ≤ u ≤ m 1− b−mb−a ( b−u b−m ) n , for m ≤ u ≤ b 1 , for b ≤ u . ( 9 ) For convenience , we introduce a three-parameter variant of the TSP distribution with support restricted to subintervals of [ 0 , 1 ] located around the mode . It is fully specified by the mode m ∈ ( 0 , 1 ) , the width w ∈ ( 0 , 1 ] of the subinterval , and the power n > 1 . Depending on the mode and the width , the distribution is symmetric or asymmetric . Illustrations of the pdf and cdf of the three-parameter TSP distribution for various parametrizations can be found in Figure 2 . We denote the three-parameter TSP distribution as TSP ( m , w , n ) and write fTSP ( u ; m , w , n ) and FTSP ( u ; m , w , n ) for its pdf and cdf , respectively . The original parameters a and b are obtained from m and w via a = max ( 0 , min ( 1− w , m− w 2 ) ) , ( 10 ) b = min ( 1 , a+ w ) , ( 11 ) and yield a unimodal regime . Intuitively , the three-parameter TSP distribution describes a symmetric two-sided power kernel of window size w that is located at m and becomes asymmetric only if a symmetric window would exceed the domain [ 0 , 1 ] . An advantage of the TSP distribution over the beta distribution is that its pdf and cdf have closed form expressions that are easy to evaluate computationally . Moreover , they are differentiable almost everywhere with respect to all parameters . | The paper describes the use of two-sided power functions for differentiable approximation of segmentation in discrete sequences with monotonic segmentation (each event in the sequence is defined by one continuous interval). The authors show that their particular parametrization allows to control exactly the length, starting, and ending point of the interval, and the slope of change (Fig. 2). | SP:99a4cd5e5df612e8319b5abd1162696a2f7453fd |
Differentiable Segmentation of Sequences | 1 INTRODUCTION . Non-stationarity is a classical challenge in the analysis of sequential data . A common source of non-stationarity is the presence of change points , where the data-generating process switches its dynamics from one regime to another regime . In some applications , the detection of change points is of primary interest , since they may indicate important events in the data ( Page , 1954 ; Box & Tiao , 1965 ; Basseville & Nikiforov , 1986 ; Matteson & James , 2014 ; Li et al. , 2015 ; Arlot et al. , 2019 ; Scharwächter & Müller , 2020 ) . Other applications require models for the dynamics within each segment , which may yield more insights into the phenomenon under study and enable predictions . A plethora of segmented models for regression analysis ( McGee & Carleton , 1970 ; Hawkins , 1976 ; Lerman , 1980 ; Bai & Perron , 2003 ; Muggeo , 2003 ; Acharya et al. , 2016 ) and time series analysis ( Hamilton , 1990 ; Davis et al. , 2006 ; Aue & Horváth , 2013 ; Ding et al. , 2016 ) have been proposed in the literature , where the segmentation materializes either in the data dimensions or the index set . We adhere to the latter approach and consider models of the following form . Let x = ( x1 , ... , xT ) be a sequence of T observations , and let z = ( z1 , ... , zT ) be an additional sequence of covariates used to predict these observations . Observations and covariates may be scalars or vector-valued . We refer to the index t = 1 , ... , T as the time of observation . The data-generating process ( DGP ) of x given z is time-varying and follows a segmented model with K T segments on the time axis . Let τk denote the beginning of segment k. We assume that xt | zt iid∼ fDGP ( zt , θk ) , if τk ≤ t < τk+1 , ( 1 ) ∗corresponding author , e-mail : erik.scharwaechter @ cs.tu-dortmund.de where the DGP in segment k is parametrized by θk . This scenario is typically studied for change point detection ( Truong et al. , 2020 ; van den Burg & Williams , 2020 ) and modeling of non-stationary time series ( Guralnik & Srivastava , 1999 ; Cai , 1994 ; Kohlmorgen & Lemm , 2001 ; Davis et al. , 2006 ; Robinson & Hartemink , 2008 ; Saeedi et al. , 2016 ) , but also captures classification models with concept drift ( Gama et al. , 2013 ) . and segmented generalized linear models ( Muggeo , 2003 ) We express the segmentation of the time axis by a segmentation function ζ : { 1 , ... , T } −→ { 1 , ... , K } that maps each time point t to a segment identifier k. The segmentation function is monotonically increasing with boundary constraints ζ ( 1 ) = 1 and ζ ( T ) = K. We denote all segment-wise parameters by θ = ( θ1 , ... , θK ) . The ultimate goal is to find a segmentation ζ as well as segment-wise parameters θ that minimize a loss function L ( ζ , θ ) , for example , the negative log-likelihood of the observations x . Existing approaches exploit the fact that model estimation within a segment is often straightforward when the segmentation is known . These approaches decouple the search for an optimal segmentation ζ algorithmically from the estimation of the segment-wise parameters θ : min ζ , θ L ( ζ , θ ) = min ζ min θ L ( ζ , θ ) . ( 2 ) Various algorithmic search strategies have been explored for the outer minimization of ζ , including grid search ( Lerman , 1980 ) , dynamic programming ( Hawkins , 1976 ; Bai & Perron , 2003 ) , hierarchical clustering ( McGee & Carleton , 1970 ) and other greedy algorithms ( Acharya et al. , 2016 ) , some of which come with provable optimality guarantees . These algorithms are often tailored to a specific class of models like piecewise linear regression , and do not generalize beyond . Moreover , the use of non-standard optimization techniques in the outer minimization hinders the integration of such models with deep learning architectures , which usually perform joint optimization of all model parameters with gradient descent . In this work , we provide a continuous and differentiable relaxation of the segmented model from Equation 1 that allows joint optimization of all model parameters , including the segmentation function , using state-of-the-art gradient descent algorithms . Our formulation is inspired by the learnable warping functions proposed recently for sequence alignment ( Lohit et al. , 2019 ; Weber et al. , 2019 ) . In a nutshell , we replace the hard segmentation function ζ with a soft warping function γ . An optimal segmentation can be found by optimizing the parameters of the warping function . We propose a novel class of piecewise-constant warping functions based on the two-sided power ( TSP ) distribution ( Van Dorp & Kotz , 2002 ; Kotz & van Dorp , 2004 ) that can represent segmentation functions exactly . TSP-based warping functions are differentiable , have simple closed-form expressions that allow fast evaluation , and their parameters have a one-to-one correspondence with segment boundaries . Source codes for the model and all experiments can be found in the online supplementary material at https : //github.com/diozaka/diffseg . 2 RELAXED SEGMENTED MODELS . We relax the model definition from Equation 1 in the following way . We assume that xt | zt iid∼ fDGP ( zt , θ̂t ) , ( 3 ) where we substitute the actual parameter θk of the DGP at time step t in segment k by the predictor θ̂t . The predictor θ̂t is a weighted sum over the individual segment parameters θ̂t : = ∑ k ŵktθk ( 4 ) with weights ŵkt ∈ [ 0 , 1 ] such that ∑ k ŵkt = 1 for all t. The weights can be viewed as the entries of a ( soft ) alignment matrix that aligns every time step t to a segment identifier k. Given a ( hard ) segmentation function ζ , we can construct a ( hard ) alignment matrix by setting ŵkt = 1 if and only if ζ ( t ) = k. In our relaxed model , we employ a continuous predictor ζ̂t ∈ [ 1 , K ] for the value of the segmentation function ζ ( t ) and let the weight ŵkt depend on the difference between ζ̂t and k : ŵkt : = max ( 0 , 1− ∣∣∣ζ̂t − k∣∣∣ ) ( 5 ) The smaller the difference , the closer the alignment weight ŵkt will be to 1 . If k ≤ ζ̂t ≤ k + 1 , this choice of weights leads to a linear interpolation of the parameters θk and θk+1 in Equation 4 . Higher-order interpolations can be achieved by adapting the weight function accordingly . The key question is how to effectively parametrize the continuous predictors ζ̂t for the segmentation function . For this purpose , we observe that the continuous analogue of a monotonically increasing segmentation function is a warping function ( Ramsay & Li , 1998 ) . Warping functions describe monotonic alignments between closed continuous intervals . Formally , the function γ : [ 0 , 1 ] −→ [ 0 , 1 ] is a warping function if it is monotonically increasing and satisfies the boundary constraints γ ( 0 ) = 0 and γ ( 1 ) = 1 . Any warping function γ can be transformed into a continuous predictor ζ̂t by evaluating γ at T evenly-spaced grid points on the unit interval [ 0 , 1 ] and rescaling the result to the domain [ 1 , K ] . Let ut = ( t− 1 ) / ( T − 1 ) for t = 1 , ... , T be a unit grid . We define ζ̂t : = 1 + γ ( ut ) · ( K − 1 ) . ( 6 ) Similar transformations of warping functions have recently been applied for time series alignment with neural networks ( Weber et al. , 2019 ) . An example segmentation function and predictors based on several warping functions are visualized in Figure 1 . With the transformation from Equation 6 , our relaxed segmented model is parametrized by the segment parameters θ and the parameters of the warping function γ that approximates the segmentation . The discrete-continuous optimization problem from Equation 2 has changed to a continuous optimization problem that is amenable to gradient-based learning : min γ , θ L ( γ , θ ) . ( 7 ) Figure 1 illustrates that the ideal warping function for segmentation is piecewise constant—a formal argument is provided in Appendix A . Several families of warping functions have been proposed in the literature and can be employed within our model ( Aikawa , 1991 ; Ramsay & Li , 1998 ; Gervini & Gasser , 2004 ; Gaffney & Smyth , 2004 ; Claeskens et al. , 2010 ; Freifeld et al. , 2015 ; Detlefsen et al. , 2018 ; Weber et al. , 2019 ; Kurtek et al. , 2011 ; Lohit et al. , 2019 ) . However , none of them contains piecewise-constant functions , and many of them are more expressive than necessary for the segmentation task . Below , we define a novel family of piecewise-constant warping functions that is tailored specifically for the segmentation task , with only one parameter per change point . 3 TSP-BASED WARPING FUNCTIONS . Warping functions are similar to cumulative distribution functions ( cdfs ) for random variables ( Lohit et al. , 2019 ) . Cdfs are monotonically increasing , right-continuous , and normalized over their domain ( Wasserman , 2004 ) . If their support is bounded to [ 0 , 1 ] , they satisfy the same boundary constraints as warping functions . Therefore , we can exploit the vast literature on statistical distributions to define and characterize families of warping functions . Our family of warping functions is based on the two-sided power ( TSP ) distribution ( Van Dorp & Kotz , 2002 ; Kotz & van Dorp , 2004 ) . 3.1 BACKGROUND : TWO-SIDED POWER DISTRIBUTION . The TSP distribution has been proposed recently to model continuous random variables with bounded support [ a , b ] ⊂ R. It generalizes the triangular distribution and can be viewed as a peaked alternative to the beta distribution ( Johnson et al. , 1994 ) . In its most illustrative form , its probability density function ( pdf ) is unimodal with power-law decay on both sides , but it can yield U-shaped and J-shaped pdfs as well , depending on the parametrization . Formally , the pdf is given by fTSP ( u ; a , m , b , n ) = n b−a ( u−a m−a ) n−1 , for a < u ≤ m n b−a ( b−u b−m ) n−1 , for m ≤ u < b 0 , elsewhere , ( 8 ) with a ≤ m ≤ b. a and b define the boundaries of the support , m is the mode ( anti-mode ) of the distribution , and n > 0 is the power parameter that tapers the distribution . The triangular distribution is the special case with n = 2 . In the following , we restrict our attention to the unimodal regime with a < m < b and n > 1 . In this case , the cdf is given by FTSP ( u ; a , m , b , n ) = 0 , for u ≤ a m−a b−a ( u−a m−a ) n , for a ≤ u ≤ m 1− b−mb−a ( b−u b−m ) n , for m ≤ u ≤ b 1 , for b ≤ u . ( 9 ) For convenience , we introduce a three-parameter variant of the TSP distribution with support restricted to subintervals of [ 0 , 1 ] located around the mode . It is fully specified by the mode m ∈ ( 0 , 1 ) , the width w ∈ ( 0 , 1 ] of the subinterval , and the power n > 1 . Depending on the mode and the width , the distribution is symmetric or asymmetric . Illustrations of the pdf and cdf of the three-parameter TSP distribution for various parametrizations can be found in Figure 2 . We denote the three-parameter TSP distribution as TSP ( m , w , n ) and write fTSP ( u ; m , w , n ) and FTSP ( u ; m , w , n ) for its pdf and cdf , respectively . The original parameters a and b are obtained from m and w via a = max ( 0 , min ( 1− w , m− w 2 ) ) , ( 10 ) b = min ( 1 , a+ w ) , ( 11 ) and yield a unimodal regime . Intuitively , the three-parameter TSP distribution describes a symmetric two-sided power kernel of window size w that is located at m and becomes asymmetric only if a symmetric window would exceed the domain [ 0 , 1 ] . An advantage of the TSP distribution over the beta distribution is that its pdf and cdf have closed form expressions that are easy to evaluate computationally . Moreover , they are differentiable almost everywhere with respect to all parameters . | The paper proposes a relaxed way to solve the segmentation of sequence that can directly leverage the deep learning architectures. The relaxed model allows each segmentation parameter to be a linear interpolations between two consecutive parameters depends on a continuous warping function. The paper then proposes to use mixture of TSP distribution to simulate a step-like warping function and perform a thorough empirical comparison results with different methods and different warping functions. It turns out that TSP-based methods consistently achieve good performance. | SP:99a4cd5e5df612e8319b5abd1162696a2f7453fd |
Differentiable Segmentation of Sequences | 1 INTRODUCTION . Non-stationarity is a classical challenge in the analysis of sequential data . A common source of non-stationarity is the presence of change points , where the data-generating process switches its dynamics from one regime to another regime . In some applications , the detection of change points is of primary interest , since they may indicate important events in the data ( Page , 1954 ; Box & Tiao , 1965 ; Basseville & Nikiforov , 1986 ; Matteson & James , 2014 ; Li et al. , 2015 ; Arlot et al. , 2019 ; Scharwächter & Müller , 2020 ) . Other applications require models for the dynamics within each segment , which may yield more insights into the phenomenon under study and enable predictions . A plethora of segmented models for regression analysis ( McGee & Carleton , 1970 ; Hawkins , 1976 ; Lerman , 1980 ; Bai & Perron , 2003 ; Muggeo , 2003 ; Acharya et al. , 2016 ) and time series analysis ( Hamilton , 1990 ; Davis et al. , 2006 ; Aue & Horváth , 2013 ; Ding et al. , 2016 ) have been proposed in the literature , where the segmentation materializes either in the data dimensions or the index set . We adhere to the latter approach and consider models of the following form . Let x = ( x1 , ... , xT ) be a sequence of T observations , and let z = ( z1 , ... , zT ) be an additional sequence of covariates used to predict these observations . Observations and covariates may be scalars or vector-valued . We refer to the index t = 1 , ... , T as the time of observation . The data-generating process ( DGP ) of x given z is time-varying and follows a segmented model with K T segments on the time axis . Let τk denote the beginning of segment k. We assume that xt | zt iid∼ fDGP ( zt , θk ) , if τk ≤ t < τk+1 , ( 1 ) ∗corresponding author , e-mail : erik.scharwaechter @ cs.tu-dortmund.de where the DGP in segment k is parametrized by θk . This scenario is typically studied for change point detection ( Truong et al. , 2020 ; van den Burg & Williams , 2020 ) and modeling of non-stationary time series ( Guralnik & Srivastava , 1999 ; Cai , 1994 ; Kohlmorgen & Lemm , 2001 ; Davis et al. , 2006 ; Robinson & Hartemink , 2008 ; Saeedi et al. , 2016 ) , but also captures classification models with concept drift ( Gama et al. , 2013 ) . and segmented generalized linear models ( Muggeo , 2003 ) We express the segmentation of the time axis by a segmentation function ζ : { 1 , ... , T } −→ { 1 , ... , K } that maps each time point t to a segment identifier k. The segmentation function is monotonically increasing with boundary constraints ζ ( 1 ) = 1 and ζ ( T ) = K. We denote all segment-wise parameters by θ = ( θ1 , ... , θK ) . The ultimate goal is to find a segmentation ζ as well as segment-wise parameters θ that minimize a loss function L ( ζ , θ ) , for example , the negative log-likelihood of the observations x . Existing approaches exploit the fact that model estimation within a segment is often straightforward when the segmentation is known . These approaches decouple the search for an optimal segmentation ζ algorithmically from the estimation of the segment-wise parameters θ : min ζ , θ L ( ζ , θ ) = min ζ min θ L ( ζ , θ ) . ( 2 ) Various algorithmic search strategies have been explored for the outer minimization of ζ , including grid search ( Lerman , 1980 ) , dynamic programming ( Hawkins , 1976 ; Bai & Perron , 2003 ) , hierarchical clustering ( McGee & Carleton , 1970 ) and other greedy algorithms ( Acharya et al. , 2016 ) , some of which come with provable optimality guarantees . These algorithms are often tailored to a specific class of models like piecewise linear regression , and do not generalize beyond . Moreover , the use of non-standard optimization techniques in the outer minimization hinders the integration of such models with deep learning architectures , which usually perform joint optimization of all model parameters with gradient descent . In this work , we provide a continuous and differentiable relaxation of the segmented model from Equation 1 that allows joint optimization of all model parameters , including the segmentation function , using state-of-the-art gradient descent algorithms . Our formulation is inspired by the learnable warping functions proposed recently for sequence alignment ( Lohit et al. , 2019 ; Weber et al. , 2019 ) . In a nutshell , we replace the hard segmentation function ζ with a soft warping function γ . An optimal segmentation can be found by optimizing the parameters of the warping function . We propose a novel class of piecewise-constant warping functions based on the two-sided power ( TSP ) distribution ( Van Dorp & Kotz , 2002 ; Kotz & van Dorp , 2004 ) that can represent segmentation functions exactly . TSP-based warping functions are differentiable , have simple closed-form expressions that allow fast evaluation , and their parameters have a one-to-one correspondence with segment boundaries . Source codes for the model and all experiments can be found in the online supplementary material at https : //github.com/diozaka/diffseg . 2 RELAXED SEGMENTED MODELS . We relax the model definition from Equation 1 in the following way . We assume that xt | zt iid∼ fDGP ( zt , θ̂t ) , ( 3 ) where we substitute the actual parameter θk of the DGP at time step t in segment k by the predictor θ̂t . The predictor θ̂t is a weighted sum over the individual segment parameters θ̂t : = ∑ k ŵktθk ( 4 ) with weights ŵkt ∈ [ 0 , 1 ] such that ∑ k ŵkt = 1 for all t. The weights can be viewed as the entries of a ( soft ) alignment matrix that aligns every time step t to a segment identifier k. Given a ( hard ) segmentation function ζ , we can construct a ( hard ) alignment matrix by setting ŵkt = 1 if and only if ζ ( t ) = k. In our relaxed model , we employ a continuous predictor ζ̂t ∈ [ 1 , K ] for the value of the segmentation function ζ ( t ) and let the weight ŵkt depend on the difference between ζ̂t and k : ŵkt : = max ( 0 , 1− ∣∣∣ζ̂t − k∣∣∣ ) ( 5 ) The smaller the difference , the closer the alignment weight ŵkt will be to 1 . If k ≤ ζ̂t ≤ k + 1 , this choice of weights leads to a linear interpolation of the parameters θk and θk+1 in Equation 4 . Higher-order interpolations can be achieved by adapting the weight function accordingly . The key question is how to effectively parametrize the continuous predictors ζ̂t for the segmentation function . For this purpose , we observe that the continuous analogue of a monotonically increasing segmentation function is a warping function ( Ramsay & Li , 1998 ) . Warping functions describe monotonic alignments between closed continuous intervals . Formally , the function γ : [ 0 , 1 ] −→ [ 0 , 1 ] is a warping function if it is monotonically increasing and satisfies the boundary constraints γ ( 0 ) = 0 and γ ( 1 ) = 1 . Any warping function γ can be transformed into a continuous predictor ζ̂t by evaluating γ at T evenly-spaced grid points on the unit interval [ 0 , 1 ] and rescaling the result to the domain [ 1 , K ] . Let ut = ( t− 1 ) / ( T − 1 ) for t = 1 , ... , T be a unit grid . We define ζ̂t : = 1 + γ ( ut ) · ( K − 1 ) . ( 6 ) Similar transformations of warping functions have recently been applied for time series alignment with neural networks ( Weber et al. , 2019 ) . An example segmentation function and predictors based on several warping functions are visualized in Figure 1 . With the transformation from Equation 6 , our relaxed segmented model is parametrized by the segment parameters θ and the parameters of the warping function γ that approximates the segmentation . The discrete-continuous optimization problem from Equation 2 has changed to a continuous optimization problem that is amenable to gradient-based learning : min γ , θ L ( γ , θ ) . ( 7 ) Figure 1 illustrates that the ideal warping function for segmentation is piecewise constant—a formal argument is provided in Appendix A . Several families of warping functions have been proposed in the literature and can be employed within our model ( Aikawa , 1991 ; Ramsay & Li , 1998 ; Gervini & Gasser , 2004 ; Gaffney & Smyth , 2004 ; Claeskens et al. , 2010 ; Freifeld et al. , 2015 ; Detlefsen et al. , 2018 ; Weber et al. , 2019 ; Kurtek et al. , 2011 ; Lohit et al. , 2019 ) . However , none of them contains piecewise-constant functions , and many of them are more expressive than necessary for the segmentation task . Below , we define a novel family of piecewise-constant warping functions that is tailored specifically for the segmentation task , with only one parameter per change point . 3 TSP-BASED WARPING FUNCTIONS . Warping functions are similar to cumulative distribution functions ( cdfs ) for random variables ( Lohit et al. , 2019 ) . Cdfs are monotonically increasing , right-continuous , and normalized over their domain ( Wasserman , 2004 ) . If their support is bounded to [ 0 , 1 ] , they satisfy the same boundary constraints as warping functions . Therefore , we can exploit the vast literature on statistical distributions to define and characterize families of warping functions . Our family of warping functions is based on the two-sided power ( TSP ) distribution ( Van Dorp & Kotz , 2002 ; Kotz & van Dorp , 2004 ) . 3.1 BACKGROUND : TWO-SIDED POWER DISTRIBUTION . The TSP distribution has been proposed recently to model continuous random variables with bounded support [ a , b ] ⊂ R. It generalizes the triangular distribution and can be viewed as a peaked alternative to the beta distribution ( Johnson et al. , 1994 ) . In its most illustrative form , its probability density function ( pdf ) is unimodal with power-law decay on both sides , but it can yield U-shaped and J-shaped pdfs as well , depending on the parametrization . Formally , the pdf is given by fTSP ( u ; a , m , b , n ) = n b−a ( u−a m−a ) n−1 , for a < u ≤ m n b−a ( b−u b−m ) n−1 , for m ≤ u < b 0 , elsewhere , ( 8 ) with a ≤ m ≤ b. a and b define the boundaries of the support , m is the mode ( anti-mode ) of the distribution , and n > 0 is the power parameter that tapers the distribution . The triangular distribution is the special case with n = 2 . In the following , we restrict our attention to the unimodal regime with a < m < b and n > 1 . In this case , the cdf is given by FTSP ( u ; a , m , b , n ) = 0 , for u ≤ a m−a b−a ( u−a m−a ) n , for a ≤ u ≤ m 1− b−mb−a ( b−u b−m ) n , for m ≤ u ≤ b 1 , for b ≤ u . ( 9 ) For convenience , we introduce a three-parameter variant of the TSP distribution with support restricted to subintervals of [ 0 , 1 ] located around the mode . It is fully specified by the mode m ∈ ( 0 , 1 ) , the width w ∈ ( 0 , 1 ] of the subinterval , and the power n > 1 . Depending on the mode and the width , the distribution is symmetric or asymmetric . Illustrations of the pdf and cdf of the three-parameter TSP distribution for various parametrizations can be found in Figure 2 . We denote the three-parameter TSP distribution as TSP ( m , w , n ) and write fTSP ( u ; m , w , n ) and FTSP ( u ; m , w , n ) for its pdf and cdf , respectively . The original parameters a and b are obtained from m and w via a = max ( 0 , min ( 1− w , m− w 2 ) ) , ( 10 ) b = min ( 1 , a+ w ) , ( 11 ) and yield a unimodal regime . Intuitively , the three-parameter TSP distribution describes a symmetric two-sided power kernel of window size w that is located at m and becomes asymmetric only if a symmetric window would exceed the domain [ 0 , 1 ] . An advantage of the TSP distribution over the beta distribution is that its pdf and cdf have closed form expressions that are easy to evaluate computationally . Moreover , they are differentiable almost everywhere with respect to all parameters . | The proposed paper introduces a novel approach for the segmentation of sequences. The proposed method is based on two-sided power distributions (TSP) that are mathematically well-define and enable differentiability. The main goal of the method is to jointly optimize model parameters, including the segmentation function. The method is validated through experiments on modeling the spread of COVID-19 based on Poisson regression, change point detection, a classification model with concept drift (insect stream benchmark), and discrete representation learning (speech signal). | SP:99a4cd5e5df612e8319b5abd1162696a2f7453fd |
Bounded Myopic Adversaries for Deep Reinforcement Learning Agents | Adversarial attacks against deep neural networks have been widely studied . Adversarial examples for deep reinforcement learning ( DeepRL ) have significant security implications , due to the deployment of these algorithms in many application domains . In this work we formalize an optimal myopic adversary for deep reinforcement learning agents . Our adversary attempts to find a bounded perturbation of the state which minimizes the value of the action taken by the agent . We show with experiments in various games in the Atari environment that our attack formulation achieves significantly larger impact as compared to the current state-of-the-art . Furthermore , this enables us to lower the bounds by several orders of magnitude on the perturbation needed to efficiently achieve significant impacts on DeepRL agents . 1 INTRODUCTION . Deep Neural Networks ( DNN ) have become a powerful tool and currently DNNs are widely used in speech recognition ( Hannun et al. , 2014 ) , computer vision ( Krizhevsky et al. , 2012 ) , natural language processing ( Sutskever et al. , 2014 ) , and self learning systems as deep reinforcement learning agents ( Mnih et al . ( 2015 ) , Mnih et al . ( 2016 ) , Schulman et al . ( 2015 ) , Lillicrap et al . ( 2015 ) ) . Along with the overwhelming success of DNNs in various domains there has also been a line of research investigating their weaknesses . Szegedy et al . ( 2014 ) observed that adding imperceptible perturbations to images can lead a DNN to misclassify the input image . The authors argue that the existence of these so called adversarial examples is a form of overfitting . In particular , they hypothesize that a very complicated neural network behaves well on the training set , but nonetheless , performs poorly on the testing set enabling exploitation by the attacker . However , they discovered different DNN models were misclassifying the same adversarial examples and assigning them the same class instead of making random mistakes . This led Goodfellow et al . ( 2015 ) to propose that the DNN models were actually learning approximately linear functions resulting in underfitting the data . Recent work by Mnih et al . ( 2015 ) introduced the use of DNNs as function approximators in reinforcement learning , improving the state of the art in this area . Because these deep reinforcement learning agents utilize DNNs , they are also susceptible to this type of adversarial examples . Currently , deep reinforcement learning has been applied to many areas such as network system control ( Jay et al . ( 2019 ) , Chu et al . ( 2020 ) , Chinchali et al . ( 2018 ) ) , financial trading Noonan ( 2017 ) , blockchain protocol security Hou et al . ( 2019 ) , grid operation and security ( Duan et al . ( 2019 ) , Huang et al . ( 2019 ) ) , cloud computing Chen et al . ( 2018 ) , robotics ( Gu et al . ( 2017 ) , Kalashnikov et al . ( 2018 ) ) , autonomous driving Dosovitsky et al . ( 2017 ) , and medical treatment and diagnosis ( Tseng et al . ( 2017 ) , Popova et al . ( 2018 ) , Thananjeyan et al . ( 2017 ) , Daochang & Jiang ( 2018 ) , Ghesu et al . ( 2017 ) ) . A more particular scenario where adversarial perturbations might be of significant interest is a financial trading market where the DeepRL agent is trained on observations consisting of the order book . In such a setting it is possible to compromise the whole trading system with an extremely small subset of adversaries . In particular , the ` 1-norm bounded perturbations dicussed in our paper have sparse solutions , and thus can be used as a basis for an attack in such a scenario . Moreover , the magnitude of the ` 1-norm bounded perturbations produced by our attack is orders of magnitude smaller than previous approaches , and thus our proposed perturbations result in a stealth attack more likely to evade automatic anomaly detection schemes . Considering the wide spectrum of deep reinforcement learning algorithm deployment it is crucial to investigate the resilience of these algorithms before they are used in real world application domains . Moreover , adversarial formulations are a first step to understand these algorithms and build generalizable , reliable and robust deep reinforcement learning agents . Therefore , in this paper we study adversarial attack formulations for deep reinforcement learning agents and make the following contributions : • We define the optimal myopic adversary , whose aim is to minimize the value of the action taken by the agent in each state , and formulate the optimization problem that this adversary seeks to solve . • We introduce a differentiable approximation for the optimal myopic adversarial formulation . • We compare the impact results of our attack formulation to previous formulations in different games in the Atari environment . • We show that the new formulation finds a better direction for the adversarial perturbation and increases the attack impact for bounded perturbations . ( Conversely , our formulation decreases the magnitude of the pertubation required to efficiently achieve a significant impact . ) 2 RELATED WORK AND BACKGROUND . 2.1 ADVERSARIAL REINFORCEMENT LEARNING . Adversarial reinforcement learning is an active line of research directed towards discovering the weaknesses of deep reinforcement learning algorithms . Gleave et al . ( 2020 ) model the interaction between the agent and the adversary as a two player Markov game and solve the reinforcement learning problem for the adversary via Proximal Policy Optimization introduced by Schulman et al . ( 2017 ) . They fix the victim agent ’ s policy and only allow the adversary to take natural actions to disrupt the agent instead of using ` p-norm bound pixel perturbations . Pinto et al . ( 2017 ) model the adversary and the victim as a two player zero-sum discounted Markov game and train the victim in the presence of the adversary to make the victim more robust . Mandlekar et al . ( 2017 ) use a gradient based perturbation to make the agent more robust as compared to random perturbations . Huang et al . ( 2017 ) and Kos & Song ( 2017 ) use the fast gradient sign method ( FGSM ) to show deep reinforcement learning agents are vulnarable to adversarial perturbations . Pattanaik et al . ( 2018 ) use a gradient based formulation to increase the robustness of deep reinforcement learning agents . 2.2 ADVERSARIAL ATTACK METHODS . Goodfellow et al . ( 2015 ) introduced the fast gradient method ( FGM ) x∗ = x+ · ∇xJ ( x , y ) ||∇xJ ( x , y ) ||p , ( 1 ) for crafting adversarial examples for image classification by taking the gradient of the cost function J ( x , y ) used to train the neural network in the direction of the input . Here x is the input and y is the output label for image classification . As mentioned in the previous section FGM was first adapted to the deep reinforcement learning setting by Huang et al . ( 2017 ) . Subsequently , Pattanaik et al . ( 2018 ) introduced a variant of FGM , in which a few random samples are taken in the gradient direction , and the best is chosen . However , the main difference between the approach of Huang et al . ( 2017 ) and Pattanaik et al . ( 2018 ) is in the choice of the cost function J used to determine the gradient direction . In the next section we will outline the different cost functions used in these two different formulations . 2.3 ADVERSARIAL ATTACK FORMULATIONS . In a bounded attack formulation for deep reinforcement learning , the aim is to try to find a perturbed state sadv in a ball D , p ( s ) = { sadv ∣∣ ‖sadv − s‖p ≤ } , ( 2 ) that minimizes the expected cumulative reward of the agent . It is important to note that the agent will always try to take the best action depending only on its perception of the state , and independent from the unperturbed state . Therefore , in the perturbed state the agent will still choose the action , a∗ ( sadv ) = argmaxaQ ( sadv , a ) , which maximizes the state action value function in state sadv . It has been an active line of research to find the right direction for the adversarial perturbation in the deep reinforcement learning domain . The first attack of this form was formulated by Huang et al . ( 2017 ) and concurrently by Kos & Song ( 2017 ) by trying to minimize the probability of the best possible action in the given state , a∗ ( s ) = argmax a Q ( s , a ) min sadv∈D , p ( s ) π ( sadv , a ∗ ( s ) ) . ( 3 ) Note that π ( s , a ) is the softmax policy of the agent given by πT ( s , a ) = e Q ( s , a ( s ) ) T∑ ak e Q ( s , ak ) T , ( 4 ) where T is called the temperature constant . When the temperature constant is not relevant to the discussion we will drop the subscript and use the notation π ( s , a ) . It is important to note that π ( s , a ) is not the actual policy used by the agent . Indeed the DRL agent deterministically chooses the action a∗ maximizing Q ( s , a ) ( or equivalently π ( s , a ) ) . The softmax operation is only introduced in order to calculate the adversarial perturbation direction . Lin et al . ( 2017 ) formulated another attack with unbounded perturbation based on the Carlini & Wagner ( 2017 ) attack where the goal is to minimize the perturbation subject to choosing any action other than the best . min sadv∈D , p ( s ) ‖sadv − s‖p subject to a∗ ( s ) 6= a∗ ( sadv ) . Pattanaik et al . ( 2018 ) formulated yet another attack which aims to maximize the probability of the worst possible action in the given state , aw ( s ) = argmin a Q ( s , a ) max sadv∈D , p ( s ) π ( sadv , aw ( s ) ) , ( 5 ) and further showed that their attack formulation ( 5 ) is more effective than ( 3 ) . Pattanaik et al . ( 2018 ) also introduce the notion of targeted attacks to the reinforcement learning domain . In their paper they take the cross entropy loss between the optimal policy in the given state and their adversarial probability distribution and try to increase the probability of aw . However , just trying to increase the probability of aw in the softmax policy i.e . π ( sadv , aw ) is not sufficient to target aw in the actual policy followed by the agent . In fact the agent can end up in a state where , π ( sadv , aw ) > π ( s , aw ) aw 6= argmax a π ( sadv , a ) . ( 6 ) Although π ( sadv , aw ) has increased , the action aw will not be taken . However , it might be still possible to find a perturbed state s′adv for which , π ( sadv , aw ) > π ( s ′ adv , aw ) aw = argmax a π ( s′adv , a ) . ( 7 ) Therefore , maximizing the probability of taking the worst possible action in the given state is not actually the right formulation to find the correct direction for adversarial perturbation . | This paper proposes an optimal myopic adversary for deep reinforcement learning agent, in which the adversary finds a bounded perturbation of the state that minimizes the value of the action taken by the agent. The authors introduce a differentiable approximation for the optimal myopic adversarial formulation that leads to a better direction for the adversarial perturbation and increases the attack impact for bounded perturbations. Empirically, the authors show with experiments in various games in the Atari environment that the attack formulation achieves significantly larger impact as compared to the current state-of-the-art. | SP:f9aec02ea7ba21b7840c78f46af8cb6aa504e4ab |
Bounded Myopic Adversaries for Deep Reinforcement Learning Agents | Adversarial attacks against deep neural networks have been widely studied . Adversarial examples for deep reinforcement learning ( DeepRL ) have significant security implications , due to the deployment of these algorithms in many application domains . In this work we formalize an optimal myopic adversary for deep reinforcement learning agents . Our adversary attempts to find a bounded perturbation of the state which minimizes the value of the action taken by the agent . We show with experiments in various games in the Atari environment that our attack formulation achieves significantly larger impact as compared to the current state-of-the-art . Furthermore , this enables us to lower the bounds by several orders of magnitude on the perturbation needed to efficiently achieve significant impacts on DeepRL agents . 1 INTRODUCTION . Deep Neural Networks ( DNN ) have become a powerful tool and currently DNNs are widely used in speech recognition ( Hannun et al. , 2014 ) , computer vision ( Krizhevsky et al. , 2012 ) , natural language processing ( Sutskever et al. , 2014 ) , and self learning systems as deep reinforcement learning agents ( Mnih et al . ( 2015 ) , Mnih et al . ( 2016 ) , Schulman et al . ( 2015 ) , Lillicrap et al . ( 2015 ) ) . Along with the overwhelming success of DNNs in various domains there has also been a line of research investigating their weaknesses . Szegedy et al . ( 2014 ) observed that adding imperceptible perturbations to images can lead a DNN to misclassify the input image . The authors argue that the existence of these so called adversarial examples is a form of overfitting . In particular , they hypothesize that a very complicated neural network behaves well on the training set , but nonetheless , performs poorly on the testing set enabling exploitation by the attacker . However , they discovered different DNN models were misclassifying the same adversarial examples and assigning them the same class instead of making random mistakes . This led Goodfellow et al . ( 2015 ) to propose that the DNN models were actually learning approximately linear functions resulting in underfitting the data . Recent work by Mnih et al . ( 2015 ) introduced the use of DNNs as function approximators in reinforcement learning , improving the state of the art in this area . Because these deep reinforcement learning agents utilize DNNs , they are also susceptible to this type of adversarial examples . Currently , deep reinforcement learning has been applied to many areas such as network system control ( Jay et al . ( 2019 ) , Chu et al . ( 2020 ) , Chinchali et al . ( 2018 ) ) , financial trading Noonan ( 2017 ) , blockchain protocol security Hou et al . ( 2019 ) , grid operation and security ( Duan et al . ( 2019 ) , Huang et al . ( 2019 ) ) , cloud computing Chen et al . ( 2018 ) , robotics ( Gu et al . ( 2017 ) , Kalashnikov et al . ( 2018 ) ) , autonomous driving Dosovitsky et al . ( 2017 ) , and medical treatment and diagnosis ( Tseng et al . ( 2017 ) , Popova et al . ( 2018 ) , Thananjeyan et al . ( 2017 ) , Daochang & Jiang ( 2018 ) , Ghesu et al . ( 2017 ) ) . A more particular scenario where adversarial perturbations might be of significant interest is a financial trading market where the DeepRL agent is trained on observations consisting of the order book . In such a setting it is possible to compromise the whole trading system with an extremely small subset of adversaries . In particular , the ` 1-norm bounded perturbations dicussed in our paper have sparse solutions , and thus can be used as a basis for an attack in such a scenario . Moreover , the magnitude of the ` 1-norm bounded perturbations produced by our attack is orders of magnitude smaller than previous approaches , and thus our proposed perturbations result in a stealth attack more likely to evade automatic anomaly detection schemes . Considering the wide spectrum of deep reinforcement learning algorithm deployment it is crucial to investigate the resilience of these algorithms before they are used in real world application domains . Moreover , adversarial formulations are a first step to understand these algorithms and build generalizable , reliable and robust deep reinforcement learning agents . Therefore , in this paper we study adversarial attack formulations for deep reinforcement learning agents and make the following contributions : • We define the optimal myopic adversary , whose aim is to minimize the value of the action taken by the agent in each state , and formulate the optimization problem that this adversary seeks to solve . • We introduce a differentiable approximation for the optimal myopic adversarial formulation . • We compare the impact results of our attack formulation to previous formulations in different games in the Atari environment . • We show that the new formulation finds a better direction for the adversarial perturbation and increases the attack impact for bounded perturbations . ( Conversely , our formulation decreases the magnitude of the pertubation required to efficiently achieve a significant impact . ) 2 RELATED WORK AND BACKGROUND . 2.1 ADVERSARIAL REINFORCEMENT LEARNING . Adversarial reinforcement learning is an active line of research directed towards discovering the weaknesses of deep reinforcement learning algorithms . Gleave et al . ( 2020 ) model the interaction between the agent and the adversary as a two player Markov game and solve the reinforcement learning problem for the adversary via Proximal Policy Optimization introduced by Schulman et al . ( 2017 ) . They fix the victim agent ’ s policy and only allow the adversary to take natural actions to disrupt the agent instead of using ` p-norm bound pixel perturbations . Pinto et al . ( 2017 ) model the adversary and the victim as a two player zero-sum discounted Markov game and train the victim in the presence of the adversary to make the victim more robust . Mandlekar et al . ( 2017 ) use a gradient based perturbation to make the agent more robust as compared to random perturbations . Huang et al . ( 2017 ) and Kos & Song ( 2017 ) use the fast gradient sign method ( FGSM ) to show deep reinforcement learning agents are vulnarable to adversarial perturbations . Pattanaik et al . ( 2018 ) use a gradient based formulation to increase the robustness of deep reinforcement learning agents . 2.2 ADVERSARIAL ATTACK METHODS . Goodfellow et al . ( 2015 ) introduced the fast gradient method ( FGM ) x∗ = x+ · ∇xJ ( x , y ) ||∇xJ ( x , y ) ||p , ( 1 ) for crafting adversarial examples for image classification by taking the gradient of the cost function J ( x , y ) used to train the neural network in the direction of the input . Here x is the input and y is the output label for image classification . As mentioned in the previous section FGM was first adapted to the deep reinforcement learning setting by Huang et al . ( 2017 ) . Subsequently , Pattanaik et al . ( 2018 ) introduced a variant of FGM , in which a few random samples are taken in the gradient direction , and the best is chosen . However , the main difference between the approach of Huang et al . ( 2017 ) and Pattanaik et al . ( 2018 ) is in the choice of the cost function J used to determine the gradient direction . In the next section we will outline the different cost functions used in these two different formulations . 2.3 ADVERSARIAL ATTACK FORMULATIONS . In a bounded attack formulation for deep reinforcement learning , the aim is to try to find a perturbed state sadv in a ball D , p ( s ) = { sadv ∣∣ ‖sadv − s‖p ≤ } , ( 2 ) that minimizes the expected cumulative reward of the agent . It is important to note that the agent will always try to take the best action depending only on its perception of the state , and independent from the unperturbed state . Therefore , in the perturbed state the agent will still choose the action , a∗ ( sadv ) = argmaxaQ ( sadv , a ) , which maximizes the state action value function in state sadv . It has been an active line of research to find the right direction for the adversarial perturbation in the deep reinforcement learning domain . The first attack of this form was formulated by Huang et al . ( 2017 ) and concurrently by Kos & Song ( 2017 ) by trying to minimize the probability of the best possible action in the given state , a∗ ( s ) = argmax a Q ( s , a ) min sadv∈D , p ( s ) π ( sadv , a ∗ ( s ) ) . ( 3 ) Note that π ( s , a ) is the softmax policy of the agent given by πT ( s , a ) = e Q ( s , a ( s ) ) T∑ ak e Q ( s , ak ) T , ( 4 ) where T is called the temperature constant . When the temperature constant is not relevant to the discussion we will drop the subscript and use the notation π ( s , a ) . It is important to note that π ( s , a ) is not the actual policy used by the agent . Indeed the DRL agent deterministically chooses the action a∗ maximizing Q ( s , a ) ( or equivalently π ( s , a ) ) . The softmax operation is only introduced in order to calculate the adversarial perturbation direction . Lin et al . ( 2017 ) formulated another attack with unbounded perturbation based on the Carlini & Wagner ( 2017 ) attack where the goal is to minimize the perturbation subject to choosing any action other than the best . min sadv∈D , p ( s ) ‖sadv − s‖p subject to a∗ ( s ) 6= a∗ ( sadv ) . Pattanaik et al . ( 2018 ) formulated yet another attack which aims to maximize the probability of the worst possible action in the given state , aw ( s ) = argmin a Q ( s , a ) max sadv∈D , p ( s ) π ( sadv , aw ( s ) ) , ( 5 ) and further showed that their attack formulation ( 5 ) is more effective than ( 3 ) . Pattanaik et al . ( 2018 ) also introduce the notion of targeted attacks to the reinforcement learning domain . In their paper they take the cross entropy loss between the optimal policy in the given state and their adversarial probability distribution and try to increase the probability of aw . However , just trying to increase the probability of aw in the softmax policy i.e . π ( sadv , aw ) is not sufficient to target aw in the actual policy followed by the agent . In fact the agent can end up in a state where , π ( sadv , aw ) > π ( s , aw ) aw 6= argmax a π ( sadv , a ) . ( 6 ) Although π ( sadv , aw ) has increased , the action aw will not be taken . However , it might be still possible to find a perturbed state s′adv for which , π ( sadv , aw ) > π ( s ′ adv , aw ) aw = argmax a π ( s′adv , a ) . ( 7 ) Therefore , maximizing the probability of taking the worst possible action in the given state is not actually the right formulation to find the correct direction for adversarial perturbation . | The work introduces a new method for observation-perturbation adversarial attacks against deep neural network policies. The idealized version of the method is an optimal attack assuming (a) the agent's Q-values are calibrated; (b) the attacker can only act once, at the current time step. While the attack is in fact conducted at every time step, so is not "myopic", this assumption greatly simplifies the problem. Moreover, the work approximates the (deterministic, hard-max) policy with a low-temperature softmax policy to enable gradient-based methods to work. Evaluating in a range of Atari games, the method has a significantly larger "impact" (normalized return) than previous methods, across $\ell_1$, $\ell_2$ and $\ell_{\infty}$ norms. Moreover, the results suggest the attack succeeds because of increasing the probability of low-ranked actions, consistent with the attack's derivation. | SP:f9aec02ea7ba21b7840c78f46af8cb6aa504e4ab |
Bounded Myopic Adversaries for Deep Reinforcement Learning Agents | Adversarial attacks against deep neural networks have been widely studied . Adversarial examples for deep reinforcement learning ( DeepRL ) have significant security implications , due to the deployment of these algorithms in many application domains . In this work we formalize an optimal myopic adversary for deep reinforcement learning agents . Our adversary attempts to find a bounded perturbation of the state which minimizes the value of the action taken by the agent . We show with experiments in various games in the Atari environment that our attack formulation achieves significantly larger impact as compared to the current state-of-the-art . Furthermore , this enables us to lower the bounds by several orders of magnitude on the perturbation needed to efficiently achieve significant impacts on DeepRL agents . 1 INTRODUCTION . Deep Neural Networks ( DNN ) have become a powerful tool and currently DNNs are widely used in speech recognition ( Hannun et al. , 2014 ) , computer vision ( Krizhevsky et al. , 2012 ) , natural language processing ( Sutskever et al. , 2014 ) , and self learning systems as deep reinforcement learning agents ( Mnih et al . ( 2015 ) , Mnih et al . ( 2016 ) , Schulman et al . ( 2015 ) , Lillicrap et al . ( 2015 ) ) . Along with the overwhelming success of DNNs in various domains there has also been a line of research investigating their weaknesses . Szegedy et al . ( 2014 ) observed that adding imperceptible perturbations to images can lead a DNN to misclassify the input image . The authors argue that the existence of these so called adversarial examples is a form of overfitting . In particular , they hypothesize that a very complicated neural network behaves well on the training set , but nonetheless , performs poorly on the testing set enabling exploitation by the attacker . However , they discovered different DNN models were misclassifying the same adversarial examples and assigning them the same class instead of making random mistakes . This led Goodfellow et al . ( 2015 ) to propose that the DNN models were actually learning approximately linear functions resulting in underfitting the data . Recent work by Mnih et al . ( 2015 ) introduced the use of DNNs as function approximators in reinforcement learning , improving the state of the art in this area . Because these deep reinforcement learning agents utilize DNNs , they are also susceptible to this type of adversarial examples . Currently , deep reinforcement learning has been applied to many areas such as network system control ( Jay et al . ( 2019 ) , Chu et al . ( 2020 ) , Chinchali et al . ( 2018 ) ) , financial trading Noonan ( 2017 ) , blockchain protocol security Hou et al . ( 2019 ) , grid operation and security ( Duan et al . ( 2019 ) , Huang et al . ( 2019 ) ) , cloud computing Chen et al . ( 2018 ) , robotics ( Gu et al . ( 2017 ) , Kalashnikov et al . ( 2018 ) ) , autonomous driving Dosovitsky et al . ( 2017 ) , and medical treatment and diagnosis ( Tseng et al . ( 2017 ) , Popova et al . ( 2018 ) , Thananjeyan et al . ( 2017 ) , Daochang & Jiang ( 2018 ) , Ghesu et al . ( 2017 ) ) . A more particular scenario where adversarial perturbations might be of significant interest is a financial trading market where the DeepRL agent is trained on observations consisting of the order book . In such a setting it is possible to compromise the whole trading system with an extremely small subset of adversaries . In particular , the ` 1-norm bounded perturbations dicussed in our paper have sparse solutions , and thus can be used as a basis for an attack in such a scenario . Moreover , the magnitude of the ` 1-norm bounded perturbations produced by our attack is orders of magnitude smaller than previous approaches , and thus our proposed perturbations result in a stealth attack more likely to evade automatic anomaly detection schemes . Considering the wide spectrum of deep reinforcement learning algorithm deployment it is crucial to investigate the resilience of these algorithms before they are used in real world application domains . Moreover , adversarial formulations are a first step to understand these algorithms and build generalizable , reliable and robust deep reinforcement learning agents . Therefore , in this paper we study adversarial attack formulations for deep reinforcement learning agents and make the following contributions : • We define the optimal myopic adversary , whose aim is to minimize the value of the action taken by the agent in each state , and formulate the optimization problem that this adversary seeks to solve . • We introduce a differentiable approximation for the optimal myopic adversarial formulation . • We compare the impact results of our attack formulation to previous formulations in different games in the Atari environment . • We show that the new formulation finds a better direction for the adversarial perturbation and increases the attack impact for bounded perturbations . ( Conversely , our formulation decreases the magnitude of the pertubation required to efficiently achieve a significant impact . ) 2 RELATED WORK AND BACKGROUND . 2.1 ADVERSARIAL REINFORCEMENT LEARNING . Adversarial reinforcement learning is an active line of research directed towards discovering the weaknesses of deep reinforcement learning algorithms . Gleave et al . ( 2020 ) model the interaction between the agent and the adversary as a two player Markov game and solve the reinforcement learning problem for the adversary via Proximal Policy Optimization introduced by Schulman et al . ( 2017 ) . They fix the victim agent ’ s policy and only allow the adversary to take natural actions to disrupt the agent instead of using ` p-norm bound pixel perturbations . Pinto et al . ( 2017 ) model the adversary and the victim as a two player zero-sum discounted Markov game and train the victim in the presence of the adversary to make the victim more robust . Mandlekar et al . ( 2017 ) use a gradient based perturbation to make the agent more robust as compared to random perturbations . Huang et al . ( 2017 ) and Kos & Song ( 2017 ) use the fast gradient sign method ( FGSM ) to show deep reinforcement learning agents are vulnarable to adversarial perturbations . Pattanaik et al . ( 2018 ) use a gradient based formulation to increase the robustness of deep reinforcement learning agents . 2.2 ADVERSARIAL ATTACK METHODS . Goodfellow et al . ( 2015 ) introduced the fast gradient method ( FGM ) x∗ = x+ · ∇xJ ( x , y ) ||∇xJ ( x , y ) ||p , ( 1 ) for crafting adversarial examples for image classification by taking the gradient of the cost function J ( x , y ) used to train the neural network in the direction of the input . Here x is the input and y is the output label for image classification . As mentioned in the previous section FGM was first adapted to the deep reinforcement learning setting by Huang et al . ( 2017 ) . Subsequently , Pattanaik et al . ( 2018 ) introduced a variant of FGM , in which a few random samples are taken in the gradient direction , and the best is chosen . However , the main difference between the approach of Huang et al . ( 2017 ) and Pattanaik et al . ( 2018 ) is in the choice of the cost function J used to determine the gradient direction . In the next section we will outline the different cost functions used in these two different formulations . 2.3 ADVERSARIAL ATTACK FORMULATIONS . In a bounded attack formulation for deep reinforcement learning , the aim is to try to find a perturbed state sadv in a ball D , p ( s ) = { sadv ∣∣ ‖sadv − s‖p ≤ } , ( 2 ) that minimizes the expected cumulative reward of the agent . It is important to note that the agent will always try to take the best action depending only on its perception of the state , and independent from the unperturbed state . Therefore , in the perturbed state the agent will still choose the action , a∗ ( sadv ) = argmaxaQ ( sadv , a ) , which maximizes the state action value function in state sadv . It has been an active line of research to find the right direction for the adversarial perturbation in the deep reinforcement learning domain . The first attack of this form was formulated by Huang et al . ( 2017 ) and concurrently by Kos & Song ( 2017 ) by trying to minimize the probability of the best possible action in the given state , a∗ ( s ) = argmax a Q ( s , a ) min sadv∈D , p ( s ) π ( sadv , a ∗ ( s ) ) . ( 3 ) Note that π ( s , a ) is the softmax policy of the agent given by πT ( s , a ) = e Q ( s , a ( s ) ) T∑ ak e Q ( s , ak ) T , ( 4 ) where T is called the temperature constant . When the temperature constant is not relevant to the discussion we will drop the subscript and use the notation π ( s , a ) . It is important to note that π ( s , a ) is not the actual policy used by the agent . Indeed the DRL agent deterministically chooses the action a∗ maximizing Q ( s , a ) ( or equivalently π ( s , a ) ) . The softmax operation is only introduced in order to calculate the adversarial perturbation direction . Lin et al . ( 2017 ) formulated another attack with unbounded perturbation based on the Carlini & Wagner ( 2017 ) attack where the goal is to minimize the perturbation subject to choosing any action other than the best . min sadv∈D , p ( s ) ‖sadv − s‖p subject to a∗ ( s ) 6= a∗ ( sadv ) . Pattanaik et al . ( 2018 ) formulated yet another attack which aims to maximize the probability of the worst possible action in the given state , aw ( s ) = argmin a Q ( s , a ) max sadv∈D , p ( s ) π ( sadv , aw ( s ) ) , ( 5 ) and further showed that their attack formulation ( 5 ) is more effective than ( 3 ) . Pattanaik et al . ( 2018 ) also introduce the notion of targeted attacks to the reinforcement learning domain . In their paper they take the cross entropy loss between the optimal policy in the given state and their adversarial probability distribution and try to increase the probability of aw . However , just trying to increase the probability of aw in the softmax policy i.e . π ( sadv , aw ) is not sufficient to target aw in the actual policy followed by the agent . In fact the agent can end up in a state where , π ( sadv , aw ) > π ( s , aw ) aw 6= argmax a π ( sadv , a ) . ( 6 ) Although π ( sadv , aw ) has increased , the action aw will not be taken . However , it might be still possible to find a perturbed state s′adv for which , π ( sadv , aw ) > π ( s ′ adv , aw ) aw = argmax a π ( s′adv , a ) . ( 7 ) Therefore , maximizing the probability of taking the worst possible action in the given state is not actually the right formulation to find the correct direction for adversarial perturbation . | This paper proposes using a better quantitative metric to conduct an attack on a DRL learner. The attack is limited to an attack on a state (not over multiple states) and aims to lower the Q value from this state by making the worst action be the action chosen to be played. The experiment on Atari games show promising results. | SP:f9aec02ea7ba21b7840c78f46af8cb6aa504e4ab |
Meta-learning Symmetries by Reparameterization | 1 INTRODUCTION . In deep learning , the convolutional neural network ( CNN ) ( LeCun et al. , 1998 ) is a prime example of exploiting equivariance to a symmetry transformation to conserve parameters and improve generalization . In image classification ( Russakovsky et al. , 2015 ; Krizhevsky et al. , 2012 ) and audio processing ( Graves and Jaitly , 2014 ; Hannun et al. , 2014 ) tasks , we may expect the layers of a deep network to learn feature detectors that are translation equivariant : if we translate the input , the output feature map is also translated . Convolution layers satisfy translation equivariance by definition , and produce remarkable results on these tasks . The success of convolution ’ s “ built in ” inductive bias suggests that we can similarly exploit other equivariances to solve machine learning problems . However , there are substantial challenges with building in inductive biases . Identifying the correct biases to build in is challenging , and even if we do know the correct biases , it is often difficult to build them into a neural network . Practitioners commonly avoid this issue by “ training in ” desired equivariances ( usually the special case of invariances ) using data augmentation . However , data augmentation can be challenging in many problem settings and we would prefer to build the equivariance into the network itself . For example , robotics sim2real transfer approaches train agents that are robust to varying conditions by varying the simulated environment dynamics ( Song et al. , 2020 ) . But this type of augmentation is not possible once the agent leaves the simulator and is trying to learn or adapt to a new task in the real world . Additionally , building in incorrect biases may actually be detrimental to final performance ( Liu et al. , 2018b ) . In this work we aim for an approach that can automatically learn and encode equivariances into a neural network . This would free practitioners from having to design custom equivariant architectures for each task , and allow them to transfer any learned equivariances to new tasks . Neural network layers can achieve various equivariances through parameter sharing patterns , such as the spatial parameter sharing of standard convolutions . In this paper we reparameterize network layers to learnably represent sharing patterns . We leverage meta-learning to learn the sharing patterns that help a model generalize on new tasks . The primary contribution of this paper is an approach to automatically learn equivariance-inducing parameter sharing , instead of using custom designed equivariant architectures . We show theoretically that reparameterization can represent networks equivariant to any finite symmetry group . Our experiments show that meta-learning can recover various convolutional architectures from data , and learn invariances to common data augmentation transformations . 2 RELATED WORK . A number of works have studied designing layers with equivariances to certain transformations such as permutation , rotation , reflection , and scaling ( Gens and Domingos , 2014 ; Cohen and Welling , 2016 ; Zaheer et al. , 2017 ; Worrall et al. , 2017 ; Cohen et al. , 2019 ; Weiler and Cesa , 2019 ; Worrall and Welling , 2019 ) . These approaches focus on manually constructing layers analagous to standard convolution , but for other symmetry groups . Rather than building symmetries into the architecture , data augmentation ( Beymer and Poggio , 1995 ; Niyogi et al. , 1998 ) trains a network to satisfy them . Diaconu and Worrall ( 2019 ) use a hybrid approach that pre-trains a basis of rotated filters in order to define roto-translation equivariant convolution . Unlike these works , we aim to automatically build in symmetries by acquiring them from data . Our approach is motivated in part by theoretical work characterizing the nature of equivariant layers for various symmetry groups . In particular , the analysis of our method as learning a certain kind of convolution is inspired by Kondor and Trivedi ( 2018 ) , who show that under certain conditions all linear equivariant layers are ( generalized ) convolutions . Shawe-Taylor ( 1989 ) and Ravanbakhsh et al . ( 2017 ) analyze the relationship between desired symmetries in a layer and symmetries of the weight matrix . Ravanbakhsh et al . ( 2017 ) show that we can make a layer equivariant to the permutation representation of any discrete group through a corresponding parameter sharing pattern in the weight matrix . From this perspective , our reparameterization is a way of representing possible parameter sharing patterns , and the training procedure aims to learn the correct parameter sharing pattern that achieves a desired equivariance . Prior work on automatically learning symmetries include methods for learning invariances in Gaussian processes ( van der Wilk et al. , 2018 ) and learning symmetries of physical systems ( Greydanus et al. , 2019 ; Cranmer et al. , 2020 ) . Another very recent line of work has shown that more general Transformer ( Vaswani et al. , 2017 ) style architectures can match or outperform traditional CNNs on image tasks , without baking in translation symmetry ( Dosovitskiy et al. , 2020 ) . Their results suggest that Transformer architectures can automatically learn symmetries and other inductive biases from data , but typically only with very large training datasets . One can also consider automatic data augmentation strategies ( Cubuk et al. , 2018 ; Lorraine et al. , 2019 ) as a way of learning symmetries , though the symmetries are not embedded into the network in a transferable way . Concurrent work by Benton et al . ( 2020 ) aims to learn invariances from data by learning distributions over transformations of the input , similar to learned data augmentation . Our method aims to learn parameter sharing of the layer weights which induces equivariance . Additionally , our objective for learning symmetries is driven directly by generalization error ( in a meta-learning framework ) , while the objective in Benton et al . ( 2020 ) adds a regularizer to the training loss to encourage symmetry learning . Our work is related to neural architecture search ( Zoph and Le , 2016 ; Brock et al. , 2017 ; Liu et al. , 2018a ; Elsken et al. , 2018 ) , which also aims to automate part of the model design process . Although architecture search methods are varied , they are generally not designed to exploit symmetry or learn equivariances . Evolutionary methods for learning both network weights and topology ( Stanley and Miikkulainen , 2002 ; Stanley et al. , 2009 ) are also not motivated by symmetry considerations . Our method learns to exploit symmetries that are shared by a collection of tasks , a form of metalearning ( Thrun and Pratt , 2012 ; Schmidhuber , 1987 ; Bengio et al. , 1992 ; Hochreiter et al. , 2001 ) . We extend gradient based meta-learning ( Finn et al. , 2017 ; Li et al. , 2017 ; Antoniou et al. , 2018 ) to separately learn parameter sharing patterns ( which enforce equivariance ) and actual parameter values . Separately representing network weights in terms of a sharing pattern and parameter values is a form of reparameterization . Prior work has used weight reparameterization in order to “ warp ” the loss surface ( Lee and Choi , 2018 ; Flennerhag et al. , 2019 ) and to learn good latent spaces ( Rusu et al. , 2018 ) for optimization , rather than to encode equivariance . HyperNetworks ( Ha et al. , 2016 ; Schmidhuber , 1992 ) generate network layer weights using a separate smaller network , which can be viewed as a nonlinear reparameterization , albeit not one that encourages learning equivariances . Modular meta-learning ( Alet et al. , 2018 ) is a related technique that aims to achieve combinatorial generalization on new tasks by stacking meta-learned “ modules , ” each of which is a neural network . This can be seen as parameter sharing by re-using and combining modules , rather than using our layerwise reparameterization . 3 PRELIMINARIES . In Sec . 3.1 , we review gradient based meta-learning , which underlies our algorithm . Sections 3.2 and 3.3 build up a formal definition of equivariance and group convolution ( Cohen and Welling , 2016 ) , a generalization of standard convolution which defines equivariant operations for other groups such as rotation and reflection . These concepts are important for a theoretical understanding of our work as a method for learning group convolutions in Sec . 4.2 . 3.1 GRADIENT BASED META-LEARNING . Our method is a gradient-based meta-learning algorithm that extends MAML ( Finn et al. , 2017 ) , which we briefly review here . Suppose we have some task distribution p ( T ) , where each task dataset is split into training and validation datasets { Dtri , Dvali } . For a model with parameters θ , loss L , and learning rate α , the “ inner loop ” updates θ on the task ’ s training data : θ′ = θ−α∇θL ( θ , Dtr ) . In the “ outer loop , ” MAML meta-learns a good initialization θ by minimizing the loss of θ′ on the task ’ s validation data , with updates of the form θ ← θ − η ddθL ( θ ′ , Dval ) . Although MAML focuses on meta-learning the inner loop initialization θ , one can extend this idea to meta-learning other things such as the inner learning rate α . In our method , we meta-learn a parameter sharing pattern at each layer that maximizes performance across the task distribution . 3.2 GROUPS AND GROUP ACTIONS . Symmetry and equivariance is usually studied in the context of groups and their actions on sets ; refer to Dummit and Foote ( 2004 ) for more comprehensive coverage . A group G is a set closed under some associative binary operation , where there is an identity element and each element has an inverse . Consider the group ( Z , + ) ( the set of integers with addition ) : we can add any two integers to obtain another , each integer has an additive inverse , and 0 is the additive identity . A group G can act on a set X through some action ρ : G → Aut ( X ) which maps each g ∈ G to some transformation on X . ρ must be a homomorphism , i.e . ρ ( gh ) = ρ ( g ) ρ ( h ) for all g , h ∈ G , and Aut ( X ) is the set of automorphisms on X ( bijective homomorphisms from X to itself ) . As a shorthand we write gx : = ρ ( g ) ( x ) for any x ∈ X . Any group can act on itself by letting X = G : for ( Z , + ) , we define the action gx = g + x for any g , x ∈ Z . The action of a group G on a vector space V is called a representation , which we denote π : G → GL ( V ) . Recall GL ( V ) is the set of invertible linear maps on V . Assume the vectors v ∈ V are discrete , with components v [ i ] . If we already have G ’ s action on the indices , a natural corresponding representation is defined ( π ( g ) v ) [ i ] : = v [ g−1i ] . As a concrete example , consider the representation of G = ( Z , + ) for infinite length vectors . The indices are also integers , so the group is acting on itself as defined above . Then ( π ( g ) v ) [ i ] = v [ g−1i ] = v [ i − g ] for any g , i ∈ Z . Hence this representation of Z shifts vectors by translating their indices by g spaces . | In this paper, the authors propose MSR, a parametrization of convolutional kernels that allows for meta-learning symmetries shared between several tasks. Each kernel is represented as a product of a structure matrix and a vector of the kernel weights. The kernel weights are updated during the inner loop. The structure matrix is updated during the outer loop. | SP:4c76919a2aa2b645c86a072f7bafbb2c384dc58a |
Meta-learning Symmetries by Reparameterization | 1 INTRODUCTION . In deep learning , the convolutional neural network ( CNN ) ( LeCun et al. , 1998 ) is a prime example of exploiting equivariance to a symmetry transformation to conserve parameters and improve generalization . In image classification ( Russakovsky et al. , 2015 ; Krizhevsky et al. , 2012 ) and audio processing ( Graves and Jaitly , 2014 ; Hannun et al. , 2014 ) tasks , we may expect the layers of a deep network to learn feature detectors that are translation equivariant : if we translate the input , the output feature map is also translated . Convolution layers satisfy translation equivariance by definition , and produce remarkable results on these tasks . The success of convolution ’ s “ built in ” inductive bias suggests that we can similarly exploit other equivariances to solve machine learning problems . However , there are substantial challenges with building in inductive biases . Identifying the correct biases to build in is challenging , and even if we do know the correct biases , it is often difficult to build them into a neural network . Practitioners commonly avoid this issue by “ training in ” desired equivariances ( usually the special case of invariances ) using data augmentation . However , data augmentation can be challenging in many problem settings and we would prefer to build the equivariance into the network itself . For example , robotics sim2real transfer approaches train agents that are robust to varying conditions by varying the simulated environment dynamics ( Song et al. , 2020 ) . But this type of augmentation is not possible once the agent leaves the simulator and is trying to learn or adapt to a new task in the real world . Additionally , building in incorrect biases may actually be detrimental to final performance ( Liu et al. , 2018b ) . In this work we aim for an approach that can automatically learn and encode equivariances into a neural network . This would free practitioners from having to design custom equivariant architectures for each task , and allow them to transfer any learned equivariances to new tasks . Neural network layers can achieve various equivariances through parameter sharing patterns , such as the spatial parameter sharing of standard convolutions . In this paper we reparameterize network layers to learnably represent sharing patterns . We leverage meta-learning to learn the sharing patterns that help a model generalize on new tasks . The primary contribution of this paper is an approach to automatically learn equivariance-inducing parameter sharing , instead of using custom designed equivariant architectures . We show theoretically that reparameterization can represent networks equivariant to any finite symmetry group . Our experiments show that meta-learning can recover various convolutional architectures from data , and learn invariances to common data augmentation transformations . 2 RELATED WORK . A number of works have studied designing layers with equivariances to certain transformations such as permutation , rotation , reflection , and scaling ( Gens and Domingos , 2014 ; Cohen and Welling , 2016 ; Zaheer et al. , 2017 ; Worrall et al. , 2017 ; Cohen et al. , 2019 ; Weiler and Cesa , 2019 ; Worrall and Welling , 2019 ) . These approaches focus on manually constructing layers analagous to standard convolution , but for other symmetry groups . Rather than building symmetries into the architecture , data augmentation ( Beymer and Poggio , 1995 ; Niyogi et al. , 1998 ) trains a network to satisfy them . Diaconu and Worrall ( 2019 ) use a hybrid approach that pre-trains a basis of rotated filters in order to define roto-translation equivariant convolution . Unlike these works , we aim to automatically build in symmetries by acquiring them from data . Our approach is motivated in part by theoretical work characterizing the nature of equivariant layers for various symmetry groups . In particular , the analysis of our method as learning a certain kind of convolution is inspired by Kondor and Trivedi ( 2018 ) , who show that under certain conditions all linear equivariant layers are ( generalized ) convolutions . Shawe-Taylor ( 1989 ) and Ravanbakhsh et al . ( 2017 ) analyze the relationship between desired symmetries in a layer and symmetries of the weight matrix . Ravanbakhsh et al . ( 2017 ) show that we can make a layer equivariant to the permutation representation of any discrete group through a corresponding parameter sharing pattern in the weight matrix . From this perspective , our reparameterization is a way of representing possible parameter sharing patterns , and the training procedure aims to learn the correct parameter sharing pattern that achieves a desired equivariance . Prior work on automatically learning symmetries include methods for learning invariances in Gaussian processes ( van der Wilk et al. , 2018 ) and learning symmetries of physical systems ( Greydanus et al. , 2019 ; Cranmer et al. , 2020 ) . Another very recent line of work has shown that more general Transformer ( Vaswani et al. , 2017 ) style architectures can match or outperform traditional CNNs on image tasks , without baking in translation symmetry ( Dosovitskiy et al. , 2020 ) . Their results suggest that Transformer architectures can automatically learn symmetries and other inductive biases from data , but typically only with very large training datasets . One can also consider automatic data augmentation strategies ( Cubuk et al. , 2018 ; Lorraine et al. , 2019 ) as a way of learning symmetries , though the symmetries are not embedded into the network in a transferable way . Concurrent work by Benton et al . ( 2020 ) aims to learn invariances from data by learning distributions over transformations of the input , similar to learned data augmentation . Our method aims to learn parameter sharing of the layer weights which induces equivariance . Additionally , our objective for learning symmetries is driven directly by generalization error ( in a meta-learning framework ) , while the objective in Benton et al . ( 2020 ) adds a regularizer to the training loss to encourage symmetry learning . Our work is related to neural architecture search ( Zoph and Le , 2016 ; Brock et al. , 2017 ; Liu et al. , 2018a ; Elsken et al. , 2018 ) , which also aims to automate part of the model design process . Although architecture search methods are varied , they are generally not designed to exploit symmetry or learn equivariances . Evolutionary methods for learning both network weights and topology ( Stanley and Miikkulainen , 2002 ; Stanley et al. , 2009 ) are also not motivated by symmetry considerations . Our method learns to exploit symmetries that are shared by a collection of tasks , a form of metalearning ( Thrun and Pratt , 2012 ; Schmidhuber , 1987 ; Bengio et al. , 1992 ; Hochreiter et al. , 2001 ) . We extend gradient based meta-learning ( Finn et al. , 2017 ; Li et al. , 2017 ; Antoniou et al. , 2018 ) to separately learn parameter sharing patterns ( which enforce equivariance ) and actual parameter values . Separately representing network weights in terms of a sharing pattern and parameter values is a form of reparameterization . Prior work has used weight reparameterization in order to “ warp ” the loss surface ( Lee and Choi , 2018 ; Flennerhag et al. , 2019 ) and to learn good latent spaces ( Rusu et al. , 2018 ) for optimization , rather than to encode equivariance . HyperNetworks ( Ha et al. , 2016 ; Schmidhuber , 1992 ) generate network layer weights using a separate smaller network , which can be viewed as a nonlinear reparameterization , albeit not one that encourages learning equivariances . Modular meta-learning ( Alet et al. , 2018 ) is a related technique that aims to achieve combinatorial generalization on new tasks by stacking meta-learned “ modules , ” each of which is a neural network . This can be seen as parameter sharing by re-using and combining modules , rather than using our layerwise reparameterization . 3 PRELIMINARIES . In Sec . 3.1 , we review gradient based meta-learning , which underlies our algorithm . Sections 3.2 and 3.3 build up a formal definition of equivariance and group convolution ( Cohen and Welling , 2016 ) , a generalization of standard convolution which defines equivariant operations for other groups such as rotation and reflection . These concepts are important for a theoretical understanding of our work as a method for learning group convolutions in Sec . 4.2 . 3.1 GRADIENT BASED META-LEARNING . Our method is a gradient-based meta-learning algorithm that extends MAML ( Finn et al. , 2017 ) , which we briefly review here . Suppose we have some task distribution p ( T ) , where each task dataset is split into training and validation datasets { Dtri , Dvali } . For a model with parameters θ , loss L , and learning rate α , the “ inner loop ” updates θ on the task ’ s training data : θ′ = θ−α∇θL ( θ , Dtr ) . In the “ outer loop , ” MAML meta-learns a good initialization θ by minimizing the loss of θ′ on the task ’ s validation data , with updates of the form θ ← θ − η ddθL ( θ ′ , Dval ) . Although MAML focuses on meta-learning the inner loop initialization θ , one can extend this idea to meta-learning other things such as the inner learning rate α . In our method , we meta-learn a parameter sharing pattern at each layer that maximizes performance across the task distribution . 3.2 GROUPS AND GROUP ACTIONS . Symmetry and equivariance is usually studied in the context of groups and their actions on sets ; refer to Dummit and Foote ( 2004 ) for more comprehensive coverage . A group G is a set closed under some associative binary operation , where there is an identity element and each element has an inverse . Consider the group ( Z , + ) ( the set of integers with addition ) : we can add any two integers to obtain another , each integer has an additive inverse , and 0 is the additive identity . A group G can act on a set X through some action ρ : G → Aut ( X ) which maps each g ∈ G to some transformation on X . ρ must be a homomorphism , i.e . ρ ( gh ) = ρ ( g ) ρ ( h ) for all g , h ∈ G , and Aut ( X ) is the set of automorphisms on X ( bijective homomorphisms from X to itself ) . As a shorthand we write gx : = ρ ( g ) ( x ) for any x ∈ X . Any group can act on itself by letting X = G : for ( Z , + ) , we define the action gx = g + x for any g , x ∈ Z . The action of a group G on a vector space V is called a representation , which we denote π : G → GL ( V ) . Recall GL ( V ) is the set of invertible linear maps on V . Assume the vectors v ∈ V are discrete , with components v [ i ] . If we already have G ’ s action on the indices , a natural corresponding representation is defined ( π ( g ) v ) [ i ] : = v [ g−1i ] . As a concrete example , consider the representation of G = ( Z , + ) for infinite length vectors . The indices are also integers , so the group is acting on itself as defined above . Then ( π ( g ) v ) [ i ] = v [ g−1i ] = v [ i − g ] for any g , i ∈ Z . Hence this representation of Z shifts vectors by translating their indices by g spaces . | The authors present a meta-learning approach for network equivariance where the key idea is that equivariance to a finite group of transformations can be achieved by identifying the sharing pattern of weights. Their proposition claims that a fully connected layer $\phi: \mathbb{R}^n \rightarrow \mathbb{R}^m$ with weights $W$ can be factorized into a symmetry matrix $U$ and filter parameters $v$ where the symmetry matrix encodes desired group-convolutions: $\text{vec}(W) = U v, \hspace{1em} v \in \mathbb{R}^k, U \in \mathbb{R}^{mn \times k}$. Within the meta-learning framework, they learn both $U$ and $v$ as part of the outer and inner steps respectively. They demonstrate that they are able to recover the translational equivariance baked into traditional convolutions using this approach including the expected symmetry pattern (shown in Fig. 4). They are also able to demonstrate this two more scenarios: (i) for a group of translation, discrete $45^\circ$ rotation and reflection, and (ii) for Augmented-Omniglot and Augmented-MiniImagenet, providing empirical evidence that their proposed approach learns meaningful information for network equivariance. | SP:4c76919a2aa2b645c86a072f7bafbb2c384dc58a |
Meta-learning Symmetries by Reparameterization | 1 INTRODUCTION . In deep learning , the convolutional neural network ( CNN ) ( LeCun et al. , 1998 ) is a prime example of exploiting equivariance to a symmetry transformation to conserve parameters and improve generalization . In image classification ( Russakovsky et al. , 2015 ; Krizhevsky et al. , 2012 ) and audio processing ( Graves and Jaitly , 2014 ; Hannun et al. , 2014 ) tasks , we may expect the layers of a deep network to learn feature detectors that are translation equivariant : if we translate the input , the output feature map is also translated . Convolution layers satisfy translation equivariance by definition , and produce remarkable results on these tasks . The success of convolution ’ s “ built in ” inductive bias suggests that we can similarly exploit other equivariances to solve machine learning problems . However , there are substantial challenges with building in inductive biases . Identifying the correct biases to build in is challenging , and even if we do know the correct biases , it is often difficult to build them into a neural network . Practitioners commonly avoid this issue by “ training in ” desired equivariances ( usually the special case of invariances ) using data augmentation . However , data augmentation can be challenging in many problem settings and we would prefer to build the equivariance into the network itself . For example , robotics sim2real transfer approaches train agents that are robust to varying conditions by varying the simulated environment dynamics ( Song et al. , 2020 ) . But this type of augmentation is not possible once the agent leaves the simulator and is trying to learn or adapt to a new task in the real world . Additionally , building in incorrect biases may actually be detrimental to final performance ( Liu et al. , 2018b ) . In this work we aim for an approach that can automatically learn and encode equivariances into a neural network . This would free practitioners from having to design custom equivariant architectures for each task , and allow them to transfer any learned equivariances to new tasks . Neural network layers can achieve various equivariances through parameter sharing patterns , such as the spatial parameter sharing of standard convolutions . In this paper we reparameterize network layers to learnably represent sharing patterns . We leverage meta-learning to learn the sharing patterns that help a model generalize on new tasks . The primary contribution of this paper is an approach to automatically learn equivariance-inducing parameter sharing , instead of using custom designed equivariant architectures . We show theoretically that reparameterization can represent networks equivariant to any finite symmetry group . Our experiments show that meta-learning can recover various convolutional architectures from data , and learn invariances to common data augmentation transformations . 2 RELATED WORK . A number of works have studied designing layers with equivariances to certain transformations such as permutation , rotation , reflection , and scaling ( Gens and Domingos , 2014 ; Cohen and Welling , 2016 ; Zaheer et al. , 2017 ; Worrall et al. , 2017 ; Cohen et al. , 2019 ; Weiler and Cesa , 2019 ; Worrall and Welling , 2019 ) . These approaches focus on manually constructing layers analagous to standard convolution , but for other symmetry groups . Rather than building symmetries into the architecture , data augmentation ( Beymer and Poggio , 1995 ; Niyogi et al. , 1998 ) trains a network to satisfy them . Diaconu and Worrall ( 2019 ) use a hybrid approach that pre-trains a basis of rotated filters in order to define roto-translation equivariant convolution . Unlike these works , we aim to automatically build in symmetries by acquiring them from data . Our approach is motivated in part by theoretical work characterizing the nature of equivariant layers for various symmetry groups . In particular , the analysis of our method as learning a certain kind of convolution is inspired by Kondor and Trivedi ( 2018 ) , who show that under certain conditions all linear equivariant layers are ( generalized ) convolutions . Shawe-Taylor ( 1989 ) and Ravanbakhsh et al . ( 2017 ) analyze the relationship between desired symmetries in a layer and symmetries of the weight matrix . Ravanbakhsh et al . ( 2017 ) show that we can make a layer equivariant to the permutation representation of any discrete group through a corresponding parameter sharing pattern in the weight matrix . From this perspective , our reparameterization is a way of representing possible parameter sharing patterns , and the training procedure aims to learn the correct parameter sharing pattern that achieves a desired equivariance . Prior work on automatically learning symmetries include methods for learning invariances in Gaussian processes ( van der Wilk et al. , 2018 ) and learning symmetries of physical systems ( Greydanus et al. , 2019 ; Cranmer et al. , 2020 ) . Another very recent line of work has shown that more general Transformer ( Vaswani et al. , 2017 ) style architectures can match or outperform traditional CNNs on image tasks , without baking in translation symmetry ( Dosovitskiy et al. , 2020 ) . Their results suggest that Transformer architectures can automatically learn symmetries and other inductive biases from data , but typically only with very large training datasets . One can also consider automatic data augmentation strategies ( Cubuk et al. , 2018 ; Lorraine et al. , 2019 ) as a way of learning symmetries , though the symmetries are not embedded into the network in a transferable way . Concurrent work by Benton et al . ( 2020 ) aims to learn invariances from data by learning distributions over transformations of the input , similar to learned data augmentation . Our method aims to learn parameter sharing of the layer weights which induces equivariance . Additionally , our objective for learning symmetries is driven directly by generalization error ( in a meta-learning framework ) , while the objective in Benton et al . ( 2020 ) adds a regularizer to the training loss to encourage symmetry learning . Our work is related to neural architecture search ( Zoph and Le , 2016 ; Brock et al. , 2017 ; Liu et al. , 2018a ; Elsken et al. , 2018 ) , which also aims to automate part of the model design process . Although architecture search methods are varied , they are generally not designed to exploit symmetry or learn equivariances . Evolutionary methods for learning both network weights and topology ( Stanley and Miikkulainen , 2002 ; Stanley et al. , 2009 ) are also not motivated by symmetry considerations . Our method learns to exploit symmetries that are shared by a collection of tasks , a form of metalearning ( Thrun and Pratt , 2012 ; Schmidhuber , 1987 ; Bengio et al. , 1992 ; Hochreiter et al. , 2001 ) . We extend gradient based meta-learning ( Finn et al. , 2017 ; Li et al. , 2017 ; Antoniou et al. , 2018 ) to separately learn parameter sharing patterns ( which enforce equivariance ) and actual parameter values . Separately representing network weights in terms of a sharing pattern and parameter values is a form of reparameterization . Prior work has used weight reparameterization in order to “ warp ” the loss surface ( Lee and Choi , 2018 ; Flennerhag et al. , 2019 ) and to learn good latent spaces ( Rusu et al. , 2018 ) for optimization , rather than to encode equivariance . HyperNetworks ( Ha et al. , 2016 ; Schmidhuber , 1992 ) generate network layer weights using a separate smaller network , which can be viewed as a nonlinear reparameterization , albeit not one that encourages learning equivariances . Modular meta-learning ( Alet et al. , 2018 ) is a related technique that aims to achieve combinatorial generalization on new tasks by stacking meta-learned “ modules , ” each of which is a neural network . This can be seen as parameter sharing by re-using and combining modules , rather than using our layerwise reparameterization . 3 PRELIMINARIES . In Sec . 3.1 , we review gradient based meta-learning , which underlies our algorithm . Sections 3.2 and 3.3 build up a formal definition of equivariance and group convolution ( Cohen and Welling , 2016 ) , a generalization of standard convolution which defines equivariant operations for other groups such as rotation and reflection . These concepts are important for a theoretical understanding of our work as a method for learning group convolutions in Sec . 4.2 . 3.1 GRADIENT BASED META-LEARNING . Our method is a gradient-based meta-learning algorithm that extends MAML ( Finn et al. , 2017 ) , which we briefly review here . Suppose we have some task distribution p ( T ) , where each task dataset is split into training and validation datasets { Dtri , Dvali } . For a model with parameters θ , loss L , and learning rate α , the “ inner loop ” updates θ on the task ’ s training data : θ′ = θ−α∇θL ( θ , Dtr ) . In the “ outer loop , ” MAML meta-learns a good initialization θ by minimizing the loss of θ′ on the task ’ s validation data , with updates of the form θ ← θ − η ddθL ( θ ′ , Dval ) . Although MAML focuses on meta-learning the inner loop initialization θ , one can extend this idea to meta-learning other things such as the inner learning rate α . In our method , we meta-learn a parameter sharing pattern at each layer that maximizes performance across the task distribution . 3.2 GROUPS AND GROUP ACTIONS . Symmetry and equivariance is usually studied in the context of groups and their actions on sets ; refer to Dummit and Foote ( 2004 ) for more comprehensive coverage . A group G is a set closed under some associative binary operation , where there is an identity element and each element has an inverse . Consider the group ( Z , + ) ( the set of integers with addition ) : we can add any two integers to obtain another , each integer has an additive inverse , and 0 is the additive identity . A group G can act on a set X through some action ρ : G → Aut ( X ) which maps each g ∈ G to some transformation on X . ρ must be a homomorphism , i.e . ρ ( gh ) = ρ ( g ) ρ ( h ) for all g , h ∈ G , and Aut ( X ) is the set of automorphisms on X ( bijective homomorphisms from X to itself ) . As a shorthand we write gx : = ρ ( g ) ( x ) for any x ∈ X . Any group can act on itself by letting X = G : for ( Z , + ) , we define the action gx = g + x for any g , x ∈ Z . The action of a group G on a vector space V is called a representation , which we denote π : G → GL ( V ) . Recall GL ( V ) is the set of invertible linear maps on V . Assume the vectors v ∈ V are discrete , with components v [ i ] . If we already have G ’ s action on the indices , a natural corresponding representation is defined ( π ( g ) v ) [ i ] : = v [ g−1i ] . As a concrete example , consider the representation of G = ( Z , + ) for infinite length vectors . The indices are also integers , so the group is acting on itself as defined above . Then ( π ( g ) v ) [ i ] = v [ g−1i ] = v [ i − g ] for any g , i ∈ Z . Hence this representation of Z shifts vectors by translating their indices by g spaces . | The paper presents a meta-learning algorithm to learn/encode equivariance into deep nets. The main idea is to decompose the model parameters into two parts, a spatial sharing pattern, and the trainable weights. When transferring to a new task, the sharing pattern is fixed and only the remaining trainable weights are tuned. They authors motivated this approach stating that data augmentation may not be practical for robotics application which requires training in the real-world. For experiments, they consider a synthetic dataset where they can recover the equivariance and also k-shot classification tasks on datasets augmented with crops, rotations, and reflections. | SP:4c76919a2aa2b645c86a072f7bafbb2c384dc58a |
Extrapolatable Relational Reasoning With Comparators in Low-Dimensional Manifolds | 1 INTRODUCTION . The goal of Artificial Intelligence research , first proposed in the 1950s and reiterated many times , is to create machine intelligence comparable to that of a human being . While today ’ s deep learning based systems achieve human-comparable performances in specific tasks such as object classification and natural language understanding , they often fail to generalise in out-of-distribution ( o.o.d ) scenarios , where the test data distribution differs from the training data distribution ( Recht et al. , 2019 ; Trask et al. , 2018 ; Barrett et al. , 2018 ; Belinkov & Bisk , 2018 ) . Moreover , it is observed that the generalisation error increases as the tasks become more abstract and require more reasoning than perception . This ranges from small drops ( 3 % to 15 % ) in classification accuracy on ImageNet ( Recht et al. , 2019 ) to accuracy only slightly better than random chance for the Raven Progressive Matrices ( RPM ) test ( a popular Human IQ test ) , when testing data are sampled completely out of the training distribution ( Barrett et al. , 2018 ) . In contrast , human brain is observed to generalise better to unseen inputs ( Geirhos et al. , 2018 ) , and typically requires only a small number of training samples . For example , a human , when trained to recognise that there is a progression relation of circle sizes in Figure 1a , can easily recognise that the same progression relation exists for larger circles in Figure 1b , even though such size comparison has not been done between larger circles . However , today ’ s state-of-the-art neural networks ( Barrett et al. , 2018 ; Wang et al. , 2020 ) are not able to achieve the same . Researchers ( Spelke & Kinzler , 2007 ; Chollet , 2019 ; Battaglia et al. , 2018 ; Xu et al. , 2020 ) argue that the human brain developed special inductive biases that adapt to the form of information processing needed for humans , thereby improving generalisation . Examples include convolution-like cells in the visual cortex ( Hubel & Wiesel , 1959 ; Güçlü & van Gerven , 2015 ) for visual information processing , and grid cells ( Hafting et al. , 2005 ) for spatial information processing and relational comparison between objects ( Battaglia et al. , 2018 ) . In this work , we propose a simple yet effective inductive bias which improves o.o.d generalisation for relational reasoning . We specifically focus on a the type of o.o.d called ‘ extrapolation ’ . For extrapolation tasks , the range of one or more data attributes ( e.g. , object size ) from training and test datasets are ( a ) Small Circles ( b ) Big Circles Figure 1 : Size Progression Relations for circles of different sizes . completely non-overlapping . The proposed inductive bias is inspired by neuroscience and psychology research ( Fitzgerald et al. , 2013 ; Chafee , 2013 ; Summerfield et al. , 2020 ) showing that in primate brain there are neurons in the Parietal Cortex which only responds to different specific attributes of perceived entities . For examples , certain LIP neurons fire at higher rate for larger objects , while the firing rate of other neurons correlates with the horizontal position of objects in the scene ( left vs right ) ( Gong & Liu , 2019 ) . These observations show that these neurons map objects ’ attributes such as size and spatial position to the one-dimensional axis of the neurons ’ firing rate . From a computational perspective , this can be viewed as projecting object representations to different low-dimensional manifolds corresponding to different attributes . Based on these observations ( Summerfield et al. , 2020 ) , we hypothesise that these neurons are developed to learn low-dimensional representations of relational structure that are optimised for abstraction and generalisation , and the same inductive bias can be readily adapted for artificial neural networks to achieve similar optimisation for abstraction and generalisation . We test this hypothesis by designing an inductive bias module which projects high-dimensional object representations into low-dimensional manifolds , and make comparisons between different objects in these manifolds . We show that this module can be readily amalgamated with existing architectures to improve extrapolation performance for different relational reasoning tasks . Specifically , we performed experiments on three different extrapolation tasks , including maximum of a set , visual object comparison on dSprites dataset ( Higgins et al. , 2017 ) and extrapolation on RPM style tasks ( Barrett et al. , 2018 ) . We show that models with the proposed low-dimensional comparators perform considerably better than baseline models on all three tasks . In order to understand the effectiveness of comparing in low-dimensional manifolds , we analyse the projection space and corresponding function space of the comparator to show the importance of projection to low-dimensional manifolds in improving generalisation . Finally , we perform the analysis relating to algorithmic alignment theory ( Xu et al. , 2020 ) , and propose an augmentation to the sample complexity criteria used by this theory to better measure algorithmic alignment with generalisation . 2 METHOD . Here , we describe the inductive bias module we developed to test our hypothesis that the same inductive bias of low-dimensional representation observed in Parietal Cortex can be readily adapted for artificial neural network , thus enabling it to achieve similar optimisation for abstraction and generalisation . The proposed module learns to project object representations into low-dimensional manifolds and make comparisons in these manifolds . In Section 2.1 we describe the module in detail . In Section 2.2 , 2.3 and 2.4 we discuss how this module can be utilised for three different relational reasoning tasks , which are : finding the maximum of a set , visual object comparisons and Raven Progressive Matrics ( RPM ) reasoning . 2.1 COMPARATOR IN LOW-DIMENSIONAL MANIFOLDS . The inductive bias module is comprised of low-dim projection functions p and comparators c. Let { oi ; i ∈ 1 . . . N } be the set of object representations , obtained by extracting features from raw inputs such as applying Convolutional Neural Networks ( CNN ) on images . Pairwise comparison between object pair oi and oj can be achieved with a function f expressed as : f ( oi , oj ) = g ( K || k=1 ck ( pk ( oi ) , pk ( oj ) ) ) . ( 1 ) Here pk is the kth projection function that projects object representation o into the kth low dimensional manifold , ck is the kth comparator function that compares the projected representations , || is the concatenation symbol and g is a function that combines theK comparison results to make a prediction . Having K parallel projection functions pk and comparators ck enables a simultaneous comparison between objects with respect to their different attributes . Figure 2 shows an example of comparing sizes of circles by projection onto a 1-dimensional manifold . Both p and c can be implemented as feed forward neural networks . While the comparator c , implemented as a neural network , can theoretically learn a rich range of comparison metrics , we found that adding to c an additional inductive bias of distance measure for the projection , such as vector distance p ( oi ) − p ( oj ) or absolute distance |p ( oi ) − p ( oj ) | , improves the generalisation performance . Let rt ( oi ) be the ground truth mapping function from ith object ’ s representation oi to its tth attributes ( such as colour and size for a visual object ) . If such ground truth labels of object attributes exist , f ( oi , oj ) can be trained to directly predict the differences in attributes by minimising the loss L ( d ( rt ( oi ) , rt ( oj ) ) , f ( oi , oj ) ) , where d is a distance function ( e.g. , rt ( oi ) − rt ( oj ) for continuous attributes or 1rt ( oi ) =rt ( oj ) for categorical attributes ) . However , in real-world datasets , such ground truth attribute labels seldom exist . Instead , in many relational reasoning tasks , learning signals for attribute comparison are only provided implicitly in the training objective . For example , in Visual Question Answering task , an example question might be ‘ Is the object behind Object A smaller ? ’ . The learning signals for the required size and spatial position comparator are provided only through correctness of the answers to the given questions . Thus , the proposed module is only useful and scalable if it can be integrated into neural architectures for relational reasoning and still learn to compare attributes with the weaker , implicit learning signal . Next , we describe 3 examples of such integrations for different relational reasoning tasks , and show in Section 3 that the proposed module can learn relational reasoning tasks with better generalisation capability . 2.2 ARCHITECTURE : MAXIMUM OF A SET . The first task we consider is finding the maximum of a set of real numbers . Formally , given a set { xi ; i ∈ 1 . . . N } where xi is a real number represented as a scalar value , we want to train a function hmax ( { xi , . . . , xN } ) that gives the maximum value in the set . Many neural architectures have been applied on this task , including Deep Sets ( Zaheer et al. , 2017 ) and Set Transformer ( Lee et al. , 2019 ) , but none of them test ( o.o.d ) generalisation capability . In order to test o.o.d generalisation in the extrapolation scenario , we create the training and test sets such that their ranges do not overlap . We sample from the range ( V trainlow , V train high ) for the training set , and from the range ( V test low , V test high ) for the test set , and restrict that V trainhigh < V test low . We integrate the proposed low-dim comparator module with Set Transformer ( Lee et al. , 2019 ) , a state-of-the-art neural architecture for sets . Set Transformer first encodes each element in the set with respect to all other elements with a Multihead Attention Block ( MAB ) , an attention module modified from self-attention used in language tasks ( Vaswani et al. , 2017 ) : ei = encode ( xi ) = MAB ( xi , xj ) . The Set Transformer then uses Pooling with Multihead Attention ( PMA ) to combine all encoded elements of the set as PMA ( e1 , . . . , eN ) . While MAB uses query and key embeddings to generate attention variables , which are then used as weights in the weight sum of value embeddings of elements , we swap the query-key attention mechanism with our low-dim comparator as : ei =MLP ( N∑ j=1 c ( xi , xj ) ) ( 2 ) Here c is the low-dim comparator and MLP is a standard Multi-Layer Perceptron . Note that we directly use the scalar input xi as object representation oi in Equation ( 1 ) as no feature extraction is needed . We then use attention-based pooling to combine projection of xi as ∑N i=1 a ( ei ) p ( xi ) , where a outputs attention values while p is the 1-dim projection function . For detailed architecture configuration , please refer to Appendix A . | The paper proposes a simple low-dimensional projection and comparison module for extrapolatable relational reasoning. The proposed module first projects object embeddings into lower-dimensional manifolds, compare and concatenate them to form a vector, before finally making a prediction. The paper shows that on the maximum-of-a-set task, the visual-object-comparison task, and the IQ test, the proposed module, when combined with deep models, outperforms existing works in extrapolation. | SP:66cc7af855b0af31f435da307b8c6edf48e80c42 |
Extrapolatable Relational Reasoning With Comparators in Low-Dimensional Manifolds | 1 INTRODUCTION . The goal of Artificial Intelligence research , first proposed in the 1950s and reiterated many times , is to create machine intelligence comparable to that of a human being . While today ’ s deep learning based systems achieve human-comparable performances in specific tasks such as object classification and natural language understanding , they often fail to generalise in out-of-distribution ( o.o.d ) scenarios , where the test data distribution differs from the training data distribution ( Recht et al. , 2019 ; Trask et al. , 2018 ; Barrett et al. , 2018 ; Belinkov & Bisk , 2018 ) . Moreover , it is observed that the generalisation error increases as the tasks become more abstract and require more reasoning than perception . This ranges from small drops ( 3 % to 15 % ) in classification accuracy on ImageNet ( Recht et al. , 2019 ) to accuracy only slightly better than random chance for the Raven Progressive Matrices ( RPM ) test ( a popular Human IQ test ) , when testing data are sampled completely out of the training distribution ( Barrett et al. , 2018 ) . In contrast , human brain is observed to generalise better to unseen inputs ( Geirhos et al. , 2018 ) , and typically requires only a small number of training samples . For example , a human , when trained to recognise that there is a progression relation of circle sizes in Figure 1a , can easily recognise that the same progression relation exists for larger circles in Figure 1b , even though such size comparison has not been done between larger circles . However , today ’ s state-of-the-art neural networks ( Barrett et al. , 2018 ; Wang et al. , 2020 ) are not able to achieve the same . Researchers ( Spelke & Kinzler , 2007 ; Chollet , 2019 ; Battaglia et al. , 2018 ; Xu et al. , 2020 ) argue that the human brain developed special inductive biases that adapt to the form of information processing needed for humans , thereby improving generalisation . Examples include convolution-like cells in the visual cortex ( Hubel & Wiesel , 1959 ; Güçlü & van Gerven , 2015 ) for visual information processing , and grid cells ( Hafting et al. , 2005 ) for spatial information processing and relational comparison between objects ( Battaglia et al. , 2018 ) . In this work , we propose a simple yet effective inductive bias which improves o.o.d generalisation for relational reasoning . We specifically focus on a the type of o.o.d called ‘ extrapolation ’ . For extrapolation tasks , the range of one or more data attributes ( e.g. , object size ) from training and test datasets are ( a ) Small Circles ( b ) Big Circles Figure 1 : Size Progression Relations for circles of different sizes . completely non-overlapping . The proposed inductive bias is inspired by neuroscience and psychology research ( Fitzgerald et al. , 2013 ; Chafee , 2013 ; Summerfield et al. , 2020 ) showing that in primate brain there are neurons in the Parietal Cortex which only responds to different specific attributes of perceived entities . For examples , certain LIP neurons fire at higher rate for larger objects , while the firing rate of other neurons correlates with the horizontal position of objects in the scene ( left vs right ) ( Gong & Liu , 2019 ) . These observations show that these neurons map objects ’ attributes such as size and spatial position to the one-dimensional axis of the neurons ’ firing rate . From a computational perspective , this can be viewed as projecting object representations to different low-dimensional manifolds corresponding to different attributes . Based on these observations ( Summerfield et al. , 2020 ) , we hypothesise that these neurons are developed to learn low-dimensional representations of relational structure that are optimised for abstraction and generalisation , and the same inductive bias can be readily adapted for artificial neural networks to achieve similar optimisation for abstraction and generalisation . We test this hypothesis by designing an inductive bias module which projects high-dimensional object representations into low-dimensional manifolds , and make comparisons between different objects in these manifolds . We show that this module can be readily amalgamated with existing architectures to improve extrapolation performance for different relational reasoning tasks . Specifically , we performed experiments on three different extrapolation tasks , including maximum of a set , visual object comparison on dSprites dataset ( Higgins et al. , 2017 ) and extrapolation on RPM style tasks ( Barrett et al. , 2018 ) . We show that models with the proposed low-dimensional comparators perform considerably better than baseline models on all three tasks . In order to understand the effectiveness of comparing in low-dimensional manifolds , we analyse the projection space and corresponding function space of the comparator to show the importance of projection to low-dimensional manifolds in improving generalisation . Finally , we perform the analysis relating to algorithmic alignment theory ( Xu et al. , 2020 ) , and propose an augmentation to the sample complexity criteria used by this theory to better measure algorithmic alignment with generalisation . 2 METHOD . Here , we describe the inductive bias module we developed to test our hypothesis that the same inductive bias of low-dimensional representation observed in Parietal Cortex can be readily adapted for artificial neural network , thus enabling it to achieve similar optimisation for abstraction and generalisation . The proposed module learns to project object representations into low-dimensional manifolds and make comparisons in these manifolds . In Section 2.1 we describe the module in detail . In Section 2.2 , 2.3 and 2.4 we discuss how this module can be utilised for three different relational reasoning tasks , which are : finding the maximum of a set , visual object comparisons and Raven Progressive Matrics ( RPM ) reasoning . 2.1 COMPARATOR IN LOW-DIMENSIONAL MANIFOLDS . The inductive bias module is comprised of low-dim projection functions p and comparators c. Let { oi ; i ∈ 1 . . . N } be the set of object representations , obtained by extracting features from raw inputs such as applying Convolutional Neural Networks ( CNN ) on images . Pairwise comparison between object pair oi and oj can be achieved with a function f expressed as : f ( oi , oj ) = g ( K || k=1 ck ( pk ( oi ) , pk ( oj ) ) ) . ( 1 ) Here pk is the kth projection function that projects object representation o into the kth low dimensional manifold , ck is the kth comparator function that compares the projected representations , || is the concatenation symbol and g is a function that combines theK comparison results to make a prediction . Having K parallel projection functions pk and comparators ck enables a simultaneous comparison between objects with respect to their different attributes . Figure 2 shows an example of comparing sizes of circles by projection onto a 1-dimensional manifold . Both p and c can be implemented as feed forward neural networks . While the comparator c , implemented as a neural network , can theoretically learn a rich range of comparison metrics , we found that adding to c an additional inductive bias of distance measure for the projection , such as vector distance p ( oi ) − p ( oj ) or absolute distance |p ( oi ) − p ( oj ) | , improves the generalisation performance . Let rt ( oi ) be the ground truth mapping function from ith object ’ s representation oi to its tth attributes ( such as colour and size for a visual object ) . If such ground truth labels of object attributes exist , f ( oi , oj ) can be trained to directly predict the differences in attributes by minimising the loss L ( d ( rt ( oi ) , rt ( oj ) ) , f ( oi , oj ) ) , where d is a distance function ( e.g. , rt ( oi ) − rt ( oj ) for continuous attributes or 1rt ( oi ) =rt ( oj ) for categorical attributes ) . However , in real-world datasets , such ground truth attribute labels seldom exist . Instead , in many relational reasoning tasks , learning signals for attribute comparison are only provided implicitly in the training objective . For example , in Visual Question Answering task , an example question might be ‘ Is the object behind Object A smaller ? ’ . The learning signals for the required size and spatial position comparator are provided only through correctness of the answers to the given questions . Thus , the proposed module is only useful and scalable if it can be integrated into neural architectures for relational reasoning and still learn to compare attributes with the weaker , implicit learning signal . Next , we describe 3 examples of such integrations for different relational reasoning tasks , and show in Section 3 that the proposed module can learn relational reasoning tasks with better generalisation capability . 2.2 ARCHITECTURE : MAXIMUM OF A SET . The first task we consider is finding the maximum of a set of real numbers . Formally , given a set { xi ; i ∈ 1 . . . N } where xi is a real number represented as a scalar value , we want to train a function hmax ( { xi , . . . , xN } ) that gives the maximum value in the set . Many neural architectures have been applied on this task , including Deep Sets ( Zaheer et al. , 2017 ) and Set Transformer ( Lee et al. , 2019 ) , but none of them test ( o.o.d ) generalisation capability . In order to test o.o.d generalisation in the extrapolation scenario , we create the training and test sets such that their ranges do not overlap . We sample from the range ( V trainlow , V train high ) for the training set , and from the range ( V test low , V test high ) for the test set , and restrict that V trainhigh < V test low . We integrate the proposed low-dim comparator module with Set Transformer ( Lee et al. , 2019 ) , a state-of-the-art neural architecture for sets . Set Transformer first encodes each element in the set with respect to all other elements with a Multihead Attention Block ( MAB ) , an attention module modified from self-attention used in language tasks ( Vaswani et al. , 2017 ) : ei = encode ( xi ) = MAB ( xi , xj ) . The Set Transformer then uses Pooling with Multihead Attention ( PMA ) to combine all encoded elements of the set as PMA ( e1 , . . . , eN ) . While MAB uses query and key embeddings to generate attention variables , which are then used as weights in the weight sum of value embeddings of elements , we swap the query-key attention mechanism with our low-dim comparator as : ei =MLP ( N∑ j=1 c ( xi , xj ) ) ( 2 ) Here c is the low-dim comparator and MLP is a standard Multi-Layer Perceptron . Note that we directly use the scalar input xi as object representation oi in Equation ( 1 ) as no feature extraction is needed . We then use attention-based pooling to combine projection of xi as ∑N i=1 a ( ei ) p ( xi ) , where a outputs attention values while p is the 1-dim projection function . For detailed architecture configuration , please refer to Appendix A . | The paper presents two neural network design ideas: low-dimensional projection and arithmetic comparator. By integrating these two ideas into CNNs, the model can solve a set of tasks that require recognizing 1-dimensional properties of objects (such as the size, the color, etc), and making a comparison of these properties. The authors show that their method has strong out-of-distribution generalization: such as generalization to larger objects. | SP:66cc7af855b0af31f435da307b8c6edf48e80c42 |
Extrapolatable Relational Reasoning With Comparators in Low-Dimensional Manifolds | 1 INTRODUCTION . The goal of Artificial Intelligence research , first proposed in the 1950s and reiterated many times , is to create machine intelligence comparable to that of a human being . While today ’ s deep learning based systems achieve human-comparable performances in specific tasks such as object classification and natural language understanding , they often fail to generalise in out-of-distribution ( o.o.d ) scenarios , where the test data distribution differs from the training data distribution ( Recht et al. , 2019 ; Trask et al. , 2018 ; Barrett et al. , 2018 ; Belinkov & Bisk , 2018 ) . Moreover , it is observed that the generalisation error increases as the tasks become more abstract and require more reasoning than perception . This ranges from small drops ( 3 % to 15 % ) in classification accuracy on ImageNet ( Recht et al. , 2019 ) to accuracy only slightly better than random chance for the Raven Progressive Matrices ( RPM ) test ( a popular Human IQ test ) , when testing data are sampled completely out of the training distribution ( Barrett et al. , 2018 ) . In contrast , human brain is observed to generalise better to unseen inputs ( Geirhos et al. , 2018 ) , and typically requires only a small number of training samples . For example , a human , when trained to recognise that there is a progression relation of circle sizes in Figure 1a , can easily recognise that the same progression relation exists for larger circles in Figure 1b , even though such size comparison has not been done between larger circles . However , today ’ s state-of-the-art neural networks ( Barrett et al. , 2018 ; Wang et al. , 2020 ) are not able to achieve the same . Researchers ( Spelke & Kinzler , 2007 ; Chollet , 2019 ; Battaglia et al. , 2018 ; Xu et al. , 2020 ) argue that the human brain developed special inductive biases that adapt to the form of information processing needed for humans , thereby improving generalisation . Examples include convolution-like cells in the visual cortex ( Hubel & Wiesel , 1959 ; Güçlü & van Gerven , 2015 ) for visual information processing , and grid cells ( Hafting et al. , 2005 ) for spatial information processing and relational comparison between objects ( Battaglia et al. , 2018 ) . In this work , we propose a simple yet effective inductive bias which improves o.o.d generalisation for relational reasoning . We specifically focus on a the type of o.o.d called ‘ extrapolation ’ . For extrapolation tasks , the range of one or more data attributes ( e.g. , object size ) from training and test datasets are ( a ) Small Circles ( b ) Big Circles Figure 1 : Size Progression Relations for circles of different sizes . completely non-overlapping . The proposed inductive bias is inspired by neuroscience and psychology research ( Fitzgerald et al. , 2013 ; Chafee , 2013 ; Summerfield et al. , 2020 ) showing that in primate brain there are neurons in the Parietal Cortex which only responds to different specific attributes of perceived entities . For examples , certain LIP neurons fire at higher rate for larger objects , while the firing rate of other neurons correlates with the horizontal position of objects in the scene ( left vs right ) ( Gong & Liu , 2019 ) . These observations show that these neurons map objects ’ attributes such as size and spatial position to the one-dimensional axis of the neurons ’ firing rate . From a computational perspective , this can be viewed as projecting object representations to different low-dimensional manifolds corresponding to different attributes . Based on these observations ( Summerfield et al. , 2020 ) , we hypothesise that these neurons are developed to learn low-dimensional representations of relational structure that are optimised for abstraction and generalisation , and the same inductive bias can be readily adapted for artificial neural networks to achieve similar optimisation for abstraction and generalisation . We test this hypothesis by designing an inductive bias module which projects high-dimensional object representations into low-dimensional manifolds , and make comparisons between different objects in these manifolds . We show that this module can be readily amalgamated with existing architectures to improve extrapolation performance for different relational reasoning tasks . Specifically , we performed experiments on three different extrapolation tasks , including maximum of a set , visual object comparison on dSprites dataset ( Higgins et al. , 2017 ) and extrapolation on RPM style tasks ( Barrett et al. , 2018 ) . We show that models with the proposed low-dimensional comparators perform considerably better than baseline models on all three tasks . In order to understand the effectiveness of comparing in low-dimensional manifolds , we analyse the projection space and corresponding function space of the comparator to show the importance of projection to low-dimensional manifolds in improving generalisation . Finally , we perform the analysis relating to algorithmic alignment theory ( Xu et al. , 2020 ) , and propose an augmentation to the sample complexity criteria used by this theory to better measure algorithmic alignment with generalisation . 2 METHOD . Here , we describe the inductive bias module we developed to test our hypothesis that the same inductive bias of low-dimensional representation observed in Parietal Cortex can be readily adapted for artificial neural network , thus enabling it to achieve similar optimisation for abstraction and generalisation . The proposed module learns to project object representations into low-dimensional manifolds and make comparisons in these manifolds . In Section 2.1 we describe the module in detail . In Section 2.2 , 2.3 and 2.4 we discuss how this module can be utilised for three different relational reasoning tasks , which are : finding the maximum of a set , visual object comparisons and Raven Progressive Matrics ( RPM ) reasoning . 2.1 COMPARATOR IN LOW-DIMENSIONAL MANIFOLDS . The inductive bias module is comprised of low-dim projection functions p and comparators c. Let { oi ; i ∈ 1 . . . N } be the set of object representations , obtained by extracting features from raw inputs such as applying Convolutional Neural Networks ( CNN ) on images . Pairwise comparison between object pair oi and oj can be achieved with a function f expressed as : f ( oi , oj ) = g ( K || k=1 ck ( pk ( oi ) , pk ( oj ) ) ) . ( 1 ) Here pk is the kth projection function that projects object representation o into the kth low dimensional manifold , ck is the kth comparator function that compares the projected representations , || is the concatenation symbol and g is a function that combines theK comparison results to make a prediction . Having K parallel projection functions pk and comparators ck enables a simultaneous comparison between objects with respect to their different attributes . Figure 2 shows an example of comparing sizes of circles by projection onto a 1-dimensional manifold . Both p and c can be implemented as feed forward neural networks . While the comparator c , implemented as a neural network , can theoretically learn a rich range of comparison metrics , we found that adding to c an additional inductive bias of distance measure for the projection , such as vector distance p ( oi ) − p ( oj ) or absolute distance |p ( oi ) − p ( oj ) | , improves the generalisation performance . Let rt ( oi ) be the ground truth mapping function from ith object ’ s representation oi to its tth attributes ( such as colour and size for a visual object ) . If such ground truth labels of object attributes exist , f ( oi , oj ) can be trained to directly predict the differences in attributes by minimising the loss L ( d ( rt ( oi ) , rt ( oj ) ) , f ( oi , oj ) ) , where d is a distance function ( e.g. , rt ( oi ) − rt ( oj ) for continuous attributes or 1rt ( oi ) =rt ( oj ) for categorical attributes ) . However , in real-world datasets , such ground truth attribute labels seldom exist . Instead , in many relational reasoning tasks , learning signals for attribute comparison are only provided implicitly in the training objective . For example , in Visual Question Answering task , an example question might be ‘ Is the object behind Object A smaller ? ’ . The learning signals for the required size and spatial position comparator are provided only through correctness of the answers to the given questions . Thus , the proposed module is only useful and scalable if it can be integrated into neural architectures for relational reasoning and still learn to compare attributes with the weaker , implicit learning signal . Next , we describe 3 examples of such integrations for different relational reasoning tasks , and show in Section 3 that the proposed module can learn relational reasoning tasks with better generalisation capability . 2.2 ARCHITECTURE : MAXIMUM OF A SET . The first task we consider is finding the maximum of a set of real numbers . Formally , given a set { xi ; i ∈ 1 . . . N } where xi is a real number represented as a scalar value , we want to train a function hmax ( { xi , . . . , xN } ) that gives the maximum value in the set . Many neural architectures have been applied on this task , including Deep Sets ( Zaheer et al. , 2017 ) and Set Transformer ( Lee et al. , 2019 ) , but none of them test ( o.o.d ) generalisation capability . In order to test o.o.d generalisation in the extrapolation scenario , we create the training and test sets such that their ranges do not overlap . We sample from the range ( V trainlow , V train high ) for the training set , and from the range ( V test low , V test high ) for the test set , and restrict that V trainhigh < V test low . We integrate the proposed low-dim comparator module with Set Transformer ( Lee et al. , 2019 ) , a state-of-the-art neural architecture for sets . Set Transformer first encodes each element in the set with respect to all other elements with a Multihead Attention Block ( MAB ) , an attention module modified from self-attention used in language tasks ( Vaswani et al. , 2017 ) : ei = encode ( xi ) = MAB ( xi , xj ) . The Set Transformer then uses Pooling with Multihead Attention ( PMA ) to combine all encoded elements of the set as PMA ( e1 , . . . , eN ) . While MAB uses query and key embeddings to generate attention variables , which are then used as weights in the weight sum of value embeddings of elements , we swap the query-key attention mechanism with our low-dim comparator as : ei =MLP ( N∑ j=1 c ( xi , xj ) ) ( 2 ) Here c is the low-dim comparator and MLP is a standard Multi-Layer Perceptron . Note that we directly use the scalar input xi as object representation oi in Equation ( 1 ) as no feature extraction is needed . We then use attention-based pooling to combine projection of xi as ∑N i=1 a ( ei ) p ( xi ) , where a outputs attention values while p is the 1-dim projection function . For detailed architecture configuration , please refer to Appendix A . | This paper addresses an inductive bias for relational reasoning tasks to improve generalization performance on out-of-distribution scenarios (so called extrapolation), which the value ranges (continuous variables) or value itself (discrete variables) of the training/test dataset do not overlap. The proposed idea is to project high-dimensional representations onto low-dimensional space and compare those of the targets of relational reasoning. To validate effectiveness of the idea, the authors provide the improved results on three problems: (1) finding the maximum of a set of real numbers, (2) comparing the attributes of visual objects with dSprites dataset, and (3) visual reasoning with Raven progressive matrices (RPM) based on the PGM dataset. The experimental results of each show better performance than other baseline methods. This research deals with one of important topics in AI/ML research. Out-of-distribution generalization is potentially extended to world models, common sense reasoning, learning and reasoning with small number of instances, and abstraction capability of human intelligence. As Section of related work in this paper also mentions these points, it is understandable to figure out the position of this work. | SP:66cc7af855b0af31f435da307b8c6edf48e80c42 |
Provably robust classification of adversarial examples with detection | 1 INTRODUCTION . Despite popularity and success of deep neural networks in many applications , their performance declines sharply in adversarial settings . Small adversarial perturbations are shown to greatly deteriorate the performance of neural network classifiers , which creates a growing concern for utilizing them in safety critical application where robust performance is key . In adversarial training , different methods with varying levels of computational complexity aim at robustifying the network by finding such adversarial examples at each training steps and adding them to the training dataset . While such methods exhibit empirical robustness , they lack verifiable guarantees as it is not provable that a more rigorous adversary , e.g. , one that does brute-force enumeration to compute adversarial perturbations , will not be able to cause the classifier to misclassify . It is thus desirable to provably verify the performance of robust classifiers without restricting the adversarial perturbations by inexact solvers , while restraining perturbations to a class of admissible set , e.g. , within an ` ∞ norm-bounded ball . Progress has been made by ‘ complete methods ’ that use Satisfiability Modulo Theory ( SMT ) or Mixed-Integer Programming ( MIP ) to provide exact robustness bounds , however , such approaches are expensive , and difficult to scale to large networks as exhaustive enumeration in the worst case is required ( Tjeng et al. , 2017 ; Ehlers , 2017 ; Xiao et al. , 2018 ) . ∗Work was done when the author was an intern at Bosch Center for Artificial Intelligence , Pittsburgh , PA. ‘ Incomplete methods ’ on the other hand , proceed by computing a differential upper bound on the worst-case adversarial loss , and similarly for the verification violations , with lower computational complexity and improved scalability . Such upper bounds , if easy to compute , can be utilized during the training , and yield provably robust networks with tight bounds . In particular , bound propagation via various methods such as differentiable geometric abstractions ( Mirman et al. , 2018 ) , convex polytope relaxation ( Wong & Kolter , 2018 ) , and more recently in ( Salman et al. , 2019 ; Balunovic & Vechev , 2020 ; Gowal et al. , 2018 ; Zhang et al. , 2020 ) , together with other techniques such as semidefinite relaxation , ( Fazlyab et al. , 2019 ; Raghunathan et al. , 2018 ) , and dual solutions via additional verifier networks ( Dvijotham et al. , 2018 ) fall within this category . In particular , recent successful use of Interval Bound Propagation ( IBP ) as a simple layer-by-layer bound propagation mechanism was shown to be very effective in Gowal et al . ( 2018 ) , which despite its light computational complexity exhibits SOTA robustness verification . Additionally , combining IBP in a forward bounding pass with linear relaxation based backward bounding pass ( CROWN ) Zhang et al . ( 2020 ) leads to improved robustness , although it can be up to 3-10 times slower . Alternative to robust classification , detection of adversarial examples can also provide robustness against adversarial attacks , where suspicious inputs will be flagged and the classifier “ rejects/abstains ” from assigning a label . There has been some work on detection of out-of-distribution examples Bitterwolf et al . ( 2020 ) , however the situation in the literature on the detection of adversarial examples is quite different from above . Most techniques that attempt to detect adversarial examples , either by training explicit classifiers to do so or by simply formulating “ hand-tuned ” detectors , still largely look to identify and exploit statistical properties of adversarial examples that appear in practice Smith & Gal ( 2018 ) ; Roth et al . ( 2019 ) . However , to provide a fair evaluation , a defense must be evaluated under attackers that attempt to fool both the classifier and the detector , while addressing particular characteristics of a given defense , e.g. , gradient obfuscation , non-differentability , randomization , and simplifying the attacker ’ s objective for increased efficiency . A non-exhaustive list of recent detection methods entails randomization and sparsity-based defenses ( Xiao et al. , 2019 ; Roth et al. , 2019 ; Pang et al. , 2019b ) , confidence and uncertainty-based detection ( Smith & Gal , 2018 ; Stutz et al. , 2020 ; Sheikholeslami et al. , 2020 ) , transformation-based defenses ( Bafna et al. , 2018 ; Yang et al. , 2019 ) , ensemble methods ( Verma & Swami , 2019 ; Pang et al. , 2019a ) , generative adversarial training Yin et al . ( 2020 ) , and many more . Unfortunately , existing defenses have largely proven to have poor performance against adaptive attacks ( Athalye et al. , 2018 ; Tramer et al. , 2020 ) , necessitating provable guarantees on detectors as well . Recently Laidlaw & Feizi ( 2019 ) have proposed joint training of classifier and detector , however it also does not provided any provable guarantees . Our contribution . In this work , we propose a new method for jointly training a provably robust classifier and detector . Specifically , by introducing an additional “ abstain/detection ” into a classifier , we show that the existing certified defense mechanisms can be modified , and by building on the detection capability of the network , classifier can effectively choose to either robustly classify or detect adversarial attacks . We extend the light-weight Interval Bound Propagation ( IBP ) method to account for our new robust objective , enabling verification of the network for provable performance guarantees . Our proposed robust training objective is also effectively upper bounded , enabling its incorporation into the training procedure leading to tight provably robust performance . While tightening of the bound propagation may be additionally possible for tighter verification , to the best of our knowledge , our approach is the first method to extend certification techniques by considering detection while providing provable verification . By stabilizing the training , as also used in similar IBP-based methods , experiments on MNIST and CIFAR-10 empirically show that the proposed method can successfully leverage its detection capability , and improves traditional IBP used in isolation , especially for large perturbation sizes . 2 BACKGROUND AND RELATED WORK . Let us consider an L-layer feed-forward neural network , trained for a K-class classification task . Given input x , it will pass through a sequential model , with hl denoting the mapping at layer l , recursively parameterized by zl = hl ( zl−1 ) = σl ( W > l zl−1 + bl ) , l = 1 , · · · , L Wl ∈ Rnl−1×nl , bl ∈ Rnl ( 1 ) where σl ( . ) is a monotonic activation function , z0 denotes the input , and zL ∈ RK is the preactivation unnormalized K-dimensional output vector ( nL = K and σL ( . ) as identity operator ) , referred to as the logits . Robust classifiers can be obtained by minimizing the worst-case ( adversarial ) classification loss , formally trained by the following min-max optimization Madry et al . ( 2017 ) minimize θ E ( x , y ) ∼D [ max δ∈∆ ` ( fθ ( x + δ ) , y ) ] . ( 2 ) where θ denotes network parameters , vector fθ ( x ) = zL is the logit output for input x , ` ( . ) is the misclassfication loss , e.g. , ` xent ( . ) defined as the cross-entropy loss , and ∆ denotes the set of permissible perturbations , e.g. , for ` ∞-norm ball of radius giving ∆ : = { δ | ‖δ‖∞ ≤ } . Although augmenting the training set with adversarial inputs , obtained by approximately solving the inner maximization in Eq . 2 , empirically leads to improved adversarial robustness Madry et al . ( 2017 ) ; Shafahi et al . ( 2019 ) ; Wong et al . ( 2019 ) ; Zhang et al . ( 2019 ) , inexact solution of the inner maximization prevents such methods from providing provable guarantees . In critical applications however , provable verification of classification accuracy against a given threat model is crucial . 2.1 PERFORMANCE VERIFICATION AND NETWORK RELAXATION . Given input ( x , y ) , a classification network is considered verifiably robust if all of its perturbed variations , that is x + δ for ∀δ ∈ ∆ , are correctly classified as class y . Such verification can be effectively obtained by p∗i = min zL∈ZL c > y , izL where , ZL : = { zL|zl = hl ( zl−1 ) , l = 1 , ... , L , z0 = x + δ , ∀δ ∈ ∆ } where cy , i = ey − ei for i = 1 , 2 , .. , K , i 6= y , and ei is the standard ith canonical basis vector . If p∗i > 0 ∀i 6= y , then the classifier is verifiably robust at point ( x , y ) as this guarantees that zi ≤ zy ∀i 6= y for all admissible perturbations δ ∈ ∆ . The feasible set ZL is generally nonconvex , rendering obtaining p∗i intractable . Any convex relaxation ofZL however , will provide a lower bound on p∗i , and can be alternatively used for verification . As outlined in Section 1 , various relaxation techniques have been proposed in the literature . Specifically , IBP in ( Mirman et al. , 2018 ; Gowal et al. , 2018 ) proceeds by bounding the activation zl of each layer by propagating an element-wise bounding box using interval arithmetic for networks with monotonic activation functions . Despite its simplicity and relatively small computational complexity ( computational requirements for bound propagation for a given input using IBP is equal to two forward passes of the input ) , it can provide tight bounds once the network is trained accordingly . Specifically , starting from the input layer z0 , it can be bounded for the perturbation class δ ∈ ∆ as z0 = x− 1 and z0 = x + 1 , and zl for the following layers can be bounded as zl = σl ( W > l zl−1 + zl−1 2 − |W > l | zl−1 − zl−1 2 ) , zl = σl ( W > l zl−1 + zl−1 2 + |W > l | zl−1 − zl−1 2 ) , ( 3 ) where | · | is the element-wise absolute-value operator . The verification problem over the relaxed feasible set ẐL : = { zL | zL , i ≤ zL , i ≤ z̄L , i } , where ZL ⊆ ẐL is then easily solved as p∗i = min zL∈ZL c > y , izL ≥ min zL∈ẐL c > y , izL = zL , y − z̄L , i . ( 4 ) 2.2 ROBUST TRAINING OF VERIFIABLE NETWORKS . It has been shown that convex relaxation ofZL can also provide a tractable upper bound on the inner maximization in Eq . 2 . While this holds for various relaxation techniques , focusing on the IBP let us define JIBP , θ ( x , y ) : = [ J IBP 1 , J IBP 2 , ... , J IBP K ] where J IBP i : = min zL∈ẐL c > y , izL ( 5 ) with ( θ , ) implicitly influencing ẐL ( dropped for brevity ) , and upperbound the inner-max in Eq . 2 max δ∈∆ ` xent ( fθ ( x + δ ) , y ) ≤ ` xent ( −JIBP , θ ( x , y ) , y ) , ` xent ( z , c ) : = − log ( exp ( zc ) ∑ i exp ( zi ) ) ( 6 ) By using this tractable upper bound of the robust optimization , network can now be trained by minimize θ ∑ ( x , y ) ∈D ( 1− κ ) ` xent ( −JIBP , θ ( x , y ) , y ) + κγ ` xent ( fθ ( x ) , y ) , ( 7 ) where γ trades natural versus robust accuracy , and κ is scheduled through a ramp-down process to stabilize the training and tightening of IBP Gowal et al . ( 2018 ) ( where γ = 1 is selected therein ) . | This paper aims to train networks that can map a possibly $\ell_\infty$-perturbed input to its class provably or map this input to the “abstain class” provably. This is achieved by training on the IBP output boxes together with a new loss function. The method diverts from the classical setting in which the classifier needs to be robust, by allowing the classifier to abstain. While this is an interesting idea, the paper seems to be rushed and not carefully written. The notation could be improved and presentation could be simplified. It seems as if the results from related work (Balunovic et. al. [3] and Mirman et. al. [4]) are missing in Table 1 and thus are not compared against. Further, some questions remain open after reading the paper: | SP:a6006c32d8bdbbd5f9d30303e688f9a0266ad29e |
Provably robust classification of adversarial examples with detection | 1 INTRODUCTION . Despite popularity and success of deep neural networks in many applications , their performance declines sharply in adversarial settings . Small adversarial perturbations are shown to greatly deteriorate the performance of neural network classifiers , which creates a growing concern for utilizing them in safety critical application where robust performance is key . In adversarial training , different methods with varying levels of computational complexity aim at robustifying the network by finding such adversarial examples at each training steps and adding them to the training dataset . While such methods exhibit empirical robustness , they lack verifiable guarantees as it is not provable that a more rigorous adversary , e.g. , one that does brute-force enumeration to compute adversarial perturbations , will not be able to cause the classifier to misclassify . It is thus desirable to provably verify the performance of robust classifiers without restricting the adversarial perturbations by inexact solvers , while restraining perturbations to a class of admissible set , e.g. , within an ` ∞ norm-bounded ball . Progress has been made by ‘ complete methods ’ that use Satisfiability Modulo Theory ( SMT ) or Mixed-Integer Programming ( MIP ) to provide exact robustness bounds , however , such approaches are expensive , and difficult to scale to large networks as exhaustive enumeration in the worst case is required ( Tjeng et al. , 2017 ; Ehlers , 2017 ; Xiao et al. , 2018 ) . ∗Work was done when the author was an intern at Bosch Center for Artificial Intelligence , Pittsburgh , PA. ‘ Incomplete methods ’ on the other hand , proceed by computing a differential upper bound on the worst-case adversarial loss , and similarly for the verification violations , with lower computational complexity and improved scalability . Such upper bounds , if easy to compute , can be utilized during the training , and yield provably robust networks with tight bounds . In particular , bound propagation via various methods such as differentiable geometric abstractions ( Mirman et al. , 2018 ) , convex polytope relaxation ( Wong & Kolter , 2018 ) , and more recently in ( Salman et al. , 2019 ; Balunovic & Vechev , 2020 ; Gowal et al. , 2018 ; Zhang et al. , 2020 ) , together with other techniques such as semidefinite relaxation , ( Fazlyab et al. , 2019 ; Raghunathan et al. , 2018 ) , and dual solutions via additional verifier networks ( Dvijotham et al. , 2018 ) fall within this category . In particular , recent successful use of Interval Bound Propagation ( IBP ) as a simple layer-by-layer bound propagation mechanism was shown to be very effective in Gowal et al . ( 2018 ) , which despite its light computational complexity exhibits SOTA robustness verification . Additionally , combining IBP in a forward bounding pass with linear relaxation based backward bounding pass ( CROWN ) Zhang et al . ( 2020 ) leads to improved robustness , although it can be up to 3-10 times slower . Alternative to robust classification , detection of adversarial examples can also provide robustness against adversarial attacks , where suspicious inputs will be flagged and the classifier “ rejects/abstains ” from assigning a label . There has been some work on detection of out-of-distribution examples Bitterwolf et al . ( 2020 ) , however the situation in the literature on the detection of adversarial examples is quite different from above . Most techniques that attempt to detect adversarial examples , either by training explicit classifiers to do so or by simply formulating “ hand-tuned ” detectors , still largely look to identify and exploit statistical properties of adversarial examples that appear in practice Smith & Gal ( 2018 ) ; Roth et al . ( 2019 ) . However , to provide a fair evaluation , a defense must be evaluated under attackers that attempt to fool both the classifier and the detector , while addressing particular characteristics of a given defense , e.g. , gradient obfuscation , non-differentability , randomization , and simplifying the attacker ’ s objective for increased efficiency . A non-exhaustive list of recent detection methods entails randomization and sparsity-based defenses ( Xiao et al. , 2019 ; Roth et al. , 2019 ; Pang et al. , 2019b ) , confidence and uncertainty-based detection ( Smith & Gal , 2018 ; Stutz et al. , 2020 ; Sheikholeslami et al. , 2020 ) , transformation-based defenses ( Bafna et al. , 2018 ; Yang et al. , 2019 ) , ensemble methods ( Verma & Swami , 2019 ; Pang et al. , 2019a ) , generative adversarial training Yin et al . ( 2020 ) , and many more . Unfortunately , existing defenses have largely proven to have poor performance against adaptive attacks ( Athalye et al. , 2018 ; Tramer et al. , 2020 ) , necessitating provable guarantees on detectors as well . Recently Laidlaw & Feizi ( 2019 ) have proposed joint training of classifier and detector , however it also does not provided any provable guarantees . Our contribution . In this work , we propose a new method for jointly training a provably robust classifier and detector . Specifically , by introducing an additional “ abstain/detection ” into a classifier , we show that the existing certified defense mechanisms can be modified , and by building on the detection capability of the network , classifier can effectively choose to either robustly classify or detect adversarial attacks . We extend the light-weight Interval Bound Propagation ( IBP ) method to account for our new robust objective , enabling verification of the network for provable performance guarantees . Our proposed robust training objective is also effectively upper bounded , enabling its incorporation into the training procedure leading to tight provably robust performance . While tightening of the bound propagation may be additionally possible for tighter verification , to the best of our knowledge , our approach is the first method to extend certification techniques by considering detection while providing provable verification . By stabilizing the training , as also used in similar IBP-based methods , experiments on MNIST and CIFAR-10 empirically show that the proposed method can successfully leverage its detection capability , and improves traditional IBP used in isolation , especially for large perturbation sizes . 2 BACKGROUND AND RELATED WORK . Let us consider an L-layer feed-forward neural network , trained for a K-class classification task . Given input x , it will pass through a sequential model , with hl denoting the mapping at layer l , recursively parameterized by zl = hl ( zl−1 ) = σl ( W > l zl−1 + bl ) , l = 1 , · · · , L Wl ∈ Rnl−1×nl , bl ∈ Rnl ( 1 ) where σl ( . ) is a monotonic activation function , z0 denotes the input , and zL ∈ RK is the preactivation unnormalized K-dimensional output vector ( nL = K and σL ( . ) as identity operator ) , referred to as the logits . Robust classifiers can be obtained by minimizing the worst-case ( adversarial ) classification loss , formally trained by the following min-max optimization Madry et al . ( 2017 ) minimize θ E ( x , y ) ∼D [ max δ∈∆ ` ( fθ ( x + δ ) , y ) ] . ( 2 ) where θ denotes network parameters , vector fθ ( x ) = zL is the logit output for input x , ` ( . ) is the misclassfication loss , e.g. , ` xent ( . ) defined as the cross-entropy loss , and ∆ denotes the set of permissible perturbations , e.g. , for ` ∞-norm ball of radius giving ∆ : = { δ | ‖δ‖∞ ≤ } . Although augmenting the training set with adversarial inputs , obtained by approximately solving the inner maximization in Eq . 2 , empirically leads to improved adversarial robustness Madry et al . ( 2017 ) ; Shafahi et al . ( 2019 ) ; Wong et al . ( 2019 ) ; Zhang et al . ( 2019 ) , inexact solution of the inner maximization prevents such methods from providing provable guarantees . In critical applications however , provable verification of classification accuracy against a given threat model is crucial . 2.1 PERFORMANCE VERIFICATION AND NETWORK RELAXATION . Given input ( x , y ) , a classification network is considered verifiably robust if all of its perturbed variations , that is x + δ for ∀δ ∈ ∆ , are correctly classified as class y . Such verification can be effectively obtained by p∗i = min zL∈ZL c > y , izL where , ZL : = { zL|zl = hl ( zl−1 ) , l = 1 , ... , L , z0 = x + δ , ∀δ ∈ ∆ } where cy , i = ey − ei for i = 1 , 2 , .. , K , i 6= y , and ei is the standard ith canonical basis vector . If p∗i > 0 ∀i 6= y , then the classifier is verifiably robust at point ( x , y ) as this guarantees that zi ≤ zy ∀i 6= y for all admissible perturbations δ ∈ ∆ . The feasible set ZL is generally nonconvex , rendering obtaining p∗i intractable . Any convex relaxation ofZL however , will provide a lower bound on p∗i , and can be alternatively used for verification . As outlined in Section 1 , various relaxation techniques have been proposed in the literature . Specifically , IBP in ( Mirman et al. , 2018 ; Gowal et al. , 2018 ) proceeds by bounding the activation zl of each layer by propagating an element-wise bounding box using interval arithmetic for networks with monotonic activation functions . Despite its simplicity and relatively small computational complexity ( computational requirements for bound propagation for a given input using IBP is equal to two forward passes of the input ) , it can provide tight bounds once the network is trained accordingly . Specifically , starting from the input layer z0 , it can be bounded for the perturbation class δ ∈ ∆ as z0 = x− 1 and z0 = x + 1 , and zl for the following layers can be bounded as zl = σl ( W > l zl−1 + zl−1 2 − |W > l | zl−1 − zl−1 2 ) , zl = σl ( W > l zl−1 + zl−1 2 + |W > l | zl−1 − zl−1 2 ) , ( 3 ) where | · | is the element-wise absolute-value operator . The verification problem over the relaxed feasible set ẐL : = { zL | zL , i ≤ zL , i ≤ z̄L , i } , where ZL ⊆ ẐL is then easily solved as p∗i = min zL∈ZL c > y , izL ≥ min zL∈ẐL c > y , izL = zL , y − z̄L , i . ( 4 ) 2.2 ROBUST TRAINING OF VERIFIABLE NETWORKS . It has been shown that convex relaxation ofZL can also provide a tractable upper bound on the inner maximization in Eq . 2 . While this holds for various relaxation techniques , focusing on the IBP let us define JIBP , θ ( x , y ) : = [ J IBP 1 , J IBP 2 , ... , J IBP K ] where J IBP i : = min zL∈ẐL c > y , izL ( 5 ) with ( θ , ) implicitly influencing ẐL ( dropped for brevity ) , and upperbound the inner-max in Eq . 2 max δ∈∆ ` xent ( fθ ( x + δ ) , y ) ≤ ` xent ( −JIBP , θ ( x , y ) , y ) , ` xent ( z , c ) : = − log ( exp ( zc ) ∑ i exp ( zi ) ) ( 6 ) By using this tractable upper bound of the robust optimization , network can now be trained by minimize θ ∑ ( x , y ) ∈D ( 1− κ ) ` xent ( −JIBP , θ ( x , y ) , y ) + κγ ` xent ( fθ ( x ) , y ) , ( 7 ) where γ trades natural versus robust accuracy , and κ is scheduled through a ramp-down process to stabilize the training and tightening of IBP Gowal et al . ( 2018 ) ( where γ = 1 is selected therein ) . | This paper deals with the problem of bounding the amount of errors that a model can make when attacked by an adversary limited to small perturbation of an input image. Similarly to previous paper, it proposes to extend the classifier with a detector to identify adversarial examples. As opposed to previous papers, the authors suggest to perform formal verification to prove that the samples are either robustly classified or abstained on (as opposed to testing the classifier + detector adversarially which would have left open the question of whether or not the attack against the pair was done in an adequate way). The method used for this is based on the simple IBP algorithm but the authors propose a proper encoding of the max(abstain_logit, gt_logit). They also follow the IBP strategy of using the bound resulting from verification as part of the training objective in order to encourage the network to behave properly. | SP:a6006c32d8bdbbd5f9d30303e688f9a0266ad29e |
Provably robust classification of adversarial examples with detection | 1 INTRODUCTION . Despite popularity and success of deep neural networks in many applications , their performance declines sharply in adversarial settings . Small adversarial perturbations are shown to greatly deteriorate the performance of neural network classifiers , which creates a growing concern for utilizing them in safety critical application where robust performance is key . In adversarial training , different methods with varying levels of computational complexity aim at robustifying the network by finding such adversarial examples at each training steps and adding them to the training dataset . While such methods exhibit empirical robustness , they lack verifiable guarantees as it is not provable that a more rigorous adversary , e.g. , one that does brute-force enumeration to compute adversarial perturbations , will not be able to cause the classifier to misclassify . It is thus desirable to provably verify the performance of robust classifiers without restricting the adversarial perturbations by inexact solvers , while restraining perturbations to a class of admissible set , e.g. , within an ` ∞ norm-bounded ball . Progress has been made by ‘ complete methods ’ that use Satisfiability Modulo Theory ( SMT ) or Mixed-Integer Programming ( MIP ) to provide exact robustness bounds , however , such approaches are expensive , and difficult to scale to large networks as exhaustive enumeration in the worst case is required ( Tjeng et al. , 2017 ; Ehlers , 2017 ; Xiao et al. , 2018 ) . ∗Work was done when the author was an intern at Bosch Center for Artificial Intelligence , Pittsburgh , PA. ‘ Incomplete methods ’ on the other hand , proceed by computing a differential upper bound on the worst-case adversarial loss , and similarly for the verification violations , with lower computational complexity and improved scalability . Such upper bounds , if easy to compute , can be utilized during the training , and yield provably robust networks with tight bounds . In particular , bound propagation via various methods such as differentiable geometric abstractions ( Mirman et al. , 2018 ) , convex polytope relaxation ( Wong & Kolter , 2018 ) , and more recently in ( Salman et al. , 2019 ; Balunovic & Vechev , 2020 ; Gowal et al. , 2018 ; Zhang et al. , 2020 ) , together with other techniques such as semidefinite relaxation , ( Fazlyab et al. , 2019 ; Raghunathan et al. , 2018 ) , and dual solutions via additional verifier networks ( Dvijotham et al. , 2018 ) fall within this category . In particular , recent successful use of Interval Bound Propagation ( IBP ) as a simple layer-by-layer bound propagation mechanism was shown to be very effective in Gowal et al . ( 2018 ) , which despite its light computational complexity exhibits SOTA robustness verification . Additionally , combining IBP in a forward bounding pass with linear relaxation based backward bounding pass ( CROWN ) Zhang et al . ( 2020 ) leads to improved robustness , although it can be up to 3-10 times slower . Alternative to robust classification , detection of adversarial examples can also provide robustness against adversarial attacks , where suspicious inputs will be flagged and the classifier “ rejects/abstains ” from assigning a label . There has been some work on detection of out-of-distribution examples Bitterwolf et al . ( 2020 ) , however the situation in the literature on the detection of adversarial examples is quite different from above . Most techniques that attempt to detect adversarial examples , either by training explicit classifiers to do so or by simply formulating “ hand-tuned ” detectors , still largely look to identify and exploit statistical properties of adversarial examples that appear in practice Smith & Gal ( 2018 ) ; Roth et al . ( 2019 ) . However , to provide a fair evaluation , a defense must be evaluated under attackers that attempt to fool both the classifier and the detector , while addressing particular characteristics of a given defense , e.g. , gradient obfuscation , non-differentability , randomization , and simplifying the attacker ’ s objective for increased efficiency . A non-exhaustive list of recent detection methods entails randomization and sparsity-based defenses ( Xiao et al. , 2019 ; Roth et al. , 2019 ; Pang et al. , 2019b ) , confidence and uncertainty-based detection ( Smith & Gal , 2018 ; Stutz et al. , 2020 ; Sheikholeslami et al. , 2020 ) , transformation-based defenses ( Bafna et al. , 2018 ; Yang et al. , 2019 ) , ensemble methods ( Verma & Swami , 2019 ; Pang et al. , 2019a ) , generative adversarial training Yin et al . ( 2020 ) , and many more . Unfortunately , existing defenses have largely proven to have poor performance against adaptive attacks ( Athalye et al. , 2018 ; Tramer et al. , 2020 ) , necessitating provable guarantees on detectors as well . Recently Laidlaw & Feizi ( 2019 ) have proposed joint training of classifier and detector , however it also does not provided any provable guarantees . Our contribution . In this work , we propose a new method for jointly training a provably robust classifier and detector . Specifically , by introducing an additional “ abstain/detection ” into a classifier , we show that the existing certified defense mechanisms can be modified , and by building on the detection capability of the network , classifier can effectively choose to either robustly classify or detect adversarial attacks . We extend the light-weight Interval Bound Propagation ( IBP ) method to account for our new robust objective , enabling verification of the network for provable performance guarantees . Our proposed robust training objective is also effectively upper bounded , enabling its incorporation into the training procedure leading to tight provably robust performance . While tightening of the bound propagation may be additionally possible for tighter verification , to the best of our knowledge , our approach is the first method to extend certification techniques by considering detection while providing provable verification . By stabilizing the training , as also used in similar IBP-based methods , experiments on MNIST and CIFAR-10 empirically show that the proposed method can successfully leverage its detection capability , and improves traditional IBP used in isolation , especially for large perturbation sizes . 2 BACKGROUND AND RELATED WORK . Let us consider an L-layer feed-forward neural network , trained for a K-class classification task . Given input x , it will pass through a sequential model , with hl denoting the mapping at layer l , recursively parameterized by zl = hl ( zl−1 ) = σl ( W > l zl−1 + bl ) , l = 1 , · · · , L Wl ∈ Rnl−1×nl , bl ∈ Rnl ( 1 ) where σl ( . ) is a monotonic activation function , z0 denotes the input , and zL ∈ RK is the preactivation unnormalized K-dimensional output vector ( nL = K and σL ( . ) as identity operator ) , referred to as the logits . Robust classifiers can be obtained by minimizing the worst-case ( adversarial ) classification loss , formally trained by the following min-max optimization Madry et al . ( 2017 ) minimize θ E ( x , y ) ∼D [ max δ∈∆ ` ( fθ ( x + δ ) , y ) ] . ( 2 ) where θ denotes network parameters , vector fθ ( x ) = zL is the logit output for input x , ` ( . ) is the misclassfication loss , e.g. , ` xent ( . ) defined as the cross-entropy loss , and ∆ denotes the set of permissible perturbations , e.g. , for ` ∞-norm ball of radius giving ∆ : = { δ | ‖δ‖∞ ≤ } . Although augmenting the training set with adversarial inputs , obtained by approximately solving the inner maximization in Eq . 2 , empirically leads to improved adversarial robustness Madry et al . ( 2017 ) ; Shafahi et al . ( 2019 ) ; Wong et al . ( 2019 ) ; Zhang et al . ( 2019 ) , inexact solution of the inner maximization prevents such methods from providing provable guarantees . In critical applications however , provable verification of classification accuracy against a given threat model is crucial . 2.1 PERFORMANCE VERIFICATION AND NETWORK RELAXATION . Given input ( x , y ) , a classification network is considered verifiably robust if all of its perturbed variations , that is x + δ for ∀δ ∈ ∆ , are correctly classified as class y . Such verification can be effectively obtained by p∗i = min zL∈ZL c > y , izL where , ZL : = { zL|zl = hl ( zl−1 ) , l = 1 , ... , L , z0 = x + δ , ∀δ ∈ ∆ } where cy , i = ey − ei for i = 1 , 2 , .. , K , i 6= y , and ei is the standard ith canonical basis vector . If p∗i > 0 ∀i 6= y , then the classifier is verifiably robust at point ( x , y ) as this guarantees that zi ≤ zy ∀i 6= y for all admissible perturbations δ ∈ ∆ . The feasible set ZL is generally nonconvex , rendering obtaining p∗i intractable . Any convex relaxation ofZL however , will provide a lower bound on p∗i , and can be alternatively used for verification . As outlined in Section 1 , various relaxation techniques have been proposed in the literature . Specifically , IBP in ( Mirman et al. , 2018 ; Gowal et al. , 2018 ) proceeds by bounding the activation zl of each layer by propagating an element-wise bounding box using interval arithmetic for networks with monotonic activation functions . Despite its simplicity and relatively small computational complexity ( computational requirements for bound propagation for a given input using IBP is equal to two forward passes of the input ) , it can provide tight bounds once the network is trained accordingly . Specifically , starting from the input layer z0 , it can be bounded for the perturbation class δ ∈ ∆ as z0 = x− 1 and z0 = x + 1 , and zl for the following layers can be bounded as zl = σl ( W > l zl−1 + zl−1 2 − |W > l | zl−1 − zl−1 2 ) , zl = σl ( W > l zl−1 + zl−1 2 + |W > l | zl−1 − zl−1 2 ) , ( 3 ) where | · | is the element-wise absolute-value operator . The verification problem over the relaxed feasible set ẐL : = { zL | zL , i ≤ zL , i ≤ z̄L , i } , where ZL ⊆ ẐL is then easily solved as p∗i = min zL∈ZL c > y , izL ≥ min zL∈ẐL c > y , izL = zL , y − z̄L , i . ( 4 ) 2.2 ROBUST TRAINING OF VERIFIABLE NETWORKS . It has been shown that convex relaxation ofZL can also provide a tractable upper bound on the inner maximization in Eq . 2 . While this holds for various relaxation techniques , focusing on the IBP let us define JIBP , θ ( x , y ) : = [ J IBP 1 , J IBP 2 , ... , J IBP K ] where J IBP i : = min zL∈ẐL c > y , izL ( 5 ) with ( θ , ) implicitly influencing ẐL ( dropped for brevity ) , and upperbound the inner-max in Eq . 2 max δ∈∆ ` xent ( fθ ( x + δ ) , y ) ≤ ` xent ( −JIBP , θ ( x , y ) , y ) , ` xent ( z , c ) : = − log ( exp ( zc ) ∑ i exp ( zi ) ) ( 6 ) By using this tractable upper bound of the robust optimization , network can now be trained by minimize θ ∑ ( x , y ) ∈D ( 1− κ ) ` xent ( −JIBP , θ ( x , y ) , y ) + κγ ` xent ( fθ ( x ) , y ) , ( 7 ) where γ trades natural versus robust accuracy , and κ is scheduled through a ramp-down process to stabilize the training and tightening of IBP Gowal et al . ( 2018 ) ( where γ = 1 is selected therein ) . | In this paper, the authors propose an additional "abstain/detection" loss term into training, so that the classifier can either robustly classify or detect an adversarial attack. They extend the interval bound propagation method for certified robustness under L_infity perturbations (a simple bounding in changes of the weight after each NN layer application, using a box constraint). Hyperparameters in the objective trade-off between clean and adversarial accuracy. | SP:a6006c32d8bdbbd5f9d30303e688f9a0266ad29e |
Go with the flow: Adaptive control for Neural ODEs | 1 INTRODUCTION . The interpretation of artificial neural networks as continuous-time dynamical systems has led to both theoretical and practical advances in representation learning . According to this interpretation , the separate layers of a deep neural network are understood to be a discretization of a continuous-time operator so that , in effect , the net is infinitely deep . One important class of continuous-time models , neural ordinary differential equations ( NODEs ) ( Chen et al. , 2018 ) , have found natural applications in generative variational inference ( Grathwohl et al. , 2019 ) and physical modeling ( Köhler et al. , 2019 ; Ruthotto et al. , 2020 ) because of their ability to take advantage of black-box differential equation solvers and correspondence to dynamical systems in nature . Nevertheless , NODEs suffer from known representational limitations , which researchers have tried to alleviate either by lifting the NODE activation space to higher dimensions or by allowing the transition operator to change in time , making the system non-autonomous ( Dupont et al. , 2019 ) . For example , Zhang et al . ( 2020 ) showed that NODEs can arbitrarily approximate maps from Rd to R if NODE dynamics operate with an additional time dimension in Rd+1 and the system is affixed with an additional linear layer . The same authors showed that NODEs could approximate homeomorphisms from Rd to itself if the dynamics were lifted to R2d . Yet , the set of homeomorphisms from Rd to itself is in fact quite a conservative function space from the perspective of representation learning , since these mappings preserve topological invariants of the data space , preventing them from “ disentangling ” data classes like those of the annulus data in Fig . 1 ( lower left panel ) . In general , much remains to be understood about the continuous-time framework and its expressive capabilities . In this paper , we propose a new approach that we call neurally-controlled ODEs ( N-CODE ) designed to increase the expressivity of continuous-time neural nets by using tools from control theory . Whereas previous continuous-time methods learn a single , time-varying vector field for the whole input space , our system learns a family of vector fields parameterized by data . We do so by mapping the input space to a collection of control weights which interact with neural activity to optimally steer model dynamics . The implications of this new formulation are critical for model expressivity . In particular , the transformation of the input space is no longer constrained to be a homeomorphism , since the flows associated with each datum are specifically adapted to that point . Consequently , our system can easily “ tear ” apart the two annulus classes in Fig . 1 ( lower right panel ) without directly lifting the data space to a higher dimension . Moreover , when control weights are allowed to vary in time , they can play the role of fast , plastic synapses which can adapt to dynamic model states and inputs . The rest of the paper proceeds as follows . First , we will lay out the background for N-CODE and its technical formulation . Then , we will demonstrate its efficacy for supervised and unsupervised learning . In the supervised case , we show how NCODE can classify data by learning to bifurcate its dynamics along class boundaries as well as memorize high-dimensional patterns in real-time using fast synapses . Then , we show how the flows learned by N-CODE can be used as latent representations in an unsupervised autoencoder , improving image generation over a base model . 2 BACKGROUND . Neural ODEs ( NODEs ) ( Chen et al. , 2018 ) are dynamical systems of the form dx dt = f ( x , θ , t ) , ( 1 ) whereX is a space of features , θ ∈ Θ is a collection of learnable parameters , and f : X×Θ×R 7→ X is an equation of motion which we take to be differentiable on its whole domain . f defines a flow , i.e . a triple ( X , R , Φθ ) with Φθ : X × R 7→ X defined by Φθ ( x ( 0 ) , T ) = x ( 0 ) + T∫ 0 f ( x ( t ) , θ , t ) dt ( 2 ) which relates an initial point x ( 0 ) to an orbit of points { x ( t ) = Φθ ( x ( 0 ) , t ) , t ∈ R } . For a fixed T , the map x 7→ Φθ ( x , T ) is a homeomorphism from X to itelf parametrized by θ . Several properties of such flows make them appealing for machine learning . For example , the ODEs that govern such such flows can be solved with off-the shelf solvers and they can potentially model data irregularly sampled in time . Moreover , such flows are reversible maps by construction whose inverse is just the system integrated backward in time , Φθ ( . , t ) −1 = Φθ ( . , −t ) . This property enables depth-constant memory cost of training thanks to the adjoint sensitivity method ( Pontryagin Lev Semyonovich ; Boltyanskii V G & F , 1962 ) and the modeling of continuous-time generative normalizing flow algorithms ( ? ) . Interestingly , discretizing Eq . 2 yields the recursive formulation of a residual network ( He et al. , 2015 ) with a single residual operator fθ : ΦResNet ( x ( 0 ) , T ) = x ( 0 ) + T∑ t=1 fθ ( xt−1 ) ( 3 ) In this sense , NODEs with a time-independent ( autonomous ) equation of motion , f , are the infinitely-deep limit of weight-tied residual networks . Relying on the fact that every nonautonomous dynamical system with state x ∈ Rd is equivalent to an autonomous system on the extended state ( x , t ) ∈ Rd+1 , Eq . 2 can also be used to model general , weight-untied residual networks . However it remains unclear how dependence of f in time should be modeled in practice and how their dynamics relate to their discrete counterparts with weights evolving freely across blocks through gradient descent . 3 N-CODE : LEARNING TO CONTROL DATA-DEPENDENT FLOWS . General formulation - The main idea of N-CODE is to consider the parameters , θ ( t ) , in Eq . 1 as control variables for the dynamical state , x ( t ) . Model dynamics are then governed by a coupled system of equations on the extended state z ( t ) = ( x ( t ) , θ ( t ) ) . The initial value of the control weights , θ ( 0 ) , is given by a mapping γ : X → Θ . Throughout , we assume that the initial time point is t = 0 . The full trajectory of control weights , θ ( t ) , is then output by a controller , g , given by another differentiable equation of motion g : Θ× X × R 7→ Θ with initial condition γ ( x0 ) . Given an initial point , x ( 0 ) , we can solve the initial value problem ( IVP ) dz dt = h ( z , t ) z ( 0 ) = z0 = ( dx dt , dθ dt ) = ( f ( x , θ , t ) , g ( θ , x , t ) ) ( x ( 0 ) , θ ( 0 ) ) = ( x0 , γ ( x0 ) ) , ( 4 ) where h = ( f , g ) . We may think of g and γ as a controller of the dynamical system with equation of motion , f . We model g and γ as neural networks parameterized by µ ∈ Rnµ and use gradient descent techniques where the gradient can be computed by solving an adjoint problem ( Pontryagin Lev Semyonovich ; Boltyanskii V G & F , 1962 ) that we describe in the next section . Our goal here is to use the metaparameterization in the space Θ to create richer dynamic behavior for a given f than directly optimizing fixed weights θ. Well-posedness - If f and g are continuously differentiable with respect to x and θ and continuous with respect to t , then , for all initial conditions ( x ( 0 ) , θ ( 0 ) ) , there exists a unique solution z for Eq . 4 by the Cauchy-Lipschitz theorem . This result leads to the existence and uniqueness of the augmented flow ( X × Θ , R , Φµ ) with Φµ : ( X ×Θ ) × R 7→ X ×Θ . Moreover , considering the restriction of such a flow on X , we are now endowed with a universal approximator for at least the set of homeomorphisms on X given that this restriction constitutes a non-autonomous system . We discuss now how g and γ affect the evolution of the variable x ( t ) , exhibiting two forms of control and noting how they relate to previous extensions of NODEs . 3.1 OPEN AND CLOSED-LOOP CONTROLLERS . If the controller outputs control weights as a function of the current state , x ( t ) , then we say it is a closed-loop controller . Otherwise , it is an open-loop controller . Open-loop control : First , we consider the effect of using only the mapping γ in Eq . 4 as a controller . Here , γ maps the input space X to Θ so that f is conditioned on x ( 0 ) but not necessarily on x ( t ) for t > 0 . In other words , each initial value x ( 0 ) evolves according to its own learned flow ( X , R , Φγ ( x ( 0 ) ) ) . This allows for trajectories to evolve more freely than within a single flow that must account for the whole data distribution and resolves the problem of non-intersecting orbits ( see Figure 4 ) . Recently , ( Massaroli et al. , 2020b ) proposed a similar form of data-conditioned openloop control with extended state ( x ( t ) , x ( 0 ) ) ) . This is a version of our method in which γ is of the form γ ( x ) = θ ( 0 ) = [ C : id ] with C a constant vector , id is the identity function , and : denotes concatenation . Our open-loop formulation makes an architectural distinction between controller and dynamics and is consequently generalizable to the following closed-loop formulation . stationary stimulus . We evaluate this hypothesis in section . 5.3 . The expressivity of N-CODE compared to other continuous-time neural networks is encapsulated in the following proposition . The result , proven in appendix , shows that both openloop and closed-loop control systems overcome NODEs ’ expressivity constraint with two distinct strategies , data-conditioning and statespace augmentation . Proposition 1 - There exists a transformation φ : Rd → Rd which can be expressed by N-CODE but not by NODEs . In particular , φ is not a homeomorphism . 3.2 TRAINING . Loss function : Dynamics are evaluated according to a generalized loss function that integrates a cost over some interval [ 0 , T ] : l ( z ) : = T∫ 0 ` ( z ( t ) , t ) dt = T∫ 0 ` ( x ( t ) , θ ( t ) , t ) dt ( 5 ) The loss in Eq . 5 is more general than in Chen et al . ( 2018 ) since ` can be any Lebesgue-measurable function of both states , x , and control parameters , θ . In particular , this includes penalties at discrete time points or over the entire trajectory ( Massaroli et al. , 2020b ) but also regularizations on the weights or activations over the entire trajectory rather than the final state z ( T ) of the system . In order to estimate a control function θ ( t ) that is optimal with respect to Eq . 5 , we invoke Pontryagin ’ s maximum principle ( PMP ) ( Pontryagin Lev Semyonovich ; Boltyanskii V G & F , 1962 ) , which only requires mild assumptions on the functional control space Θ and applies to functions f that are non-smooth in θ . The PMP gives necessary conditions on θ ( t ) at optimality via the augmented adjoint variable a ( t ) . This quantity is the Jacobian of ` with respect to both x ( t ) and θ ( t ) . In the case of θ ( t ) being differentiable with respect to the meta-parameters µ , solving for the augmented adjoint state a ( t ) as in Chen et al . ( 2018 ) allows us to compute the gradient of the loss with respect to µ thanks to Theorem 1 . Theorem 1 - Augmented adjoint method : Given the IVP of equation 4 and for ` defined in equation 5 , we have : ∂l ∂µ = T∫ 0 a ( t ) T ∂h ∂µ dt , such that a satisfies da dt = −aT . ∂h ∂z − ∂ ` ∂z a ( T ) = 0 ( 6 ) where ∂h ∂z is the Jacobian of h with respect to z : ∂h∂z = ∂f∂x ∂f∂θ ∂g ∂x ∂g ∂θ . In practice , we compute the Jacobian for this augmented dynamics with open source automatic differentiation libraries using Pytorch ( Paszke et al. , 2019 ) , enabling seamless integration of NCODE modules in bigger architectures . We show an example of such modules in section B of Appendix . | The paper proposes a new class of neural ODE based models, called neurally-controlled ODEs (N-CODE). Instead of directly learning the weights of the neural network parameterizing the vector field f of the ODE, the paper instead proposes to learn a controller that takes as input the initial state and outputs the initial weights of f and optionally also updates the weights of f as the ODE is solved. This allows the model to parameterize a family of (potentially time varying) vector fields instead of a single vector field. The authors go on to show that their model can be trained using an augmented adjoint method (similar to the adjoint method used in the original neural ODE paper). | SP:f13fb67c966196fbc7fe3a264a1f2a224e651321 |
Go with the flow: Adaptive control for Neural ODEs | 1 INTRODUCTION . The interpretation of artificial neural networks as continuous-time dynamical systems has led to both theoretical and practical advances in representation learning . According to this interpretation , the separate layers of a deep neural network are understood to be a discretization of a continuous-time operator so that , in effect , the net is infinitely deep . One important class of continuous-time models , neural ordinary differential equations ( NODEs ) ( Chen et al. , 2018 ) , have found natural applications in generative variational inference ( Grathwohl et al. , 2019 ) and physical modeling ( Köhler et al. , 2019 ; Ruthotto et al. , 2020 ) because of their ability to take advantage of black-box differential equation solvers and correspondence to dynamical systems in nature . Nevertheless , NODEs suffer from known representational limitations , which researchers have tried to alleviate either by lifting the NODE activation space to higher dimensions or by allowing the transition operator to change in time , making the system non-autonomous ( Dupont et al. , 2019 ) . For example , Zhang et al . ( 2020 ) showed that NODEs can arbitrarily approximate maps from Rd to R if NODE dynamics operate with an additional time dimension in Rd+1 and the system is affixed with an additional linear layer . The same authors showed that NODEs could approximate homeomorphisms from Rd to itself if the dynamics were lifted to R2d . Yet , the set of homeomorphisms from Rd to itself is in fact quite a conservative function space from the perspective of representation learning , since these mappings preserve topological invariants of the data space , preventing them from “ disentangling ” data classes like those of the annulus data in Fig . 1 ( lower left panel ) . In general , much remains to be understood about the continuous-time framework and its expressive capabilities . In this paper , we propose a new approach that we call neurally-controlled ODEs ( N-CODE ) designed to increase the expressivity of continuous-time neural nets by using tools from control theory . Whereas previous continuous-time methods learn a single , time-varying vector field for the whole input space , our system learns a family of vector fields parameterized by data . We do so by mapping the input space to a collection of control weights which interact with neural activity to optimally steer model dynamics . The implications of this new formulation are critical for model expressivity . In particular , the transformation of the input space is no longer constrained to be a homeomorphism , since the flows associated with each datum are specifically adapted to that point . Consequently , our system can easily “ tear ” apart the two annulus classes in Fig . 1 ( lower right panel ) without directly lifting the data space to a higher dimension . Moreover , when control weights are allowed to vary in time , they can play the role of fast , plastic synapses which can adapt to dynamic model states and inputs . The rest of the paper proceeds as follows . First , we will lay out the background for N-CODE and its technical formulation . Then , we will demonstrate its efficacy for supervised and unsupervised learning . In the supervised case , we show how NCODE can classify data by learning to bifurcate its dynamics along class boundaries as well as memorize high-dimensional patterns in real-time using fast synapses . Then , we show how the flows learned by N-CODE can be used as latent representations in an unsupervised autoencoder , improving image generation over a base model . 2 BACKGROUND . Neural ODEs ( NODEs ) ( Chen et al. , 2018 ) are dynamical systems of the form dx dt = f ( x , θ , t ) , ( 1 ) whereX is a space of features , θ ∈ Θ is a collection of learnable parameters , and f : X×Θ×R 7→ X is an equation of motion which we take to be differentiable on its whole domain . f defines a flow , i.e . a triple ( X , R , Φθ ) with Φθ : X × R 7→ X defined by Φθ ( x ( 0 ) , T ) = x ( 0 ) + T∫ 0 f ( x ( t ) , θ , t ) dt ( 2 ) which relates an initial point x ( 0 ) to an orbit of points { x ( t ) = Φθ ( x ( 0 ) , t ) , t ∈ R } . For a fixed T , the map x 7→ Φθ ( x , T ) is a homeomorphism from X to itelf parametrized by θ . Several properties of such flows make them appealing for machine learning . For example , the ODEs that govern such such flows can be solved with off-the shelf solvers and they can potentially model data irregularly sampled in time . Moreover , such flows are reversible maps by construction whose inverse is just the system integrated backward in time , Φθ ( . , t ) −1 = Φθ ( . , −t ) . This property enables depth-constant memory cost of training thanks to the adjoint sensitivity method ( Pontryagin Lev Semyonovich ; Boltyanskii V G & F , 1962 ) and the modeling of continuous-time generative normalizing flow algorithms ( ? ) . Interestingly , discretizing Eq . 2 yields the recursive formulation of a residual network ( He et al. , 2015 ) with a single residual operator fθ : ΦResNet ( x ( 0 ) , T ) = x ( 0 ) + T∑ t=1 fθ ( xt−1 ) ( 3 ) In this sense , NODEs with a time-independent ( autonomous ) equation of motion , f , are the infinitely-deep limit of weight-tied residual networks . Relying on the fact that every nonautonomous dynamical system with state x ∈ Rd is equivalent to an autonomous system on the extended state ( x , t ) ∈ Rd+1 , Eq . 2 can also be used to model general , weight-untied residual networks . However it remains unclear how dependence of f in time should be modeled in practice and how their dynamics relate to their discrete counterparts with weights evolving freely across blocks through gradient descent . 3 N-CODE : LEARNING TO CONTROL DATA-DEPENDENT FLOWS . General formulation - The main idea of N-CODE is to consider the parameters , θ ( t ) , in Eq . 1 as control variables for the dynamical state , x ( t ) . Model dynamics are then governed by a coupled system of equations on the extended state z ( t ) = ( x ( t ) , θ ( t ) ) . The initial value of the control weights , θ ( 0 ) , is given by a mapping γ : X → Θ . Throughout , we assume that the initial time point is t = 0 . The full trajectory of control weights , θ ( t ) , is then output by a controller , g , given by another differentiable equation of motion g : Θ× X × R 7→ Θ with initial condition γ ( x0 ) . Given an initial point , x ( 0 ) , we can solve the initial value problem ( IVP ) dz dt = h ( z , t ) z ( 0 ) = z0 = ( dx dt , dθ dt ) = ( f ( x , θ , t ) , g ( θ , x , t ) ) ( x ( 0 ) , θ ( 0 ) ) = ( x0 , γ ( x0 ) ) , ( 4 ) where h = ( f , g ) . We may think of g and γ as a controller of the dynamical system with equation of motion , f . We model g and γ as neural networks parameterized by µ ∈ Rnµ and use gradient descent techniques where the gradient can be computed by solving an adjoint problem ( Pontryagin Lev Semyonovich ; Boltyanskii V G & F , 1962 ) that we describe in the next section . Our goal here is to use the metaparameterization in the space Θ to create richer dynamic behavior for a given f than directly optimizing fixed weights θ. Well-posedness - If f and g are continuously differentiable with respect to x and θ and continuous with respect to t , then , for all initial conditions ( x ( 0 ) , θ ( 0 ) ) , there exists a unique solution z for Eq . 4 by the Cauchy-Lipschitz theorem . This result leads to the existence and uniqueness of the augmented flow ( X × Θ , R , Φµ ) with Φµ : ( X ×Θ ) × R 7→ X ×Θ . Moreover , considering the restriction of such a flow on X , we are now endowed with a universal approximator for at least the set of homeomorphisms on X given that this restriction constitutes a non-autonomous system . We discuss now how g and γ affect the evolution of the variable x ( t ) , exhibiting two forms of control and noting how they relate to previous extensions of NODEs . 3.1 OPEN AND CLOSED-LOOP CONTROLLERS . If the controller outputs control weights as a function of the current state , x ( t ) , then we say it is a closed-loop controller . Otherwise , it is an open-loop controller . Open-loop control : First , we consider the effect of using only the mapping γ in Eq . 4 as a controller . Here , γ maps the input space X to Θ so that f is conditioned on x ( 0 ) but not necessarily on x ( t ) for t > 0 . In other words , each initial value x ( 0 ) evolves according to its own learned flow ( X , R , Φγ ( x ( 0 ) ) ) . This allows for trajectories to evolve more freely than within a single flow that must account for the whole data distribution and resolves the problem of non-intersecting orbits ( see Figure 4 ) . Recently , ( Massaroli et al. , 2020b ) proposed a similar form of data-conditioned openloop control with extended state ( x ( t ) , x ( 0 ) ) ) . This is a version of our method in which γ is of the form γ ( x ) = θ ( 0 ) = [ C : id ] with C a constant vector , id is the identity function , and : denotes concatenation . Our open-loop formulation makes an architectural distinction between controller and dynamics and is consequently generalizable to the following closed-loop formulation . stationary stimulus . We evaluate this hypothesis in section . 5.3 . The expressivity of N-CODE compared to other continuous-time neural networks is encapsulated in the following proposition . The result , proven in appendix , shows that both openloop and closed-loop control systems overcome NODEs ’ expressivity constraint with two distinct strategies , data-conditioning and statespace augmentation . Proposition 1 - There exists a transformation φ : Rd → Rd which can be expressed by N-CODE but not by NODEs . In particular , φ is not a homeomorphism . 3.2 TRAINING . Loss function : Dynamics are evaluated according to a generalized loss function that integrates a cost over some interval [ 0 , T ] : l ( z ) : = T∫ 0 ` ( z ( t ) , t ) dt = T∫ 0 ` ( x ( t ) , θ ( t ) , t ) dt ( 5 ) The loss in Eq . 5 is more general than in Chen et al . ( 2018 ) since ` can be any Lebesgue-measurable function of both states , x , and control parameters , θ . In particular , this includes penalties at discrete time points or over the entire trajectory ( Massaroli et al. , 2020b ) but also regularizations on the weights or activations over the entire trajectory rather than the final state z ( T ) of the system . In order to estimate a control function θ ( t ) that is optimal with respect to Eq . 5 , we invoke Pontryagin ’ s maximum principle ( PMP ) ( Pontryagin Lev Semyonovich ; Boltyanskii V G & F , 1962 ) , which only requires mild assumptions on the functional control space Θ and applies to functions f that are non-smooth in θ . The PMP gives necessary conditions on θ ( t ) at optimality via the augmented adjoint variable a ( t ) . This quantity is the Jacobian of ` with respect to both x ( t ) and θ ( t ) . In the case of θ ( t ) being differentiable with respect to the meta-parameters µ , solving for the augmented adjoint state a ( t ) as in Chen et al . ( 2018 ) allows us to compute the gradient of the loss with respect to µ thanks to Theorem 1 . Theorem 1 - Augmented adjoint method : Given the IVP of equation 4 and for ` defined in equation 5 , we have : ∂l ∂µ = T∫ 0 a ( t ) T ∂h ∂µ dt , such that a satisfies da dt = −aT . ∂h ∂z − ∂ ` ∂z a ( T ) = 0 ( 6 ) where ∂h ∂z is the Jacobian of h with respect to z : ∂h∂z = ∂f∂x ∂f∂θ ∂g ∂x ∂g ∂θ . In practice , we compute the Jacobian for this augmented dynamics with open source automatic differentiation libraries using Pytorch ( Paszke et al. , 2019 ) , enabling seamless integration of NCODE modules in bigger architectures . We show an example of such modules in section B of Appendix . | Comment: Summary: This paper presents a technique for more expressive neural ordinary differential equations (NODE) flows. Instead of learning a fixed set of parameters $\theta$ that governs the ODE dynamic, the proposed approach learns dynamic parameters that evolve over time. The authors propose two variants of the methods: $\textit{open-loop}$ and $\textit{closed-loop}$. The former only maps the initial observation as the controller whereas $\theta$ in the later model follows another NODE $g$. Model performance is demonstrated on several tasks. The model is shown to solve the well-known "crossing curves" problem, on which NODE fails. Also, it's demonstrated that the presented technique yields sharper images compared to VAEs and also better at classification and interpolation. | SP:f13fb67c966196fbc7fe3a264a1f2a224e651321 |
Go with the flow: Adaptive control for Neural ODEs | 1 INTRODUCTION . The interpretation of artificial neural networks as continuous-time dynamical systems has led to both theoretical and practical advances in representation learning . According to this interpretation , the separate layers of a deep neural network are understood to be a discretization of a continuous-time operator so that , in effect , the net is infinitely deep . One important class of continuous-time models , neural ordinary differential equations ( NODEs ) ( Chen et al. , 2018 ) , have found natural applications in generative variational inference ( Grathwohl et al. , 2019 ) and physical modeling ( Köhler et al. , 2019 ; Ruthotto et al. , 2020 ) because of their ability to take advantage of black-box differential equation solvers and correspondence to dynamical systems in nature . Nevertheless , NODEs suffer from known representational limitations , which researchers have tried to alleviate either by lifting the NODE activation space to higher dimensions or by allowing the transition operator to change in time , making the system non-autonomous ( Dupont et al. , 2019 ) . For example , Zhang et al . ( 2020 ) showed that NODEs can arbitrarily approximate maps from Rd to R if NODE dynamics operate with an additional time dimension in Rd+1 and the system is affixed with an additional linear layer . The same authors showed that NODEs could approximate homeomorphisms from Rd to itself if the dynamics were lifted to R2d . Yet , the set of homeomorphisms from Rd to itself is in fact quite a conservative function space from the perspective of representation learning , since these mappings preserve topological invariants of the data space , preventing them from “ disentangling ” data classes like those of the annulus data in Fig . 1 ( lower left panel ) . In general , much remains to be understood about the continuous-time framework and its expressive capabilities . In this paper , we propose a new approach that we call neurally-controlled ODEs ( N-CODE ) designed to increase the expressivity of continuous-time neural nets by using tools from control theory . Whereas previous continuous-time methods learn a single , time-varying vector field for the whole input space , our system learns a family of vector fields parameterized by data . We do so by mapping the input space to a collection of control weights which interact with neural activity to optimally steer model dynamics . The implications of this new formulation are critical for model expressivity . In particular , the transformation of the input space is no longer constrained to be a homeomorphism , since the flows associated with each datum are specifically adapted to that point . Consequently , our system can easily “ tear ” apart the two annulus classes in Fig . 1 ( lower right panel ) without directly lifting the data space to a higher dimension . Moreover , when control weights are allowed to vary in time , they can play the role of fast , plastic synapses which can adapt to dynamic model states and inputs . The rest of the paper proceeds as follows . First , we will lay out the background for N-CODE and its technical formulation . Then , we will demonstrate its efficacy for supervised and unsupervised learning . In the supervised case , we show how NCODE can classify data by learning to bifurcate its dynamics along class boundaries as well as memorize high-dimensional patterns in real-time using fast synapses . Then , we show how the flows learned by N-CODE can be used as latent representations in an unsupervised autoencoder , improving image generation over a base model . 2 BACKGROUND . Neural ODEs ( NODEs ) ( Chen et al. , 2018 ) are dynamical systems of the form dx dt = f ( x , θ , t ) , ( 1 ) whereX is a space of features , θ ∈ Θ is a collection of learnable parameters , and f : X×Θ×R 7→ X is an equation of motion which we take to be differentiable on its whole domain . f defines a flow , i.e . a triple ( X , R , Φθ ) with Φθ : X × R 7→ X defined by Φθ ( x ( 0 ) , T ) = x ( 0 ) + T∫ 0 f ( x ( t ) , θ , t ) dt ( 2 ) which relates an initial point x ( 0 ) to an orbit of points { x ( t ) = Φθ ( x ( 0 ) , t ) , t ∈ R } . For a fixed T , the map x 7→ Φθ ( x , T ) is a homeomorphism from X to itelf parametrized by θ . Several properties of such flows make them appealing for machine learning . For example , the ODEs that govern such such flows can be solved with off-the shelf solvers and they can potentially model data irregularly sampled in time . Moreover , such flows are reversible maps by construction whose inverse is just the system integrated backward in time , Φθ ( . , t ) −1 = Φθ ( . , −t ) . This property enables depth-constant memory cost of training thanks to the adjoint sensitivity method ( Pontryagin Lev Semyonovich ; Boltyanskii V G & F , 1962 ) and the modeling of continuous-time generative normalizing flow algorithms ( ? ) . Interestingly , discretizing Eq . 2 yields the recursive formulation of a residual network ( He et al. , 2015 ) with a single residual operator fθ : ΦResNet ( x ( 0 ) , T ) = x ( 0 ) + T∑ t=1 fθ ( xt−1 ) ( 3 ) In this sense , NODEs with a time-independent ( autonomous ) equation of motion , f , are the infinitely-deep limit of weight-tied residual networks . Relying on the fact that every nonautonomous dynamical system with state x ∈ Rd is equivalent to an autonomous system on the extended state ( x , t ) ∈ Rd+1 , Eq . 2 can also be used to model general , weight-untied residual networks . However it remains unclear how dependence of f in time should be modeled in practice and how their dynamics relate to their discrete counterparts with weights evolving freely across blocks through gradient descent . 3 N-CODE : LEARNING TO CONTROL DATA-DEPENDENT FLOWS . General formulation - The main idea of N-CODE is to consider the parameters , θ ( t ) , in Eq . 1 as control variables for the dynamical state , x ( t ) . Model dynamics are then governed by a coupled system of equations on the extended state z ( t ) = ( x ( t ) , θ ( t ) ) . The initial value of the control weights , θ ( 0 ) , is given by a mapping γ : X → Θ . Throughout , we assume that the initial time point is t = 0 . The full trajectory of control weights , θ ( t ) , is then output by a controller , g , given by another differentiable equation of motion g : Θ× X × R 7→ Θ with initial condition γ ( x0 ) . Given an initial point , x ( 0 ) , we can solve the initial value problem ( IVP ) dz dt = h ( z , t ) z ( 0 ) = z0 = ( dx dt , dθ dt ) = ( f ( x , θ , t ) , g ( θ , x , t ) ) ( x ( 0 ) , θ ( 0 ) ) = ( x0 , γ ( x0 ) ) , ( 4 ) where h = ( f , g ) . We may think of g and γ as a controller of the dynamical system with equation of motion , f . We model g and γ as neural networks parameterized by µ ∈ Rnµ and use gradient descent techniques where the gradient can be computed by solving an adjoint problem ( Pontryagin Lev Semyonovich ; Boltyanskii V G & F , 1962 ) that we describe in the next section . Our goal here is to use the metaparameterization in the space Θ to create richer dynamic behavior for a given f than directly optimizing fixed weights θ. Well-posedness - If f and g are continuously differentiable with respect to x and θ and continuous with respect to t , then , for all initial conditions ( x ( 0 ) , θ ( 0 ) ) , there exists a unique solution z for Eq . 4 by the Cauchy-Lipschitz theorem . This result leads to the existence and uniqueness of the augmented flow ( X × Θ , R , Φµ ) with Φµ : ( X ×Θ ) × R 7→ X ×Θ . Moreover , considering the restriction of such a flow on X , we are now endowed with a universal approximator for at least the set of homeomorphisms on X given that this restriction constitutes a non-autonomous system . We discuss now how g and γ affect the evolution of the variable x ( t ) , exhibiting two forms of control and noting how they relate to previous extensions of NODEs . 3.1 OPEN AND CLOSED-LOOP CONTROLLERS . If the controller outputs control weights as a function of the current state , x ( t ) , then we say it is a closed-loop controller . Otherwise , it is an open-loop controller . Open-loop control : First , we consider the effect of using only the mapping γ in Eq . 4 as a controller . Here , γ maps the input space X to Θ so that f is conditioned on x ( 0 ) but not necessarily on x ( t ) for t > 0 . In other words , each initial value x ( 0 ) evolves according to its own learned flow ( X , R , Φγ ( x ( 0 ) ) ) . This allows for trajectories to evolve more freely than within a single flow that must account for the whole data distribution and resolves the problem of non-intersecting orbits ( see Figure 4 ) . Recently , ( Massaroli et al. , 2020b ) proposed a similar form of data-conditioned openloop control with extended state ( x ( t ) , x ( 0 ) ) ) . This is a version of our method in which γ is of the form γ ( x ) = θ ( 0 ) = [ C : id ] with C a constant vector , id is the identity function , and : denotes concatenation . Our open-loop formulation makes an architectural distinction between controller and dynamics and is consequently generalizable to the following closed-loop formulation . stationary stimulus . We evaluate this hypothesis in section . 5.3 . The expressivity of N-CODE compared to other continuous-time neural networks is encapsulated in the following proposition . The result , proven in appendix , shows that both openloop and closed-loop control systems overcome NODEs ’ expressivity constraint with two distinct strategies , data-conditioning and statespace augmentation . Proposition 1 - There exists a transformation φ : Rd → Rd which can be expressed by N-CODE but not by NODEs . In particular , φ is not a homeomorphism . 3.2 TRAINING . Loss function : Dynamics are evaluated according to a generalized loss function that integrates a cost over some interval [ 0 , T ] : l ( z ) : = T∫ 0 ` ( z ( t ) , t ) dt = T∫ 0 ` ( x ( t ) , θ ( t ) , t ) dt ( 5 ) The loss in Eq . 5 is more general than in Chen et al . ( 2018 ) since ` can be any Lebesgue-measurable function of both states , x , and control parameters , θ . In particular , this includes penalties at discrete time points or over the entire trajectory ( Massaroli et al. , 2020b ) but also regularizations on the weights or activations over the entire trajectory rather than the final state z ( T ) of the system . In order to estimate a control function θ ( t ) that is optimal with respect to Eq . 5 , we invoke Pontryagin ’ s maximum principle ( PMP ) ( Pontryagin Lev Semyonovich ; Boltyanskii V G & F , 1962 ) , which only requires mild assumptions on the functional control space Θ and applies to functions f that are non-smooth in θ . The PMP gives necessary conditions on θ ( t ) at optimality via the augmented adjoint variable a ( t ) . This quantity is the Jacobian of ` with respect to both x ( t ) and θ ( t ) . In the case of θ ( t ) being differentiable with respect to the meta-parameters µ , solving for the augmented adjoint state a ( t ) as in Chen et al . ( 2018 ) allows us to compute the gradient of the loss with respect to µ thanks to Theorem 1 . Theorem 1 - Augmented adjoint method : Given the IVP of equation 4 and for ` defined in equation 5 , we have : ∂l ∂µ = T∫ 0 a ( t ) T ∂h ∂µ dt , such that a satisfies da dt = −aT . ∂h ∂z − ∂ ` ∂z a ( T ) = 0 ( 6 ) where ∂h ∂z is the Jacobian of h with respect to z : ∂h∂z = ∂f∂x ∂f∂θ ∂g ∂x ∂g ∂θ . In practice , we compute the Jacobian for this augmented dynamics with open source automatic differentiation libraries using Pytorch ( Paszke et al. , 2019 ) , enabling seamless integration of NCODE modules in bigger architectures . We show an example of such modules in section B of Appendix . | The paper introduces a novel approach N-CODE, based on Neural Ordinary Differential Equations (NODE), that increases the expressivity of continuous-time neural nets by using approaches from Control theory. N-CODE, in contrast to NODE, can learn a family of vector fields and is therefore able to flexibly adjust the flow for every data point. Authors provide theoretical evidence and compute several simulations with different problems (including Reflection, concentric annuli, supervised image classification and image auto encoding) that confirm that the proposed method greatly improves or outperforms state-of-the-art methods. | SP:f13fb67c966196fbc7fe3a264a1f2a224e651321 |
Automatic Data Augmentation for Generalization in Reinforcement Learning | 1 Introduction . Generalization to new environments remains a major challenge in deep reinforcement learning ( RL ) . Current methods fail to generalize to unseen environments even when trained on similar settings [ 19 , 51 , 71 , 11 , 21 , 12 , 60 ] . This indicates that standard RL agents memorize specific trajectories rather than learning transferable skills . Several strategies have been proposed to alleviate this problem , such as the use of regularization [ 19 , 71 , 11 , 28 ] , data augmentation [ 11 , 44 , 69 , 38 , 41 ] , or representation learning [ 72 , 74 ] . In this work , we focus on the use of data augmentation in RL . We identify key differences between supervised learning and reinforcement learning which need to be taken into account when using data augmentation in RL . More specifically , we show that a naive application of data augmentation can lead to both theoretical and practical problems with standard RL algorithms , such as unprincipled objective estimates and poor performance . As a solution , we propose Data-regularized Actor-Critic or DrAC , a new algorithm that enables the use of data augmentation with actor-critic algorithms in a theoretically sound way . Specifically , we introduce two regularization terms which constrain the agent ’ s policy and value function to be invariant to various state transformations . Empirically , this approach allows the agent to learn useful behaviors ( outperforming strong RL baselines ) in settings in which a naive use of data augmentation completely fails or converges to a sub-optimal policy . While we use Proximal Policy Optimization ( PPO , Schulman et al . [ 56 ] ) to describe and validate our approach , the method 1in June 2020 , at the time of making this work publicly available on arXiv . it has since been surpassed . 35th Conference on Neural Information Processing Systems ( NeurIPS 2021 ) . can be easily integrated with any actor-critic algorithm with a discrete stochastic policy such as A3C [ 49 ] , SAC [ 24 ] , or IMPALA [ 17 ] . The current use of data augmentation in RL either relies on expert knowledge to pick an appropriate augmentation [ 11 , 44 , 38 ] or separately evaluates a large number of transformations to find the best one [ 69 , 41 ] . In this paper , we propose three methods for automatically finding a useful augmentation for a given RL task . The first two learn to select the best augmentation from a fixed set , using either a variant of the upper confidence bound algorithm ( UCB , Auer [ 2 ] ) or meta-learning ( RL2 , Wang et al . [ 66 ] ) . We refer to these methods as UCB-DrAC and RL2-DrAC , respectively . The third method , Meta-DrAC , directly meta-learns the weights of a convolutional network , without access to predefined transformations ( MAML , Finn et al . [ 20 ] ) . Figure 1 gives an overview of UCB-DrAC . We evaluate these approaches on the Procgen generalization benchmark [ 12 ] which consists of 16 procedurally generated environments with visual observations . Our results show that UCB-DrAC is the most effective among these at finding a good augmentation , and is comparable or better than using DrAC with the best augmentation from a given set . UCB-DrAC also outperforms baselines specifically designed to improve generalization in RL [ 28 , 44 , 41 ] on both train and test . In addition , we show that our agent learns policies and representations that are more invariant to changes in the environment which do not alter the reward or transition function ( i.e . they are inconsequential for control ) , such as the background theme . To summarize , our work makes the following contributions : ( i ) we introduce a principled way of using data augmentation with actor-critic algorithms , ( ii ) we propose a practical approach for automatically selecting an effective augmentation in RL settings , ( iii ) we show that the use of data augmentation leads to policies and representations that better capture task invariances , and ( iv ) we demonstrate state-of-the-art results on the Procgen benchmark and outperform popular RL methods on four DeepMind Control tasks with natural and synthetic distractors . 2 Background . We consider a distribution q ( m ) of Partially Observable Markov Decision Processes ( POMDPs , [ 6 ] ) m ∈ M , with m defined by the tuple ( Sm , Om , A , Tm , Rm , γ ) , where Sm is the state space , Om is the observation space , A is the action space , Tm ( s′|s , a ) is the transition function , Rm ( s , a ) is the reward function , and γ is the discount factor . During training , we restrict access to a fixed set of POMDPs , Mtrain = { m1 , . . . , mn } , where mi ∼ q , ∀ i = 1 , n. The goal is to find a policy πθ which maximizes the expected discounted reward over the entire distribution of POMDPs , J ( πθ ) = Eq , π , Tm , pm [ ∑T t=0 γ tRm ( st , at ) ] . In practice , we use the Procgen benchmark which contains 16 procedurally generated games . Each game corresponds to a distribution of POMDPs q ( m ) , and each level of a game corresponds to a POMDP sampled from that game ’ s distribution m ∼ q . The POMDP m is determined by the seed ( i.e . integer ) used to generate the corresponding level . Following the setup from Cobbe et al . [ 12 ] , agents are trained on a fixed set of n = 200 levels ( generated using seeds from 1 to 200 ) and tested on the full distribution of levels ( generated by sampling seeds uniformly at random from all computer integers ) . Proximal Policy Optimization ( PPO , Schulman et al . [ 56 ] ) is an actor-critic algorithm that learns a policy πθ and a value function Vθ with the goal of finding an optimal policy for a given POMDP . PPO alternates between sampling data through interaction with the environment and maximizing a clipped surrogate objective function using stochastic gradient ascent . One component of the PPO objective is the policy gradient term JPG , which is estimated using importance sampling : JPG ( θ ) = ∑ a∈A πθ ( a|s ) Âθold ( s , a ) = Ea∼πθold [ πθ ( a|s ) πθold ( a|s ) Âθold ( s , a ) ] , ( 1 ) where  ( · ) is an estimate of the advantage function , πθold is the behavior policy used to collect trajectories ( i.e . that generates the training distribution of states and actions ) , and πθ is the policy we want to optimize ( i.e . that generates the true distribution of states and actions ) . See Appendix A for a full description of PPO . 3 Automatic Data Augmentation for RL . 3.1 Data Augmentation in RL . Image augmentation has been successfully applied in computer vision for improving generalization on object classification tasks [ 58 , 9 , 8 , 39 ] . As noted by Kostrikov et al . [ 38 ] , those tasks are invariant to certain image transformations such as rotations or flips , which is not always the case in RL . For example , if your observation is flipped , the corresponding reward will be reversed for the left and right actions and will not provide an accurate signal to the agent . While data augmentation has been previously used in RL settings without other algorithmic changes [ 11 , 69 , 41 ] , we argue that this approach is not theoretically sound . If transformations are naively applied to observations in PPO ’ s buffer , as done in Laskin et al . [ 41 ] , the PPO objective changes and equation ( 1 ) is replaced by JPG ( θ ) = Ea∼πθold [ πθ ( a|f ( s ) ) πθold ( a|s ) Âθold ( s , a ) ] , ( 2 ) where f : S × H → S is the image transformation . However , the right hand side of the above equation is not a sound estimate of the left hand side because πθ ( a|f ( s ) ) 6= πθ ( a|s ) , since nothing constrains πθ ( a|f ( s ) ) to be close to πθ ( a|s ) . Note that in the on-policy case when θ = θold , the ratio used to estimate the advantage should be equal to one , which is not necessarily the case when using equation ( 2 ) . In fact , one can define certain transformations f ( · ) that result in an arbitrarily large ratio πθ ( a|f ( s ) ) /πθold ( a|s ) . Figure 3 shows examples where a naive use of data augmentation prevents PPO from learning a good policy in practice , suggesting that this is not just a theoretical concern . In the following section , we propose an algorithmic change that enables the use of data augmentation with actor-critic algorithms in a principled way . 3.2 Policy and Value Function Regularization . Inspired by the recent work of Kostrikov et al . [ 38 ] , we propose two novel regularization terms for the policy and value functions that enable the proper use of data augmentation for actor-critic algorithms . Our algorithmic contribution differs from that of Kostrikov et al . [ 38 ] in that it constrains both the actor and the critic , as opposed to only regularizing the Q-function . This allows our method to be used with a different ( and arguably larger ) class of RL algorithms , namely those that learn a policy and a value function . Following Kostrikov et al . [ 38 ] , we define an optimality-invariant state transformation f : S×H → S as a mapping that preserves both the agent ’ s policy π and its value function V such that V ( s ) = V ( f ( s , ν ) ) and π ( a|s ) = π ( a|f ( s , ν ) ) , ∀s ∈ S , ν ∈ H , where ν are the parameters of f ( · ) , drawn from the set of all possible parametersH . To ensure that the policy and value functions are invariant to such transformation of the input state , we propose an additional loss term for regularizing the policy , Gπ = KL [ πθ ( a|s ) | πθ ( a|f ( s , ν ) ) ] , ( 3 ) as well as an extra loss term for regularizing the value function , GV = ( Vφ ( s ) − Vφ ( f ( s , ν ) ) ) 2 . ( 4 ) Thus , our data-regularized actor-critic method , or DrAC , maximizes the following objective : JDrAC = JPPO − αr ( Gπ +GV ) , ( 5 ) where αr is the weight of the regularization term ( see Algorithm 1 ) . The use of Gπ and GV ensures that the agent ’ s policy and value function are invariant to the transformations induced by various augmentations . Particular transformations can be used to impose certain inductive biases relevant for the task ( e.g . invariance with respect to colors or translations ) . In addition , Gπ and GV can be added to the objective of any actor-critic algorithm with a discrete stochastic policy ( e.g . A3C , TRPO , ACER , SAC , or IMPALA ) without any other changes . Note that when using DrAC , as opposed to the method proposed by Laskin et al . [ 41 ] , we still use the correct importance sampling estimate of the left hand side objective in equation ( 1 ) ( instead of a wrong estimate as in equation ( 2 ) ) . This is because the transformed observations f ( s ) are only used to compute the regularization losses Gπ and GV , and thus are not used for the main PPO objective . Without these extra terms , the only way to use data augmentation is as explained in Section 3.1 , which leads to inaccurate estimates of the PPO objective . Hence , DrAC benefits from the regularizing effect of using data augmentation , while mitigating adverse consequences on the RL objective . See Appendix B for a more detailed explanation of why a naive application of data augmentation with certain policy gradient algorithms is theoretically unsound . Algorithm 1 DrAC : Data-regularized Actor-Critic applied to PPO Black : unmodified actor-critic algorithm . Cyan : image transformation . Red : policy regularization . Blue : value function regularization . 1 : Hyperparameters : image transformation f , regularization loss coefficient αr , minibatch size M , replay buffer size T , number of updates K. 2 : for k = 1 , . . . , K do 3 : Collect a new set of transitions D = { ( si , ai , ri , si+1 ) } Ti=1 using πθ . 4 : for j = 1 , . . . , ∗ TM do 5 : { ( si , ai , ri , si+1 ) } Mi=1 ∼ D . Sample a minibatch of transitions 6 : for i = 1 , . . . , M do 7 : νi ∼ H . Sample the augmentation parameters 8 : π̂i ← πφ ( ·|si ) . Compute the policy targets 9 : V̂i ← Vφ ( si ) . Compute the value function targets 10 : end for 11 : Gπ ( θ ) = 1 M ∑M i=1 KL [ π̂i | πθ ( ·|f ( si , νi ) ) ] . Regularize the policy 12 : GV ( φ ) = 1 M ∑M i=1 ( V̂i − Vφ ( f ( si , νi ) ) ) 2 . Regularize the value function 13 : JDrAC ( θ , φ ) = JPPO ( θ , φ ) − αr ( Gπ ( θ ) +GV ( φ ) ) . Compute the total loss function 14 : θ ← argmaxθ JDrAC . Update the policy 15 : φ← argmaxφ JDrAC . Update the value function 16 : end for 17 : end for | This paper presents a method that utilizes data augmentation for image-based reinforcement learning. The data augmentation is used to regularize the policy and function approximation in the proposed method. In addition, a method for automatically identifying effective ways of data augmentation is proposed. The experimental results show that the proposed method outperforms the baseline methods. | SP:f2325f97eb57b82ce95c86638af9d733d325b45d |
Automatic Data Augmentation for Generalization in Reinforcement Learning | 1 Introduction . Generalization to new environments remains a major challenge in deep reinforcement learning ( RL ) . Current methods fail to generalize to unseen environments even when trained on similar settings [ 19 , 51 , 71 , 11 , 21 , 12 , 60 ] . This indicates that standard RL agents memorize specific trajectories rather than learning transferable skills . Several strategies have been proposed to alleviate this problem , such as the use of regularization [ 19 , 71 , 11 , 28 ] , data augmentation [ 11 , 44 , 69 , 38 , 41 ] , or representation learning [ 72 , 74 ] . In this work , we focus on the use of data augmentation in RL . We identify key differences between supervised learning and reinforcement learning which need to be taken into account when using data augmentation in RL . More specifically , we show that a naive application of data augmentation can lead to both theoretical and practical problems with standard RL algorithms , such as unprincipled objective estimates and poor performance . As a solution , we propose Data-regularized Actor-Critic or DrAC , a new algorithm that enables the use of data augmentation with actor-critic algorithms in a theoretically sound way . Specifically , we introduce two regularization terms which constrain the agent ’ s policy and value function to be invariant to various state transformations . Empirically , this approach allows the agent to learn useful behaviors ( outperforming strong RL baselines ) in settings in which a naive use of data augmentation completely fails or converges to a sub-optimal policy . While we use Proximal Policy Optimization ( PPO , Schulman et al . [ 56 ] ) to describe and validate our approach , the method 1in June 2020 , at the time of making this work publicly available on arXiv . it has since been surpassed . 35th Conference on Neural Information Processing Systems ( NeurIPS 2021 ) . can be easily integrated with any actor-critic algorithm with a discrete stochastic policy such as A3C [ 49 ] , SAC [ 24 ] , or IMPALA [ 17 ] . The current use of data augmentation in RL either relies on expert knowledge to pick an appropriate augmentation [ 11 , 44 , 38 ] or separately evaluates a large number of transformations to find the best one [ 69 , 41 ] . In this paper , we propose three methods for automatically finding a useful augmentation for a given RL task . The first two learn to select the best augmentation from a fixed set , using either a variant of the upper confidence bound algorithm ( UCB , Auer [ 2 ] ) or meta-learning ( RL2 , Wang et al . [ 66 ] ) . We refer to these methods as UCB-DrAC and RL2-DrAC , respectively . The third method , Meta-DrAC , directly meta-learns the weights of a convolutional network , without access to predefined transformations ( MAML , Finn et al . [ 20 ] ) . Figure 1 gives an overview of UCB-DrAC . We evaluate these approaches on the Procgen generalization benchmark [ 12 ] which consists of 16 procedurally generated environments with visual observations . Our results show that UCB-DrAC is the most effective among these at finding a good augmentation , and is comparable or better than using DrAC with the best augmentation from a given set . UCB-DrAC also outperforms baselines specifically designed to improve generalization in RL [ 28 , 44 , 41 ] on both train and test . In addition , we show that our agent learns policies and representations that are more invariant to changes in the environment which do not alter the reward or transition function ( i.e . they are inconsequential for control ) , such as the background theme . To summarize , our work makes the following contributions : ( i ) we introduce a principled way of using data augmentation with actor-critic algorithms , ( ii ) we propose a practical approach for automatically selecting an effective augmentation in RL settings , ( iii ) we show that the use of data augmentation leads to policies and representations that better capture task invariances , and ( iv ) we demonstrate state-of-the-art results on the Procgen benchmark and outperform popular RL methods on four DeepMind Control tasks with natural and synthetic distractors . 2 Background . We consider a distribution q ( m ) of Partially Observable Markov Decision Processes ( POMDPs , [ 6 ] ) m ∈ M , with m defined by the tuple ( Sm , Om , A , Tm , Rm , γ ) , where Sm is the state space , Om is the observation space , A is the action space , Tm ( s′|s , a ) is the transition function , Rm ( s , a ) is the reward function , and γ is the discount factor . During training , we restrict access to a fixed set of POMDPs , Mtrain = { m1 , . . . , mn } , where mi ∼ q , ∀ i = 1 , n. The goal is to find a policy πθ which maximizes the expected discounted reward over the entire distribution of POMDPs , J ( πθ ) = Eq , π , Tm , pm [ ∑T t=0 γ tRm ( st , at ) ] . In practice , we use the Procgen benchmark which contains 16 procedurally generated games . Each game corresponds to a distribution of POMDPs q ( m ) , and each level of a game corresponds to a POMDP sampled from that game ’ s distribution m ∼ q . The POMDP m is determined by the seed ( i.e . integer ) used to generate the corresponding level . Following the setup from Cobbe et al . [ 12 ] , agents are trained on a fixed set of n = 200 levels ( generated using seeds from 1 to 200 ) and tested on the full distribution of levels ( generated by sampling seeds uniformly at random from all computer integers ) . Proximal Policy Optimization ( PPO , Schulman et al . [ 56 ] ) is an actor-critic algorithm that learns a policy πθ and a value function Vθ with the goal of finding an optimal policy for a given POMDP . PPO alternates between sampling data through interaction with the environment and maximizing a clipped surrogate objective function using stochastic gradient ascent . One component of the PPO objective is the policy gradient term JPG , which is estimated using importance sampling : JPG ( θ ) = ∑ a∈A πθ ( a|s ) Âθold ( s , a ) = Ea∼πθold [ πθ ( a|s ) πθold ( a|s ) Âθold ( s , a ) ] , ( 1 ) where  ( · ) is an estimate of the advantage function , πθold is the behavior policy used to collect trajectories ( i.e . that generates the training distribution of states and actions ) , and πθ is the policy we want to optimize ( i.e . that generates the true distribution of states and actions ) . See Appendix A for a full description of PPO . 3 Automatic Data Augmentation for RL . 3.1 Data Augmentation in RL . Image augmentation has been successfully applied in computer vision for improving generalization on object classification tasks [ 58 , 9 , 8 , 39 ] . As noted by Kostrikov et al . [ 38 ] , those tasks are invariant to certain image transformations such as rotations or flips , which is not always the case in RL . For example , if your observation is flipped , the corresponding reward will be reversed for the left and right actions and will not provide an accurate signal to the agent . While data augmentation has been previously used in RL settings without other algorithmic changes [ 11 , 69 , 41 ] , we argue that this approach is not theoretically sound . If transformations are naively applied to observations in PPO ’ s buffer , as done in Laskin et al . [ 41 ] , the PPO objective changes and equation ( 1 ) is replaced by JPG ( θ ) = Ea∼πθold [ πθ ( a|f ( s ) ) πθold ( a|s ) Âθold ( s , a ) ] , ( 2 ) where f : S × H → S is the image transformation . However , the right hand side of the above equation is not a sound estimate of the left hand side because πθ ( a|f ( s ) ) 6= πθ ( a|s ) , since nothing constrains πθ ( a|f ( s ) ) to be close to πθ ( a|s ) . Note that in the on-policy case when θ = θold , the ratio used to estimate the advantage should be equal to one , which is not necessarily the case when using equation ( 2 ) . In fact , one can define certain transformations f ( · ) that result in an arbitrarily large ratio πθ ( a|f ( s ) ) /πθold ( a|s ) . Figure 3 shows examples where a naive use of data augmentation prevents PPO from learning a good policy in practice , suggesting that this is not just a theoretical concern . In the following section , we propose an algorithmic change that enables the use of data augmentation with actor-critic algorithms in a principled way . 3.2 Policy and Value Function Regularization . Inspired by the recent work of Kostrikov et al . [ 38 ] , we propose two novel regularization terms for the policy and value functions that enable the proper use of data augmentation for actor-critic algorithms . Our algorithmic contribution differs from that of Kostrikov et al . [ 38 ] in that it constrains both the actor and the critic , as opposed to only regularizing the Q-function . This allows our method to be used with a different ( and arguably larger ) class of RL algorithms , namely those that learn a policy and a value function . Following Kostrikov et al . [ 38 ] , we define an optimality-invariant state transformation f : S×H → S as a mapping that preserves both the agent ’ s policy π and its value function V such that V ( s ) = V ( f ( s , ν ) ) and π ( a|s ) = π ( a|f ( s , ν ) ) , ∀s ∈ S , ν ∈ H , where ν are the parameters of f ( · ) , drawn from the set of all possible parametersH . To ensure that the policy and value functions are invariant to such transformation of the input state , we propose an additional loss term for regularizing the policy , Gπ = KL [ πθ ( a|s ) | πθ ( a|f ( s , ν ) ) ] , ( 3 ) as well as an extra loss term for regularizing the value function , GV = ( Vφ ( s ) − Vφ ( f ( s , ν ) ) ) 2 . ( 4 ) Thus , our data-regularized actor-critic method , or DrAC , maximizes the following objective : JDrAC = JPPO − αr ( Gπ +GV ) , ( 5 ) where αr is the weight of the regularization term ( see Algorithm 1 ) . The use of Gπ and GV ensures that the agent ’ s policy and value function are invariant to the transformations induced by various augmentations . Particular transformations can be used to impose certain inductive biases relevant for the task ( e.g . invariance with respect to colors or translations ) . In addition , Gπ and GV can be added to the objective of any actor-critic algorithm with a discrete stochastic policy ( e.g . A3C , TRPO , ACER , SAC , or IMPALA ) without any other changes . Note that when using DrAC , as opposed to the method proposed by Laskin et al . [ 41 ] , we still use the correct importance sampling estimate of the left hand side objective in equation ( 1 ) ( instead of a wrong estimate as in equation ( 2 ) ) . This is because the transformed observations f ( s ) are only used to compute the regularization losses Gπ and GV , and thus are not used for the main PPO objective . Without these extra terms , the only way to use data augmentation is as explained in Section 3.1 , which leads to inaccurate estimates of the PPO objective . Hence , DrAC benefits from the regularizing effect of using data augmentation , while mitigating adverse consequences on the RL objective . See Appendix B for a more detailed explanation of why a naive application of data augmentation with certain policy gradient algorithms is theoretically unsound . Algorithm 1 DrAC : Data-regularized Actor-Critic applied to PPO Black : unmodified actor-critic algorithm . Cyan : image transformation . Red : policy regularization . Blue : value function regularization . 1 : Hyperparameters : image transformation f , regularization loss coefficient αr , minibatch size M , replay buffer size T , number of updates K. 2 : for k = 1 , . . . , K do 3 : Collect a new set of transitions D = { ( si , ai , ri , si+1 ) } Ti=1 using πθ . 4 : for j = 1 , . . . , ∗ TM do 5 : { ( si , ai , ri , si+1 ) } Mi=1 ∼ D . Sample a minibatch of transitions 6 : for i = 1 , . . . , M do 7 : νi ∼ H . Sample the augmentation parameters 8 : π̂i ← πφ ( ·|si ) . Compute the policy targets 9 : V̂i ← Vφ ( si ) . Compute the value function targets 10 : end for 11 : Gπ ( θ ) = 1 M ∑M i=1 KL [ π̂i | πθ ( ·|f ( si , νi ) ) ] . Regularize the policy 12 : GV ( φ ) = 1 M ∑M i=1 ( V̂i − Vφ ( f ( si , νi ) ) ) 2 . Regularize the value function 13 : JDrAC ( θ , φ ) = JPPO ( θ , φ ) − αr ( Gπ ( θ ) +GV ( φ ) ) . Compute the total loss function 14 : θ ← argmaxθ JDrAC . Update the policy 15 : φ← argmaxφ JDrAC . Update the value function 16 : end for 17 : end for | This paper tackles the problem of generalization in deep RL via data augmentation. It provides a framework for automatic data augmentation based on UCB, RL^2, or MAML. When UCB is combined with regularization of the policy and value function so that their outputs are invariant to transformations (such as rotation, crop, etc.), it shows improvements over similar algorithms on the ProcGen benchmark. | SP:f2325f97eb57b82ce95c86638af9d733d325b45d |
Automatic Data Augmentation for Generalization in Reinforcement Learning | 1 Introduction . Generalization to new environments remains a major challenge in deep reinforcement learning ( RL ) . Current methods fail to generalize to unseen environments even when trained on similar settings [ 19 , 51 , 71 , 11 , 21 , 12 , 60 ] . This indicates that standard RL agents memorize specific trajectories rather than learning transferable skills . Several strategies have been proposed to alleviate this problem , such as the use of regularization [ 19 , 71 , 11 , 28 ] , data augmentation [ 11 , 44 , 69 , 38 , 41 ] , or representation learning [ 72 , 74 ] . In this work , we focus on the use of data augmentation in RL . We identify key differences between supervised learning and reinforcement learning which need to be taken into account when using data augmentation in RL . More specifically , we show that a naive application of data augmentation can lead to both theoretical and practical problems with standard RL algorithms , such as unprincipled objective estimates and poor performance . As a solution , we propose Data-regularized Actor-Critic or DrAC , a new algorithm that enables the use of data augmentation with actor-critic algorithms in a theoretically sound way . Specifically , we introduce two regularization terms which constrain the agent ’ s policy and value function to be invariant to various state transformations . Empirically , this approach allows the agent to learn useful behaviors ( outperforming strong RL baselines ) in settings in which a naive use of data augmentation completely fails or converges to a sub-optimal policy . While we use Proximal Policy Optimization ( PPO , Schulman et al . [ 56 ] ) to describe and validate our approach , the method 1in June 2020 , at the time of making this work publicly available on arXiv . it has since been surpassed . 35th Conference on Neural Information Processing Systems ( NeurIPS 2021 ) . can be easily integrated with any actor-critic algorithm with a discrete stochastic policy such as A3C [ 49 ] , SAC [ 24 ] , or IMPALA [ 17 ] . The current use of data augmentation in RL either relies on expert knowledge to pick an appropriate augmentation [ 11 , 44 , 38 ] or separately evaluates a large number of transformations to find the best one [ 69 , 41 ] . In this paper , we propose three methods for automatically finding a useful augmentation for a given RL task . The first two learn to select the best augmentation from a fixed set , using either a variant of the upper confidence bound algorithm ( UCB , Auer [ 2 ] ) or meta-learning ( RL2 , Wang et al . [ 66 ] ) . We refer to these methods as UCB-DrAC and RL2-DrAC , respectively . The third method , Meta-DrAC , directly meta-learns the weights of a convolutional network , without access to predefined transformations ( MAML , Finn et al . [ 20 ] ) . Figure 1 gives an overview of UCB-DrAC . We evaluate these approaches on the Procgen generalization benchmark [ 12 ] which consists of 16 procedurally generated environments with visual observations . Our results show that UCB-DrAC is the most effective among these at finding a good augmentation , and is comparable or better than using DrAC with the best augmentation from a given set . UCB-DrAC also outperforms baselines specifically designed to improve generalization in RL [ 28 , 44 , 41 ] on both train and test . In addition , we show that our agent learns policies and representations that are more invariant to changes in the environment which do not alter the reward or transition function ( i.e . they are inconsequential for control ) , such as the background theme . To summarize , our work makes the following contributions : ( i ) we introduce a principled way of using data augmentation with actor-critic algorithms , ( ii ) we propose a practical approach for automatically selecting an effective augmentation in RL settings , ( iii ) we show that the use of data augmentation leads to policies and representations that better capture task invariances , and ( iv ) we demonstrate state-of-the-art results on the Procgen benchmark and outperform popular RL methods on four DeepMind Control tasks with natural and synthetic distractors . 2 Background . We consider a distribution q ( m ) of Partially Observable Markov Decision Processes ( POMDPs , [ 6 ] ) m ∈ M , with m defined by the tuple ( Sm , Om , A , Tm , Rm , γ ) , where Sm is the state space , Om is the observation space , A is the action space , Tm ( s′|s , a ) is the transition function , Rm ( s , a ) is the reward function , and γ is the discount factor . During training , we restrict access to a fixed set of POMDPs , Mtrain = { m1 , . . . , mn } , where mi ∼ q , ∀ i = 1 , n. The goal is to find a policy πθ which maximizes the expected discounted reward over the entire distribution of POMDPs , J ( πθ ) = Eq , π , Tm , pm [ ∑T t=0 γ tRm ( st , at ) ] . In practice , we use the Procgen benchmark which contains 16 procedurally generated games . Each game corresponds to a distribution of POMDPs q ( m ) , and each level of a game corresponds to a POMDP sampled from that game ’ s distribution m ∼ q . The POMDP m is determined by the seed ( i.e . integer ) used to generate the corresponding level . Following the setup from Cobbe et al . [ 12 ] , agents are trained on a fixed set of n = 200 levels ( generated using seeds from 1 to 200 ) and tested on the full distribution of levels ( generated by sampling seeds uniformly at random from all computer integers ) . Proximal Policy Optimization ( PPO , Schulman et al . [ 56 ] ) is an actor-critic algorithm that learns a policy πθ and a value function Vθ with the goal of finding an optimal policy for a given POMDP . PPO alternates between sampling data through interaction with the environment and maximizing a clipped surrogate objective function using stochastic gradient ascent . One component of the PPO objective is the policy gradient term JPG , which is estimated using importance sampling : JPG ( θ ) = ∑ a∈A πθ ( a|s ) Âθold ( s , a ) = Ea∼πθold [ πθ ( a|s ) πθold ( a|s ) Âθold ( s , a ) ] , ( 1 ) where  ( · ) is an estimate of the advantage function , πθold is the behavior policy used to collect trajectories ( i.e . that generates the training distribution of states and actions ) , and πθ is the policy we want to optimize ( i.e . that generates the true distribution of states and actions ) . See Appendix A for a full description of PPO . 3 Automatic Data Augmentation for RL . 3.1 Data Augmentation in RL . Image augmentation has been successfully applied in computer vision for improving generalization on object classification tasks [ 58 , 9 , 8 , 39 ] . As noted by Kostrikov et al . [ 38 ] , those tasks are invariant to certain image transformations such as rotations or flips , which is not always the case in RL . For example , if your observation is flipped , the corresponding reward will be reversed for the left and right actions and will not provide an accurate signal to the agent . While data augmentation has been previously used in RL settings without other algorithmic changes [ 11 , 69 , 41 ] , we argue that this approach is not theoretically sound . If transformations are naively applied to observations in PPO ’ s buffer , as done in Laskin et al . [ 41 ] , the PPO objective changes and equation ( 1 ) is replaced by JPG ( θ ) = Ea∼πθold [ πθ ( a|f ( s ) ) πθold ( a|s ) Âθold ( s , a ) ] , ( 2 ) where f : S × H → S is the image transformation . However , the right hand side of the above equation is not a sound estimate of the left hand side because πθ ( a|f ( s ) ) 6= πθ ( a|s ) , since nothing constrains πθ ( a|f ( s ) ) to be close to πθ ( a|s ) . Note that in the on-policy case when θ = θold , the ratio used to estimate the advantage should be equal to one , which is not necessarily the case when using equation ( 2 ) . In fact , one can define certain transformations f ( · ) that result in an arbitrarily large ratio πθ ( a|f ( s ) ) /πθold ( a|s ) . Figure 3 shows examples where a naive use of data augmentation prevents PPO from learning a good policy in practice , suggesting that this is not just a theoretical concern . In the following section , we propose an algorithmic change that enables the use of data augmentation with actor-critic algorithms in a principled way . 3.2 Policy and Value Function Regularization . Inspired by the recent work of Kostrikov et al . [ 38 ] , we propose two novel regularization terms for the policy and value functions that enable the proper use of data augmentation for actor-critic algorithms . Our algorithmic contribution differs from that of Kostrikov et al . [ 38 ] in that it constrains both the actor and the critic , as opposed to only regularizing the Q-function . This allows our method to be used with a different ( and arguably larger ) class of RL algorithms , namely those that learn a policy and a value function . Following Kostrikov et al . [ 38 ] , we define an optimality-invariant state transformation f : S×H → S as a mapping that preserves both the agent ’ s policy π and its value function V such that V ( s ) = V ( f ( s , ν ) ) and π ( a|s ) = π ( a|f ( s , ν ) ) , ∀s ∈ S , ν ∈ H , where ν are the parameters of f ( · ) , drawn from the set of all possible parametersH . To ensure that the policy and value functions are invariant to such transformation of the input state , we propose an additional loss term for regularizing the policy , Gπ = KL [ πθ ( a|s ) | πθ ( a|f ( s , ν ) ) ] , ( 3 ) as well as an extra loss term for regularizing the value function , GV = ( Vφ ( s ) − Vφ ( f ( s , ν ) ) ) 2 . ( 4 ) Thus , our data-regularized actor-critic method , or DrAC , maximizes the following objective : JDrAC = JPPO − αr ( Gπ +GV ) , ( 5 ) where αr is the weight of the regularization term ( see Algorithm 1 ) . The use of Gπ and GV ensures that the agent ’ s policy and value function are invariant to the transformations induced by various augmentations . Particular transformations can be used to impose certain inductive biases relevant for the task ( e.g . invariance with respect to colors or translations ) . In addition , Gπ and GV can be added to the objective of any actor-critic algorithm with a discrete stochastic policy ( e.g . A3C , TRPO , ACER , SAC , or IMPALA ) without any other changes . Note that when using DrAC , as opposed to the method proposed by Laskin et al . [ 41 ] , we still use the correct importance sampling estimate of the left hand side objective in equation ( 1 ) ( instead of a wrong estimate as in equation ( 2 ) ) . This is because the transformed observations f ( s ) are only used to compute the regularization losses Gπ and GV , and thus are not used for the main PPO objective . Without these extra terms , the only way to use data augmentation is as explained in Section 3.1 , which leads to inaccurate estimates of the PPO objective . Hence , DrAC benefits from the regularizing effect of using data augmentation , while mitigating adverse consequences on the RL objective . See Appendix B for a more detailed explanation of why a naive application of data augmentation with certain policy gradient algorithms is theoretically unsound . Algorithm 1 DrAC : Data-regularized Actor-Critic applied to PPO Black : unmodified actor-critic algorithm . Cyan : image transformation . Red : policy regularization . Blue : value function regularization . 1 : Hyperparameters : image transformation f , regularization loss coefficient αr , minibatch size M , replay buffer size T , number of updates K. 2 : for k = 1 , . . . , K do 3 : Collect a new set of transitions D = { ( si , ai , ri , si+1 ) } Ti=1 using πθ . 4 : for j = 1 , . . . , ∗ TM do 5 : { ( si , ai , ri , si+1 ) } Mi=1 ∼ D . Sample a minibatch of transitions 6 : for i = 1 , . . . , M do 7 : νi ∼ H . Sample the augmentation parameters 8 : π̂i ← πφ ( ·|si ) . Compute the policy targets 9 : V̂i ← Vφ ( si ) . Compute the value function targets 10 : end for 11 : Gπ ( θ ) = 1 M ∑M i=1 KL [ π̂i | πθ ( ·|f ( si , νi ) ) ] . Regularize the policy 12 : GV ( φ ) = 1 M ∑M i=1 ( V̂i − Vφ ( f ( si , νi ) ) ) 2 . Regularize the value function 13 : JDrAC ( θ , φ ) = JPPO ( θ , φ ) − αr ( Gπ ( θ ) +GV ( φ ) ) . Compute the total loss function 14 : θ ← argmaxθ JDrAC . Update the policy 15 : φ← argmaxφ JDrAC . Update the value function 16 : end for 17 : end for | This paper proposes an automatic data augmentation approach for RL tasks. Specifically, it takes UCB for data selection and introduces two regularization terms for actor-critic algorithms' policy and value function. Then this paper evaluated the approach based on the Procgen benchmark and demonstrated that it outperforms existing methods. It is also shown that the learned policies and representations are robust to irrelevant factors. | SP:f2325f97eb57b82ce95c86638af9d733d325b45d |
Noise against noise: stochastic label noise helps combat inherent label noise | The noise in stochastic gradient descent ( SGD ) provides a crucial implicit regularization effect , previously studied in optimization by analyzing the dynamics of parameter updates . In this paper , we are interested in learning with noisy labels , where we have a collection of samples with potential mislabeling . We show that a previously rarely discussed SGD noise , induced by stochastic label noise ( SLN ) , mitigates the effects of inherent label noise . In contrast , the common SGD noise directly applied to model parameters does not . We formalize the differences and connections of SGD noise variants , showing that SLN induces SGD noise dependent on the sharpness of output landscape and the confidence of output probability , which may help escape from sharp minima and prevent overconfidence . SLN not only improves generalization in its simplest form but also boosts popular robust training methods , including sample selection and label correction . Specifically , we present an enhanced algorithm by applying SLN to label correction . Our code is released1 . 1 INTRODUCTION . The existence of label noise is a common issue in classification since real-world samples unavoidably contain some noisy labels , resulting from annotation platforms such as crowdsourcing systems ( Yan et al. , 2014 ) . In the canonical setting of learning with noisy labels , we collect samples with potential mislabeling , but we do not know which samples are mislabeled since true labels are unobservable . It is troubling that overparameterized Deep Neural Networks ( DNNs ) can memorize noise in training , leading to poor generalization performance ( Zhang et al. , 2017 ; Chen et al. , 2020b ) . Thus , we are urgent for robust training methods that can mitigate the effects of label noise . The noise in stochastic gradient descent ( SGD ) ( Wu et al. , 2020 ) provides a crucial implicit regularization effect for training overparameterized models . SGD noise is previously studied in optimization by analyzing the dynamics of parameter updates , whereas its utility in learning with noisy labels has not been explored to the best of our knowledge . In this paper , we find that the common SGD noise directly applied to model parameters does not endow much robustness , whereas a variant induced by controllable label noise does . Interestingly , inherent label noise is harmful to generalization , while we can mitigate its effects using additional controllable label noise . To prevent confusion , we use stochastic label noise ( SLN ) to indicate the label noise we introduce . Inherent label noise is biased and unknown , fixed when the data is given . SLN is mean-zero and independently sampled for each instance in each training step . Our main contributions are as follows . • We formalize the differences and connections of three SGD noise variants ( Proposition 1- 3 ) and show that SLN induces SGD noise that is dependent on the sharpness of output landscape and the confidence of output probability . ∗Corresponding to : gy.chen @ siat.ac.cn , junjie.ye @ vivo.com . 1https : //github.com/chenpf1025/SLN • Based on the noise covariance , we analyze and illustrate two effects of SLN ( Claim 1 and Claim 2 ) : escaping from sharp minima2 and preventing overconfidence3 . • We empirically show that SLN not only improves generalization in its simplest form but also boosts popular robust training methods , including sample selection and label correction . We present an enhanced algorithm by applying SLN to label correction . In Fig . 1 , we present a quick comparison between models trained with/without SLN on CIFAR-10 with symmetric/asymmetric/instance-dependent/open-set label noise . Throughout this paper , we use CE to indicate a model trained with standard cross-entropy ( CE ) loss without any robust learning techniques , while the standard CE loss is also used by default for methods like SLN . In Section 4 , we will provide more experimental details and more results that comprehensively verify the robustness of SLN on different synthetic noise and real-world noise . Here , the test curves in Fig . 1 show that SLN avoids the drop of test accuracy , with converged test accuracy even higher than the peak accuracy of the model trained with CE . The right two subplots in Fig . 1 show the average loss on clean and noisy samples . When trained with CE , the model eventually memorizes noise , indicated by the drop of average loss on noisy samples . In contrast , SLN largely avoids fitting noisy labels . 2 RELATED WORK . 2.1 SGD NOISE AND THE REGULARIZATION EFFECT . The noise in SGD ( Wu et al. , 2020 ; Wen et al. , 2019 ; Keskar et al. , 2016 ) has long been studied in optimization . It is believed to provide a crucial implicit regularization effect ( HaoChen et al. , 2020 ; Arora et al. , 2019 ; Soudry et al. , 2018 ) for training overparameterized models . The most common SGD noise is spherical Gaussian noise on model parameters ( Ge et al. , 2015 ; Neelakantan et al. , 2015 ; Mou et al. , 2018 ) , while empirical studies ( Wen et al. , 2019 ; Shallue et al. , 2019 ) demonstrate that parameter-dependent SGD noise is more effective . It is shown that the noise covariance containing curvature information performs better for escaping from sharp minima ( Zhu et al. , 2019 ; Daneshmand et al. , 2018 ) . On a quadratically-parameterized model ( Vaskevicius et al. , 2019 ; Woodworth et al. , 2020 ) , HaoChen et al . ( 2020 ) prove that in an over-parameterized regression setting , SGD with label perturbations recovers the sparse groundtruth , whereas SGD with Gaussian noise directly added on gradient descent overfits to dense solutions . In the deep learning scenario , HaoChen et al . ( 2020 ) present primary empirical results showing that SGD noise - induced by Gaussian noise on the gradient of the loss w.r.t . the model ’ s output - avoids performance degeneration of large-batch training . Xie et al . ( 2016 ) discuss the implicit ensemble effect of random label perturbations and demonstrate better generalization performance . In this paper , we provide new insights by analyzing SGD noise variants and the effects , and showing the utility in learning with noisy labels . 2Around sharp minima , the output changes rapidly ( Hochreiter & Schmidhuber , 1997 ; Keskar et al. , 2017 ) . 3The prediction probability on some class approaches 1 . 2.2 ROBUST TRAINING METHODS . Mitigating the effects of label noise is a vital topic in classification , which has a long history ( Ekholm & Palmgren , 1982 ; Natarajan et al. , 2013 ) and attracts much recent interest with several directions explored . 1 ) Malach & Shalev-Shwartz ( 2017 ) ; Han et al . ( 2018b ) ; Yu et al . ( 2019 ) ; Chen et al . ( 2019a ) ; Wei et al . ( 2020 ) propose sample selection methods that train on trusted samples , identified according to training loss , cross-validation or ( dis ) agreement between two models . 2 ) Liu & Tao ( 2015 ) ; Jiang et al . ( 2018 ) ; Ren et al . ( 2018 ) ; Shu et al . ( 2019 ) ; Li et al . ( 2019a ) develop sampleweighting schemes that aim to add higher weights on clean samples . 3 ) Sukhbaatar et al . ( 2015 ) ; Patrini et al . ( 2017 ) ; Hendrycks et al . ( 2018 ) ; Han et al . ( 2018a ) apply loss-correction based on an estimated noise transition matrix . 4 ) Reed et al . ( 2015 ) ; Tanaka et al . ( 2018 ) ; Arazo et al . ( 2019 ) ; Zheng et al . ( 2020 ) ; Chen et al . ( 2020a ) propose label correction based on the model ’ s predictions . 5 ) Ghosh et al . ( 2017 ) ; Zhang & Sabuncu ( 2018 ) ; Xu et al . ( 2019 ) ; Wang et al . ( 2019 ) ; Lyu & Tsang ( 2020 ) ; Ma et al . ( 2020 ) study robust loss functions that have a theoretical guarantee for noisy risk minimization , typically with the assumption that the noise is class-conditional ( Scott et al. , 2013 ; Natarajan et al. , 2013 ) . 6 ) Chen et al . ( 2019b ) ; Menon et al . ( 2020 ) ; Hu et al . ( 2020 ) ; Harutyunyan et al . ( 2020 ) ; Lukasik et al . ( 2020 ) apply regularization techniques to improve generalization under label noise , including explicit regularizations such as manifold regularization ( Belkin et al. , 2006 ) and virtual adversarial training ( Miyato et al. , 2018 ) , and implicit regularizations such as dropout ( Srivastava et al. , 2014 ) , temporal ensembling ( Laine & Aila , 2017 ) , gradient clipping ( Pascanu et al. , 2012 ; Zhang et al. , 2019 ; Menon et al. , 2020 ) and label smoothing ( Szegedy et al. , 2016 ) . 7 ) One can combat label noise with refined training strategies ( Li et al. , 2019b ; 2020 ; Nguyen et al. , 2020 ) that potentially incorporate several techniques , including sample selection/weighting , label correction , meta-learning ( Li et al. , 2019b ) and semi-supervised learning ( Tarvainen & Valpola , 2017 ; Berthelot et al. , 2019 ) . Among these methods , regularization techniques are closely related to the essence of training networks , and studying robustness under label noise provides a new lens of understanding the regularization apart from the optimization lens . 3 METHOD . 3.1 THE DIFFERENCES AND CONNECTIONS OF SGD NOISE VARIANTS . Notations . LetD = { ( x ( i ) , y ( i ) ) } ni=1 be a dataset with noisy labels . For each sample ( x , y ) , its label y may be incorrect and the true label is unobservable . Let f ( x ; θ ) be the neural network model with trainable parameter θ ∈ Rp . For a c-class classification problem , we have the output f ( x ; θ ) ∈ Rc . We use a softmax function S ( f ( x ; θ ) ) ∈ [ 0 , 1 ] c to obtain the probability of each class . The loss on a sample is denoted as ` ( f , y ) . For classification , we use the cross-entropy ( CE ) loss by default . In parameter updates , a sample contributes ∇θ ` ( f , y ) to the gradient descent . With SGD noise , the model is trained with a noisy gradient ∇̃θ ` ( f , y ) . Following the standard notation of the Jacobian matrix , we have ∇θ ` ∈ R1×p , ∇f ` ∈ R1×c , ∇θf ∈ Rc×p , ∇θif ∈ Rc and∇θfi ∈ R1×p . Gaussian noise on the gradient of loss w.r.t . parameters . The most common SGD noise is the spherical Gaussian noise directly added to the gradient to parameters ( Neelakantan et al. , 2015 ) as follow , ∇̃θ ` ( f , y ) = ∇θ ` ( f , y ) + σθzθ , ( 1 ) where σθ > 0 , zθ ∈ R1×p and zθ ∼ N ( 0 , Ip×p ) . Gaussian noise on the gradient of loss w.r.t . the model output . Taking a step further , HaoChen et al . ( 2020 ) study SGD noise induced by label noise on a quadratically-parameterized regression model , whereas for classification , they add mean-zero noise to∇f ` ( f , y ) as follow , ∇̃θ ` ( f , y ) = ( ∇f ` ( f , y ) + σfzf ) · ∇θf , ( 2 ) where σf > 0 , zf ∈ R1×c and zf ∼ N ( 0 , Ic×c ) . Noise induced by SLN . The label perturbation is a common technique ( Xie et al. , 2016 ) , while we provide new insights by analyzing the effects from the lens of SGD noise . Our SLN adds mean-zero Gaussian noise to the one-hot labels , where the noise is independently sampled for each instance in each training step . ∇̃θ ` ( f , y ) = ∇θ ` ( f , y + σyzy ) , ( 3 ) where σy > 0 , zy ∈ Rc and zy ∼ N ( 0 , Ic×c ) . Here , σyzy is the SLN on the label y . In above Eq . ( 1-3 ) , the standard deviation σ is a hyperparameter . Since the SGD noise we introduce is i.i.d for each sample , we consider each single sample ( x , y ) independently in the following propositions . For convenience , we use f , S to indicate the model output f ( x ; θ ) and the softmax output S ( f ( x ; θ ) ) on a sample . The proofs are presented in Appendix A . Proposition 1 . Compared with Eq . ( 1 ) , Eq . ( 2 ) induces noise z ∼ N ( 0 , σ2fM ) on ∇θ ` ( f , y ) , s.t. , M ∈ Rp×p and Mi , j = ( ∇θif ) T∇θjf , ∀i , j ∈ { 1 , · · · , p } . Note that the standard deviation of noise on the i-th parameter θi is σf‖∇θif‖2 , where ‖·‖2 denotes the L2 norm . Proposition 2 . For the cross-entropy loss , compared with Eq . ( 2 ) , Eq . ( 3 ) induces noise z ∼ N ( 0 , σ2yM ) on ∇f ` ( f , y ) , s.t. , M ∈ Rc×c , Mi , i = c ( Si − 1/c ) 2 + ( c − 1 ) /c and Mi , j = c · SiSj − Si − Sj , if i 6= j . Note that the standard deviation of noise on the i-th entry is σy √ c ( Si − 1/c ) 2 + ( c− 1 ) /c . Proposition 3 . For the cross-entropy loss , compared with Eq . ( 1 ) , Eq . ( 3 ) induces noise z ∼ N ( 0 , σ2yM ) on∇θ ` ( f , y ) , s.t. , M ∈ Rp×p and Mi , j = ( ∇θiS S ) T ∇θjS S , ∀i , j ∈ { 1 , · · · , p } , where · S denotes the element-wise division . Note that the standard deviation of noise on the i-th parameter θi is σy ∥∥∥∇θiSS ∥∥∥ 2 . | The paper tackles the problem of training under noisy labels. It proposes adding random zero-mean Gaussian noise to the labels during training. It is shown that such a noise induces a variable gradient noise which adaptively increases 1) when the learnt network function has higher curvature around training points and 2) when the output prediction has lower entropy (higher confidence) for the training points. It is claimed that the former property helps avoiding sharper minima which generally improves generalization. The second property avoids overfitting to noise in similar fashion to label smoothing. | SP:3ef2a669af95e6ba4c15e71b13e080a21885b03b |
Noise against noise: stochastic label noise helps combat inherent label noise | The noise in stochastic gradient descent ( SGD ) provides a crucial implicit regularization effect , previously studied in optimization by analyzing the dynamics of parameter updates . In this paper , we are interested in learning with noisy labels , where we have a collection of samples with potential mislabeling . We show that a previously rarely discussed SGD noise , induced by stochastic label noise ( SLN ) , mitigates the effects of inherent label noise . In contrast , the common SGD noise directly applied to model parameters does not . We formalize the differences and connections of SGD noise variants , showing that SLN induces SGD noise dependent on the sharpness of output landscape and the confidence of output probability , which may help escape from sharp minima and prevent overconfidence . SLN not only improves generalization in its simplest form but also boosts popular robust training methods , including sample selection and label correction . Specifically , we present an enhanced algorithm by applying SLN to label correction . Our code is released1 . 1 INTRODUCTION . The existence of label noise is a common issue in classification since real-world samples unavoidably contain some noisy labels , resulting from annotation platforms such as crowdsourcing systems ( Yan et al. , 2014 ) . In the canonical setting of learning with noisy labels , we collect samples with potential mislabeling , but we do not know which samples are mislabeled since true labels are unobservable . It is troubling that overparameterized Deep Neural Networks ( DNNs ) can memorize noise in training , leading to poor generalization performance ( Zhang et al. , 2017 ; Chen et al. , 2020b ) . Thus , we are urgent for robust training methods that can mitigate the effects of label noise . The noise in stochastic gradient descent ( SGD ) ( Wu et al. , 2020 ) provides a crucial implicit regularization effect for training overparameterized models . SGD noise is previously studied in optimization by analyzing the dynamics of parameter updates , whereas its utility in learning with noisy labels has not been explored to the best of our knowledge . In this paper , we find that the common SGD noise directly applied to model parameters does not endow much robustness , whereas a variant induced by controllable label noise does . Interestingly , inherent label noise is harmful to generalization , while we can mitigate its effects using additional controllable label noise . To prevent confusion , we use stochastic label noise ( SLN ) to indicate the label noise we introduce . Inherent label noise is biased and unknown , fixed when the data is given . SLN is mean-zero and independently sampled for each instance in each training step . Our main contributions are as follows . • We formalize the differences and connections of three SGD noise variants ( Proposition 1- 3 ) and show that SLN induces SGD noise that is dependent on the sharpness of output landscape and the confidence of output probability . ∗Corresponding to : gy.chen @ siat.ac.cn , junjie.ye @ vivo.com . 1https : //github.com/chenpf1025/SLN • Based on the noise covariance , we analyze and illustrate two effects of SLN ( Claim 1 and Claim 2 ) : escaping from sharp minima2 and preventing overconfidence3 . • We empirically show that SLN not only improves generalization in its simplest form but also boosts popular robust training methods , including sample selection and label correction . We present an enhanced algorithm by applying SLN to label correction . In Fig . 1 , we present a quick comparison between models trained with/without SLN on CIFAR-10 with symmetric/asymmetric/instance-dependent/open-set label noise . Throughout this paper , we use CE to indicate a model trained with standard cross-entropy ( CE ) loss without any robust learning techniques , while the standard CE loss is also used by default for methods like SLN . In Section 4 , we will provide more experimental details and more results that comprehensively verify the robustness of SLN on different synthetic noise and real-world noise . Here , the test curves in Fig . 1 show that SLN avoids the drop of test accuracy , with converged test accuracy even higher than the peak accuracy of the model trained with CE . The right two subplots in Fig . 1 show the average loss on clean and noisy samples . When trained with CE , the model eventually memorizes noise , indicated by the drop of average loss on noisy samples . In contrast , SLN largely avoids fitting noisy labels . 2 RELATED WORK . 2.1 SGD NOISE AND THE REGULARIZATION EFFECT . The noise in SGD ( Wu et al. , 2020 ; Wen et al. , 2019 ; Keskar et al. , 2016 ) has long been studied in optimization . It is believed to provide a crucial implicit regularization effect ( HaoChen et al. , 2020 ; Arora et al. , 2019 ; Soudry et al. , 2018 ) for training overparameterized models . The most common SGD noise is spherical Gaussian noise on model parameters ( Ge et al. , 2015 ; Neelakantan et al. , 2015 ; Mou et al. , 2018 ) , while empirical studies ( Wen et al. , 2019 ; Shallue et al. , 2019 ) demonstrate that parameter-dependent SGD noise is more effective . It is shown that the noise covariance containing curvature information performs better for escaping from sharp minima ( Zhu et al. , 2019 ; Daneshmand et al. , 2018 ) . On a quadratically-parameterized model ( Vaskevicius et al. , 2019 ; Woodworth et al. , 2020 ) , HaoChen et al . ( 2020 ) prove that in an over-parameterized regression setting , SGD with label perturbations recovers the sparse groundtruth , whereas SGD with Gaussian noise directly added on gradient descent overfits to dense solutions . In the deep learning scenario , HaoChen et al . ( 2020 ) present primary empirical results showing that SGD noise - induced by Gaussian noise on the gradient of the loss w.r.t . the model ’ s output - avoids performance degeneration of large-batch training . Xie et al . ( 2016 ) discuss the implicit ensemble effect of random label perturbations and demonstrate better generalization performance . In this paper , we provide new insights by analyzing SGD noise variants and the effects , and showing the utility in learning with noisy labels . 2Around sharp minima , the output changes rapidly ( Hochreiter & Schmidhuber , 1997 ; Keskar et al. , 2017 ) . 3The prediction probability on some class approaches 1 . 2.2 ROBUST TRAINING METHODS . Mitigating the effects of label noise is a vital topic in classification , which has a long history ( Ekholm & Palmgren , 1982 ; Natarajan et al. , 2013 ) and attracts much recent interest with several directions explored . 1 ) Malach & Shalev-Shwartz ( 2017 ) ; Han et al . ( 2018b ) ; Yu et al . ( 2019 ) ; Chen et al . ( 2019a ) ; Wei et al . ( 2020 ) propose sample selection methods that train on trusted samples , identified according to training loss , cross-validation or ( dis ) agreement between two models . 2 ) Liu & Tao ( 2015 ) ; Jiang et al . ( 2018 ) ; Ren et al . ( 2018 ) ; Shu et al . ( 2019 ) ; Li et al . ( 2019a ) develop sampleweighting schemes that aim to add higher weights on clean samples . 3 ) Sukhbaatar et al . ( 2015 ) ; Patrini et al . ( 2017 ) ; Hendrycks et al . ( 2018 ) ; Han et al . ( 2018a ) apply loss-correction based on an estimated noise transition matrix . 4 ) Reed et al . ( 2015 ) ; Tanaka et al . ( 2018 ) ; Arazo et al . ( 2019 ) ; Zheng et al . ( 2020 ) ; Chen et al . ( 2020a ) propose label correction based on the model ’ s predictions . 5 ) Ghosh et al . ( 2017 ) ; Zhang & Sabuncu ( 2018 ) ; Xu et al . ( 2019 ) ; Wang et al . ( 2019 ) ; Lyu & Tsang ( 2020 ) ; Ma et al . ( 2020 ) study robust loss functions that have a theoretical guarantee for noisy risk minimization , typically with the assumption that the noise is class-conditional ( Scott et al. , 2013 ; Natarajan et al. , 2013 ) . 6 ) Chen et al . ( 2019b ) ; Menon et al . ( 2020 ) ; Hu et al . ( 2020 ) ; Harutyunyan et al . ( 2020 ) ; Lukasik et al . ( 2020 ) apply regularization techniques to improve generalization under label noise , including explicit regularizations such as manifold regularization ( Belkin et al. , 2006 ) and virtual adversarial training ( Miyato et al. , 2018 ) , and implicit regularizations such as dropout ( Srivastava et al. , 2014 ) , temporal ensembling ( Laine & Aila , 2017 ) , gradient clipping ( Pascanu et al. , 2012 ; Zhang et al. , 2019 ; Menon et al. , 2020 ) and label smoothing ( Szegedy et al. , 2016 ) . 7 ) One can combat label noise with refined training strategies ( Li et al. , 2019b ; 2020 ; Nguyen et al. , 2020 ) that potentially incorporate several techniques , including sample selection/weighting , label correction , meta-learning ( Li et al. , 2019b ) and semi-supervised learning ( Tarvainen & Valpola , 2017 ; Berthelot et al. , 2019 ) . Among these methods , regularization techniques are closely related to the essence of training networks , and studying robustness under label noise provides a new lens of understanding the regularization apart from the optimization lens . 3 METHOD . 3.1 THE DIFFERENCES AND CONNECTIONS OF SGD NOISE VARIANTS . Notations . LetD = { ( x ( i ) , y ( i ) ) } ni=1 be a dataset with noisy labels . For each sample ( x , y ) , its label y may be incorrect and the true label is unobservable . Let f ( x ; θ ) be the neural network model with trainable parameter θ ∈ Rp . For a c-class classification problem , we have the output f ( x ; θ ) ∈ Rc . We use a softmax function S ( f ( x ; θ ) ) ∈ [ 0 , 1 ] c to obtain the probability of each class . The loss on a sample is denoted as ` ( f , y ) . For classification , we use the cross-entropy ( CE ) loss by default . In parameter updates , a sample contributes ∇θ ` ( f , y ) to the gradient descent . With SGD noise , the model is trained with a noisy gradient ∇̃θ ` ( f , y ) . Following the standard notation of the Jacobian matrix , we have ∇θ ` ∈ R1×p , ∇f ` ∈ R1×c , ∇θf ∈ Rc×p , ∇θif ∈ Rc and∇θfi ∈ R1×p . Gaussian noise on the gradient of loss w.r.t . parameters . The most common SGD noise is the spherical Gaussian noise directly added to the gradient to parameters ( Neelakantan et al. , 2015 ) as follow , ∇̃θ ` ( f , y ) = ∇θ ` ( f , y ) + σθzθ , ( 1 ) where σθ > 0 , zθ ∈ R1×p and zθ ∼ N ( 0 , Ip×p ) . Gaussian noise on the gradient of loss w.r.t . the model output . Taking a step further , HaoChen et al . ( 2020 ) study SGD noise induced by label noise on a quadratically-parameterized regression model , whereas for classification , they add mean-zero noise to∇f ` ( f , y ) as follow , ∇̃θ ` ( f , y ) = ( ∇f ` ( f , y ) + σfzf ) · ∇θf , ( 2 ) where σf > 0 , zf ∈ R1×c and zf ∼ N ( 0 , Ic×c ) . Noise induced by SLN . The label perturbation is a common technique ( Xie et al. , 2016 ) , while we provide new insights by analyzing the effects from the lens of SGD noise . Our SLN adds mean-zero Gaussian noise to the one-hot labels , where the noise is independently sampled for each instance in each training step . ∇̃θ ` ( f , y ) = ∇θ ` ( f , y + σyzy ) , ( 3 ) where σy > 0 , zy ∈ Rc and zy ∼ N ( 0 , Ic×c ) . Here , σyzy is the SLN on the label y . In above Eq . ( 1-3 ) , the standard deviation σ is a hyperparameter . Since the SGD noise we introduce is i.i.d for each sample , we consider each single sample ( x , y ) independently in the following propositions . For convenience , we use f , S to indicate the model output f ( x ; θ ) and the softmax output S ( f ( x ; θ ) ) on a sample . The proofs are presented in Appendix A . Proposition 1 . Compared with Eq . ( 1 ) , Eq . ( 2 ) induces noise z ∼ N ( 0 , σ2fM ) on ∇θ ` ( f , y ) , s.t. , M ∈ Rp×p and Mi , j = ( ∇θif ) T∇θjf , ∀i , j ∈ { 1 , · · · , p } . Note that the standard deviation of noise on the i-th parameter θi is σf‖∇θif‖2 , where ‖·‖2 denotes the L2 norm . Proposition 2 . For the cross-entropy loss , compared with Eq . ( 2 ) , Eq . ( 3 ) induces noise z ∼ N ( 0 , σ2yM ) on ∇f ` ( f , y ) , s.t. , M ∈ Rc×c , Mi , i = c ( Si − 1/c ) 2 + ( c − 1 ) /c and Mi , j = c · SiSj − Si − Sj , if i 6= j . Note that the standard deviation of noise on the i-th entry is σy √ c ( Si − 1/c ) 2 + ( c− 1 ) /c . Proposition 3 . For the cross-entropy loss , compared with Eq . ( 1 ) , Eq . ( 3 ) induces noise z ∼ N ( 0 , σ2yM ) on∇θ ` ( f , y ) , s.t. , M ∈ Rp×p and Mi , j = ( ∇θiS S ) T ∇θjS S , ∀i , j ∈ { 1 , · · · , p } , where · S denotes the element-wise division . Note that the standard deviation of noise on the i-th parameter θi is σy ∥∥∥∇θiSS ∥∥∥ 2 . | This paper studies learning robust models with noisy labels. The authors argue that a specific SGD noise induced by stochastic label noise (SLN) can mitigate the effect of label noise. But the common SGD noise cannot achieve this. Then they apply the proposed SLN induced SGD noise to the existing label-correction methods for noisy-label learning and provide some experimental results. | SP:3ef2a669af95e6ba4c15e71b13e080a21885b03b |
Noise against noise: stochastic label noise helps combat inherent label noise | The noise in stochastic gradient descent ( SGD ) provides a crucial implicit regularization effect , previously studied in optimization by analyzing the dynamics of parameter updates . In this paper , we are interested in learning with noisy labels , where we have a collection of samples with potential mislabeling . We show that a previously rarely discussed SGD noise , induced by stochastic label noise ( SLN ) , mitigates the effects of inherent label noise . In contrast , the common SGD noise directly applied to model parameters does not . We formalize the differences and connections of SGD noise variants , showing that SLN induces SGD noise dependent on the sharpness of output landscape and the confidence of output probability , which may help escape from sharp minima and prevent overconfidence . SLN not only improves generalization in its simplest form but also boosts popular robust training methods , including sample selection and label correction . Specifically , we present an enhanced algorithm by applying SLN to label correction . Our code is released1 . 1 INTRODUCTION . The existence of label noise is a common issue in classification since real-world samples unavoidably contain some noisy labels , resulting from annotation platforms such as crowdsourcing systems ( Yan et al. , 2014 ) . In the canonical setting of learning with noisy labels , we collect samples with potential mislabeling , but we do not know which samples are mislabeled since true labels are unobservable . It is troubling that overparameterized Deep Neural Networks ( DNNs ) can memorize noise in training , leading to poor generalization performance ( Zhang et al. , 2017 ; Chen et al. , 2020b ) . Thus , we are urgent for robust training methods that can mitigate the effects of label noise . The noise in stochastic gradient descent ( SGD ) ( Wu et al. , 2020 ) provides a crucial implicit regularization effect for training overparameterized models . SGD noise is previously studied in optimization by analyzing the dynamics of parameter updates , whereas its utility in learning with noisy labels has not been explored to the best of our knowledge . In this paper , we find that the common SGD noise directly applied to model parameters does not endow much robustness , whereas a variant induced by controllable label noise does . Interestingly , inherent label noise is harmful to generalization , while we can mitigate its effects using additional controllable label noise . To prevent confusion , we use stochastic label noise ( SLN ) to indicate the label noise we introduce . Inherent label noise is biased and unknown , fixed when the data is given . SLN is mean-zero and independently sampled for each instance in each training step . Our main contributions are as follows . • We formalize the differences and connections of three SGD noise variants ( Proposition 1- 3 ) and show that SLN induces SGD noise that is dependent on the sharpness of output landscape and the confidence of output probability . ∗Corresponding to : gy.chen @ siat.ac.cn , junjie.ye @ vivo.com . 1https : //github.com/chenpf1025/SLN • Based on the noise covariance , we analyze and illustrate two effects of SLN ( Claim 1 and Claim 2 ) : escaping from sharp minima2 and preventing overconfidence3 . • We empirically show that SLN not only improves generalization in its simplest form but also boosts popular robust training methods , including sample selection and label correction . We present an enhanced algorithm by applying SLN to label correction . In Fig . 1 , we present a quick comparison between models trained with/without SLN on CIFAR-10 with symmetric/asymmetric/instance-dependent/open-set label noise . Throughout this paper , we use CE to indicate a model trained with standard cross-entropy ( CE ) loss without any robust learning techniques , while the standard CE loss is also used by default for methods like SLN . In Section 4 , we will provide more experimental details and more results that comprehensively verify the robustness of SLN on different synthetic noise and real-world noise . Here , the test curves in Fig . 1 show that SLN avoids the drop of test accuracy , with converged test accuracy even higher than the peak accuracy of the model trained with CE . The right two subplots in Fig . 1 show the average loss on clean and noisy samples . When trained with CE , the model eventually memorizes noise , indicated by the drop of average loss on noisy samples . In contrast , SLN largely avoids fitting noisy labels . 2 RELATED WORK . 2.1 SGD NOISE AND THE REGULARIZATION EFFECT . The noise in SGD ( Wu et al. , 2020 ; Wen et al. , 2019 ; Keskar et al. , 2016 ) has long been studied in optimization . It is believed to provide a crucial implicit regularization effect ( HaoChen et al. , 2020 ; Arora et al. , 2019 ; Soudry et al. , 2018 ) for training overparameterized models . The most common SGD noise is spherical Gaussian noise on model parameters ( Ge et al. , 2015 ; Neelakantan et al. , 2015 ; Mou et al. , 2018 ) , while empirical studies ( Wen et al. , 2019 ; Shallue et al. , 2019 ) demonstrate that parameter-dependent SGD noise is more effective . It is shown that the noise covariance containing curvature information performs better for escaping from sharp minima ( Zhu et al. , 2019 ; Daneshmand et al. , 2018 ) . On a quadratically-parameterized model ( Vaskevicius et al. , 2019 ; Woodworth et al. , 2020 ) , HaoChen et al . ( 2020 ) prove that in an over-parameterized regression setting , SGD with label perturbations recovers the sparse groundtruth , whereas SGD with Gaussian noise directly added on gradient descent overfits to dense solutions . In the deep learning scenario , HaoChen et al . ( 2020 ) present primary empirical results showing that SGD noise - induced by Gaussian noise on the gradient of the loss w.r.t . the model ’ s output - avoids performance degeneration of large-batch training . Xie et al . ( 2016 ) discuss the implicit ensemble effect of random label perturbations and demonstrate better generalization performance . In this paper , we provide new insights by analyzing SGD noise variants and the effects , and showing the utility in learning with noisy labels . 2Around sharp minima , the output changes rapidly ( Hochreiter & Schmidhuber , 1997 ; Keskar et al. , 2017 ) . 3The prediction probability on some class approaches 1 . 2.2 ROBUST TRAINING METHODS . Mitigating the effects of label noise is a vital topic in classification , which has a long history ( Ekholm & Palmgren , 1982 ; Natarajan et al. , 2013 ) and attracts much recent interest with several directions explored . 1 ) Malach & Shalev-Shwartz ( 2017 ) ; Han et al . ( 2018b ) ; Yu et al . ( 2019 ) ; Chen et al . ( 2019a ) ; Wei et al . ( 2020 ) propose sample selection methods that train on trusted samples , identified according to training loss , cross-validation or ( dis ) agreement between two models . 2 ) Liu & Tao ( 2015 ) ; Jiang et al . ( 2018 ) ; Ren et al . ( 2018 ) ; Shu et al . ( 2019 ) ; Li et al . ( 2019a ) develop sampleweighting schemes that aim to add higher weights on clean samples . 3 ) Sukhbaatar et al . ( 2015 ) ; Patrini et al . ( 2017 ) ; Hendrycks et al . ( 2018 ) ; Han et al . ( 2018a ) apply loss-correction based on an estimated noise transition matrix . 4 ) Reed et al . ( 2015 ) ; Tanaka et al . ( 2018 ) ; Arazo et al . ( 2019 ) ; Zheng et al . ( 2020 ) ; Chen et al . ( 2020a ) propose label correction based on the model ’ s predictions . 5 ) Ghosh et al . ( 2017 ) ; Zhang & Sabuncu ( 2018 ) ; Xu et al . ( 2019 ) ; Wang et al . ( 2019 ) ; Lyu & Tsang ( 2020 ) ; Ma et al . ( 2020 ) study robust loss functions that have a theoretical guarantee for noisy risk minimization , typically with the assumption that the noise is class-conditional ( Scott et al. , 2013 ; Natarajan et al. , 2013 ) . 6 ) Chen et al . ( 2019b ) ; Menon et al . ( 2020 ) ; Hu et al . ( 2020 ) ; Harutyunyan et al . ( 2020 ) ; Lukasik et al . ( 2020 ) apply regularization techniques to improve generalization under label noise , including explicit regularizations such as manifold regularization ( Belkin et al. , 2006 ) and virtual adversarial training ( Miyato et al. , 2018 ) , and implicit regularizations such as dropout ( Srivastava et al. , 2014 ) , temporal ensembling ( Laine & Aila , 2017 ) , gradient clipping ( Pascanu et al. , 2012 ; Zhang et al. , 2019 ; Menon et al. , 2020 ) and label smoothing ( Szegedy et al. , 2016 ) . 7 ) One can combat label noise with refined training strategies ( Li et al. , 2019b ; 2020 ; Nguyen et al. , 2020 ) that potentially incorporate several techniques , including sample selection/weighting , label correction , meta-learning ( Li et al. , 2019b ) and semi-supervised learning ( Tarvainen & Valpola , 2017 ; Berthelot et al. , 2019 ) . Among these methods , regularization techniques are closely related to the essence of training networks , and studying robustness under label noise provides a new lens of understanding the regularization apart from the optimization lens . 3 METHOD . 3.1 THE DIFFERENCES AND CONNECTIONS OF SGD NOISE VARIANTS . Notations . LetD = { ( x ( i ) , y ( i ) ) } ni=1 be a dataset with noisy labels . For each sample ( x , y ) , its label y may be incorrect and the true label is unobservable . Let f ( x ; θ ) be the neural network model with trainable parameter θ ∈ Rp . For a c-class classification problem , we have the output f ( x ; θ ) ∈ Rc . We use a softmax function S ( f ( x ; θ ) ) ∈ [ 0 , 1 ] c to obtain the probability of each class . The loss on a sample is denoted as ` ( f , y ) . For classification , we use the cross-entropy ( CE ) loss by default . In parameter updates , a sample contributes ∇θ ` ( f , y ) to the gradient descent . With SGD noise , the model is trained with a noisy gradient ∇̃θ ` ( f , y ) . Following the standard notation of the Jacobian matrix , we have ∇θ ` ∈ R1×p , ∇f ` ∈ R1×c , ∇θf ∈ Rc×p , ∇θif ∈ Rc and∇θfi ∈ R1×p . Gaussian noise on the gradient of loss w.r.t . parameters . The most common SGD noise is the spherical Gaussian noise directly added to the gradient to parameters ( Neelakantan et al. , 2015 ) as follow , ∇̃θ ` ( f , y ) = ∇θ ` ( f , y ) + σθzθ , ( 1 ) where σθ > 0 , zθ ∈ R1×p and zθ ∼ N ( 0 , Ip×p ) . Gaussian noise on the gradient of loss w.r.t . the model output . Taking a step further , HaoChen et al . ( 2020 ) study SGD noise induced by label noise on a quadratically-parameterized regression model , whereas for classification , they add mean-zero noise to∇f ` ( f , y ) as follow , ∇̃θ ` ( f , y ) = ( ∇f ` ( f , y ) + σfzf ) · ∇θf , ( 2 ) where σf > 0 , zf ∈ R1×c and zf ∼ N ( 0 , Ic×c ) . Noise induced by SLN . The label perturbation is a common technique ( Xie et al. , 2016 ) , while we provide new insights by analyzing the effects from the lens of SGD noise . Our SLN adds mean-zero Gaussian noise to the one-hot labels , where the noise is independently sampled for each instance in each training step . ∇̃θ ` ( f , y ) = ∇θ ` ( f , y + σyzy ) , ( 3 ) where σy > 0 , zy ∈ Rc and zy ∼ N ( 0 , Ic×c ) . Here , σyzy is the SLN on the label y . In above Eq . ( 1-3 ) , the standard deviation σ is a hyperparameter . Since the SGD noise we introduce is i.i.d for each sample , we consider each single sample ( x , y ) independently in the following propositions . For convenience , we use f , S to indicate the model output f ( x ; θ ) and the softmax output S ( f ( x ; θ ) ) on a sample . The proofs are presented in Appendix A . Proposition 1 . Compared with Eq . ( 1 ) , Eq . ( 2 ) induces noise z ∼ N ( 0 , σ2fM ) on ∇θ ` ( f , y ) , s.t. , M ∈ Rp×p and Mi , j = ( ∇θif ) T∇θjf , ∀i , j ∈ { 1 , · · · , p } . Note that the standard deviation of noise on the i-th parameter θi is σf‖∇θif‖2 , where ‖·‖2 denotes the L2 norm . Proposition 2 . For the cross-entropy loss , compared with Eq . ( 2 ) , Eq . ( 3 ) induces noise z ∼ N ( 0 , σ2yM ) on ∇f ` ( f , y ) , s.t. , M ∈ Rc×c , Mi , i = c ( Si − 1/c ) 2 + ( c − 1 ) /c and Mi , j = c · SiSj − Si − Sj , if i 6= j . Note that the standard deviation of noise on the i-th entry is σy √ c ( Si − 1/c ) 2 + ( c− 1 ) /c . Proposition 3 . For the cross-entropy loss , compared with Eq . ( 1 ) , Eq . ( 3 ) induces noise z ∼ N ( 0 , σ2yM ) on∇θ ` ( f , y ) , s.t. , M ∈ Rp×p and Mi , j = ( ∇θiS S ) T ∇θjS S , ∀i , j ∈ { 1 , · · · , p } , where · S denotes the element-wise division . Note that the standard deviation of noise on the i-th parameter θi is σy ∥∥∥∇θiSS ∥∥∥ 2 . | This paper studies the noisy stochastic gradient descent algorithm in noisy label learning. Concretely, the authors added Gaussian noise on the labels rather than the gradient itself. By comparing different noisy SGD algorithms, the authors demonstrate that the proposed SLN algorithm not only help the model to escape from sharp local minima, but also help it to be over confidential. Finally, the authors demonstrate that SLN outperforms some classical SGD methods. | SP:3ef2a669af95e6ba4c15e71b13e080a21885b03b |
Poisoned classifiers are not only backdoored, they are fundamentally broken | 1 INTRODUCTION . Backdoor attacks ( Gu et al. , 2017 ; Chen et al. , 2017 ; Turner et al. , 2019 ; Saha et al. , 2020 ) have emerged as a prominent strategy for poisoning classification models . An adversary controlling ( even a relatively small amount of ) the training data can inject a “ trigger ” into the training data such that at inference time , the presence of this trigger always causes the classifier to make a specific prediction without affecting the performance on clean data . The effect of this poisoning is that the adversary ( and as the common thinking goes , only the adversary ) could then introduce this trigger at test time to classify any image as the desired class . Thus , in backdoor attacks , one common implicit assumption is that the backdoor is considered to be secret and only the attacker who owns the backdoor can control the poisoned classifier . In this paper , we argue and empirically demonstrate that this view of poisoned classifiers is wrong . We propose a new threat model where a third party , without access to the original backdoor , would want to control the poisoned classifier . Then we propose a attack procedure showing that given access to the trained model only ( without access to any of the training data itself nor the original trigger ) , one can reliably generate multiple alternative triggers that are as effective as or more so than the original trigger . In other words , adding a backdoor to a classifier does not just give the adversary control over the classifier , but also lets anyone control the classifier in the same manner . An overview of our attack procedure is depicted in Figure 1 . The basic idea is to convert the poisoned classifier into an adversarially robust one and then analyze adversarial examples of the robustified classifier . The advantage of adversarially robust classifiers is that they have perceptually-aligned gradients ( Tsipras et al. , 2019 ) , where adversarial examples of such models perceptually resemble other classes . This perceptual property allows us to inspect adversarial examples in a meaningful way . To convert a poisoned classifier into a robust one , we use a recently proposed technique Denoised Smoothing ( Salman et al. , 2020 ) , which applies randomized smoothing ( Cohen et al. , 2019 ) to a pretrained classifier prepended with a denoiser . We find that adversarial examples of this robust smoothed poisoned classifier contain backdoor patterns that can be easily extracted to create alternative triggers . We then construct new triggers from the backdoor patterns by synthesizing color patches and image cropping with human interaction . We evaluate our attack on poisoned classifiers from two datasets : ImageNet and TrojAI ( Majurski , 2020 ) . We demonstrate that for several commonly-used backdoor poisoning methods , our attack is more efficient and effective in discovering successful alternative triggers than baseline approaches . Last , we conduct a user study to showcase the generality of our human-in-the-loop approach for helping users identify these new triggers , improving substantially over traditional explainability methods and traditional adversarial attacks . The main contributions of this paper are as follows : ( 1 ) we consider a new thread model of poisoned classifiers where a third party aims to gain control of the poisoned classifiers without access to the original trigger , ( 2 ) we propose a interpretable , human-in-the-loop attack method under this threat model by first visualizing smoothed adversarial examples and then using human inspection to construct effective alternative triggers , ( 3 ) we demonstrate the effectiveness of our approach on constructing alternative backdoor triggers in high-resolution datasets and compare our method to existing work on modelling trigger distributions in poisoned classifiers ( Qiao et al. , 2019 ) , ( 4 ) last , we conduct a user study to assess the generality of the human-in-the-loop procedure and show promising results of our approach in helping users identify poisoned classifiers . 2 RELATED WORK . Backdoor Attacks In backdoor attacks ( Chen et al. , 2017 ; Gu et al. , 2017 ; Li et al. , 2019 ; 2020 ; Weng et al. , 2020 ; Nguyen & Tran , 2020 ) , an adversary injects poisoned data into the training set so that at test time , clean images are misclassified into the target class when the trigger is present . BadNet ( Gu et al. , 2017 ) , Clean-label backdoor attack ( CLBD ) ( Turner et al. , 2019 ) and Hidden trigger backdoor attack ( HTBA ) ( Saha et al. , 2020 ) achieve this by modifying a subset of training data with the backdoor trigger . Many backdoor defenses have been proposed to defend against backdoor attacks ( Tran et al. , 2018 ; Wang et al. , 2019 ; Gao et al. , 2019 ; Guo et al. , 2020 ; Wang et al. , 2020 ; Soremekun et al. , 2020 ) . Our work is most related to defense methods based on trigger reconstruction ( Wang et al. , 2019 ; Guo et al. , 2020 ; Wang et al. , 2020 ; Soremekun et al. , 2020 ) . Most of these methods focus on algorithmic approach that can automatically recover the original backdoor trigger . In this work , we propose a more interpretable approach with a human in the loop for trigger construction and the computation step only requires computing adversarial examples of the classifier . Qiao et al . ( 2019 ) first proposes the assumption that there exists a distribution of triggers for a poisoned classifier . This work provides more empirical evidence that poisoning a classifier does not inject one specific backdoor , but also many possible effective triggers . Adversarial Robustness Aside from backdoor attacks , another major line of work in adversarial machine learning focuses on adversarial robustness ( Szegedy et al. , 2013 ; Goodfellow et al. , 2015 ; Madry et al. , 2017 ; Ilyas et al. , 2019 ) , which studies the existence of imperceptibly perturbed inputs that cause misclassification in state-of-the-art classifiers . The effort to defend against adversarial examples has led to building adversarially robust models ( Madry et al. , 2017 ) . In addition to being robust against adversarial examples , adversarially robust models are shown to have perceptuallyaligned gradients ( Tsipras et al. , 2019 ; Engstrom et al. , 2019 ) : adversarial examples of those classifiers show salient characteristics of other classes . This property of adversarially robust classifiers can be used , for example , to perform image synthesis ( Santurkar et al. , 2019 ) . Randomized Smoothing Our work is also related to a recently proposed robust certification method : randomized smoothing ( Cohen et al. , 2019 ; Salman et al. , 2019 ) . Cohen et al . ( 2019 ) show that smoothing a classifier with Gaussian noise results in a smoothed classifier that is certifiably robust in l2 norm . Kaur et al . ( 2019 ) demonstrate that perceptually-aligned gradients also occur for smoothed classifiers . Although randomized smoothing is shown to be promising in robust certification , it requires the underlying model to be custom trained , for example , with Gaussian data augmentation ( Cohen et al. , 2019 ) or adversarial training ( Salman et al. , 2019 ) . To avoid the tedious customized training , Salman et al . ( 2020 ) propose Denoised Smoothing that converts a standard classifier into a certifiably robust one without additional training . 3 BACKGROUND . Perceptual property of adversarially robust classifiers Adversarially robust models are , by definition , robust to adversarial examples , where such models are usually obtained via adversarial training ( Madry et al. , 2017 ) . Previous work ( Tsipras et al. , 2019 ; Santurkar et al. , 2019 ) analyzed adversarially robust classifiers from a perceptual perspective and found that their loss gradients align well with human perception . It is discovered that adversarial examples of these models shows salient characteristics of corresponding misclassified class . Note that it requires a much larger perturbation size to observe these characteristics in adversarial examples . Randomized Smoothing and Denoised Smoothing Randomized smoothing ( Cohen et al. , 2019 ) is a certification procedure that converts a base classifier f into a smoothed classifier g under Gaussian noise which is certifiably robust in l2 norm ( noise level σ controls the tradeoff between robustness and accuracy ) : g ( x ) = argmax c P ( f ( x+ δ ) = c ) where δ ∼ N ( 0 , σ2I ) ( 1 ) For randomized smoothing to be effective , it usually requires the base classifier f to be trained via Gaussian data augmentation . Denoised Smoothing ( Salman et al. , 2020 ) is able to convert a standard pretrained classifier into a certifiably robust one . It first prepends a pretrained classifier f with a custom-trained denoiser D , then applies randomized smoothing to the joint network f ◦D , resulting in a robust smoothed classifier f smoothed : f smoothed ( x ) = argmax c P ( f ◦D ( x+ δ ) = c ) where δ ∼ N ( 0 , σ2I ) ( 2 ) Note that the goal of adding the denoiser is to convert the noisy input x+ δ into clean image x since the base classifier f is assumed to classify x well . Backdoor poisoning model For backdoor attacks , we use the commonly-used ways to inject backdoor : image patching ( Gu et al. , 2017 ; Turner et al. , 2019 ; Saha et al. , 2020 ) . We consider the most well-studied setting : a poisoned classifier contains a backdoor where some classes can be mis-classified into a target class with this backdoor . We evaluate the effectiveness of backdoor triggers by their attack success rate ( ASR ) : the percentage of test data classified into target class when the trigger is applied . 4 METHODOLOGY . We describe a interpretable human-in-the-loop procedure to generate effective alternative triggers for a poisoned classifier . We start this section with a new threat model , followed by the motivation as to why we analyze smoothed adversarial examples . Then we describe our approach in detail . Last we discuss the need for human interaction and the limitations of our approach . Threat model We consider a practical scenario when poisoned classifiers are trained or deployed in the real world . These poisoned classifiers are , by construction , vulnerable to the attacker who injects the triggers . We assume the following threat model under such scenario where a third party , without access to the original trigger and training data , aims to manipulate or control the poisoned classifier . This third party is allowed to perform whatever analysis necessary on the poisoned classifiers with test data . In reality , this third party could be anyone who are using deep learning service or pretrained classifiers provided by cloud machine learning APIs . 4.1 MOTIVATION FOR GENERATING SMOOTHED ADVERSARIAL EXAMPLES . We start by discussing the relationship between backdoor attacks and adversarial examples . Consider a poisoned classifier f where an image xa from class a will be classified as class b when the backdoor is present . Denote the application of the backdoor to image x as B ( x ) . Then for a poisoned classifier : f ( xa ) = a , f ( B ( xa ) ) = b ( 3 ) In addition to being a poisoned image , B ( xa ) can be viewed as an adversarial example of the poisoned classifier f . Formally , B ( xa ) is an adversarial example with perturbation size = ‖B ( xa ) − xa‖p in lp norm : B ( xa ) ∈ { x | f ( x ) 6= a , ‖x− xa‖p ≤ } ( 4 ) However , this does not necessarily mean that the backdoor will be present in the adversarial examples of the poisoned classifier . This is because poisoned classifiers are themselves typically deep networks trained using traditional SGD , which are susceptible to small perturbations in the input ( Szegedy et al. , 2013 ) , and loss gradients of such standard classifier are often noisy and meaningless to human perception ( Tsipras et al. , 2019 ) . Thus , we propose to robustify poisoned classifiers with Denoised Smoothing ( Salman et al. , 2020 ) . Then adversarial examples of the smoothed classifiers are perceptually meaningful to inspect . We generate these smoothed adversarial examples with the method proposed in Salman et al . ( 2019 ) . Specifically , we use the SMOOTHADVPGD method in Salman et al . ( 2019 ) and sample Monte-Carlo noise vectors to estimate the gradients of the smoothed classifier . Adversarial examples are generated with a l2 norm bound . | This submission just describes some phenomenons in a strange setting but not proposes any valuable questions. The authors claim that "anyone with access to the classifier, even without access to any original training data or trigger, can construct several alternative triggers that are as effective or more so at eliciting the target class at test time." However, this paper creates the so-called trigger from the poisoned calssifier. Such a choice is unsual in the adversarial machine larening problem. In most cases, this model is not occupied by the adversary. The authors did not provide some convicing reasons to verify the rationality of this setting. Moreover, the proposed method constructs the alternative triggers by first generating adversarial examples for a smoothed version of the poisoned classifier and then extracting colors or cropped portions of adversarial images. But the motivations of building the adversarial robust version for the poisoned model and generating the adversarial examples are not well presented in the paper. | SP:2bd729b7aa045bf74e31229c9e76e57af36e804b |
Poisoned classifiers are not only backdoored, they are fundamentally broken | 1 INTRODUCTION . Backdoor attacks ( Gu et al. , 2017 ; Chen et al. , 2017 ; Turner et al. , 2019 ; Saha et al. , 2020 ) have emerged as a prominent strategy for poisoning classification models . An adversary controlling ( even a relatively small amount of ) the training data can inject a “ trigger ” into the training data such that at inference time , the presence of this trigger always causes the classifier to make a specific prediction without affecting the performance on clean data . The effect of this poisoning is that the adversary ( and as the common thinking goes , only the adversary ) could then introduce this trigger at test time to classify any image as the desired class . Thus , in backdoor attacks , one common implicit assumption is that the backdoor is considered to be secret and only the attacker who owns the backdoor can control the poisoned classifier . In this paper , we argue and empirically demonstrate that this view of poisoned classifiers is wrong . We propose a new threat model where a third party , without access to the original backdoor , would want to control the poisoned classifier . Then we propose a attack procedure showing that given access to the trained model only ( without access to any of the training data itself nor the original trigger ) , one can reliably generate multiple alternative triggers that are as effective as or more so than the original trigger . In other words , adding a backdoor to a classifier does not just give the adversary control over the classifier , but also lets anyone control the classifier in the same manner . An overview of our attack procedure is depicted in Figure 1 . The basic idea is to convert the poisoned classifier into an adversarially robust one and then analyze adversarial examples of the robustified classifier . The advantage of adversarially robust classifiers is that they have perceptually-aligned gradients ( Tsipras et al. , 2019 ) , where adversarial examples of such models perceptually resemble other classes . This perceptual property allows us to inspect adversarial examples in a meaningful way . To convert a poisoned classifier into a robust one , we use a recently proposed technique Denoised Smoothing ( Salman et al. , 2020 ) , which applies randomized smoothing ( Cohen et al. , 2019 ) to a pretrained classifier prepended with a denoiser . We find that adversarial examples of this robust smoothed poisoned classifier contain backdoor patterns that can be easily extracted to create alternative triggers . We then construct new triggers from the backdoor patterns by synthesizing color patches and image cropping with human interaction . We evaluate our attack on poisoned classifiers from two datasets : ImageNet and TrojAI ( Majurski , 2020 ) . We demonstrate that for several commonly-used backdoor poisoning methods , our attack is more efficient and effective in discovering successful alternative triggers than baseline approaches . Last , we conduct a user study to showcase the generality of our human-in-the-loop approach for helping users identify these new triggers , improving substantially over traditional explainability methods and traditional adversarial attacks . The main contributions of this paper are as follows : ( 1 ) we consider a new thread model of poisoned classifiers where a third party aims to gain control of the poisoned classifiers without access to the original trigger , ( 2 ) we propose a interpretable , human-in-the-loop attack method under this threat model by first visualizing smoothed adversarial examples and then using human inspection to construct effective alternative triggers , ( 3 ) we demonstrate the effectiveness of our approach on constructing alternative backdoor triggers in high-resolution datasets and compare our method to existing work on modelling trigger distributions in poisoned classifiers ( Qiao et al. , 2019 ) , ( 4 ) last , we conduct a user study to assess the generality of the human-in-the-loop procedure and show promising results of our approach in helping users identify poisoned classifiers . 2 RELATED WORK . Backdoor Attacks In backdoor attacks ( Chen et al. , 2017 ; Gu et al. , 2017 ; Li et al. , 2019 ; 2020 ; Weng et al. , 2020 ; Nguyen & Tran , 2020 ) , an adversary injects poisoned data into the training set so that at test time , clean images are misclassified into the target class when the trigger is present . BadNet ( Gu et al. , 2017 ) , Clean-label backdoor attack ( CLBD ) ( Turner et al. , 2019 ) and Hidden trigger backdoor attack ( HTBA ) ( Saha et al. , 2020 ) achieve this by modifying a subset of training data with the backdoor trigger . Many backdoor defenses have been proposed to defend against backdoor attacks ( Tran et al. , 2018 ; Wang et al. , 2019 ; Gao et al. , 2019 ; Guo et al. , 2020 ; Wang et al. , 2020 ; Soremekun et al. , 2020 ) . Our work is most related to defense methods based on trigger reconstruction ( Wang et al. , 2019 ; Guo et al. , 2020 ; Wang et al. , 2020 ; Soremekun et al. , 2020 ) . Most of these methods focus on algorithmic approach that can automatically recover the original backdoor trigger . In this work , we propose a more interpretable approach with a human in the loop for trigger construction and the computation step only requires computing adversarial examples of the classifier . Qiao et al . ( 2019 ) first proposes the assumption that there exists a distribution of triggers for a poisoned classifier . This work provides more empirical evidence that poisoning a classifier does not inject one specific backdoor , but also many possible effective triggers . Adversarial Robustness Aside from backdoor attacks , another major line of work in adversarial machine learning focuses on adversarial robustness ( Szegedy et al. , 2013 ; Goodfellow et al. , 2015 ; Madry et al. , 2017 ; Ilyas et al. , 2019 ) , which studies the existence of imperceptibly perturbed inputs that cause misclassification in state-of-the-art classifiers . The effort to defend against adversarial examples has led to building adversarially robust models ( Madry et al. , 2017 ) . In addition to being robust against adversarial examples , adversarially robust models are shown to have perceptuallyaligned gradients ( Tsipras et al. , 2019 ; Engstrom et al. , 2019 ) : adversarial examples of those classifiers show salient characteristics of other classes . This property of adversarially robust classifiers can be used , for example , to perform image synthesis ( Santurkar et al. , 2019 ) . Randomized Smoothing Our work is also related to a recently proposed robust certification method : randomized smoothing ( Cohen et al. , 2019 ; Salman et al. , 2019 ) . Cohen et al . ( 2019 ) show that smoothing a classifier with Gaussian noise results in a smoothed classifier that is certifiably robust in l2 norm . Kaur et al . ( 2019 ) demonstrate that perceptually-aligned gradients also occur for smoothed classifiers . Although randomized smoothing is shown to be promising in robust certification , it requires the underlying model to be custom trained , for example , with Gaussian data augmentation ( Cohen et al. , 2019 ) or adversarial training ( Salman et al. , 2019 ) . To avoid the tedious customized training , Salman et al . ( 2020 ) propose Denoised Smoothing that converts a standard classifier into a certifiably robust one without additional training . 3 BACKGROUND . Perceptual property of adversarially robust classifiers Adversarially robust models are , by definition , robust to adversarial examples , where such models are usually obtained via adversarial training ( Madry et al. , 2017 ) . Previous work ( Tsipras et al. , 2019 ; Santurkar et al. , 2019 ) analyzed adversarially robust classifiers from a perceptual perspective and found that their loss gradients align well with human perception . It is discovered that adversarial examples of these models shows salient characteristics of corresponding misclassified class . Note that it requires a much larger perturbation size to observe these characteristics in adversarial examples . Randomized Smoothing and Denoised Smoothing Randomized smoothing ( Cohen et al. , 2019 ) is a certification procedure that converts a base classifier f into a smoothed classifier g under Gaussian noise which is certifiably robust in l2 norm ( noise level σ controls the tradeoff between robustness and accuracy ) : g ( x ) = argmax c P ( f ( x+ δ ) = c ) where δ ∼ N ( 0 , σ2I ) ( 1 ) For randomized smoothing to be effective , it usually requires the base classifier f to be trained via Gaussian data augmentation . Denoised Smoothing ( Salman et al. , 2020 ) is able to convert a standard pretrained classifier into a certifiably robust one . It first prepends a pretrained classifier f with a custom-trained denoiser D , then applies randomized smoothing to the joint network f ◦D , resulting in a robust smoothed classifier f smoothed : f smoothed ( x ) = argmax c P ( f ◦D ( x+ δ ) = c ) where δ ∼ N ( 0 , σ2I ) ( 2 ) Note that the goal of adding the denoiser is to convert the noisy input x+ δ into clean image x since the base classifier f is assumed to classify x well . Backdoor poisoning model For backdoor attacks , we use the commonly-used ways to inject backdoor : image patching ( Gu et al. , 2017 ; Turner et al. , 2019 ; Saha et al. , 2020 ) . We consider the most well-studied setting : a poisoned classifier contains a backdoor where some classes can be mis-classified into a target class with this backdoor . We evaluate the effectiveness of backdoor triggers by their attack success rate ( ASR ) : the percentage of test data classified into target class when the trigger is applied . 4 METHODOLOGY . We describe a interpretable human-in-the-loop procedure to generate effective alternative triggers for a poisoned classifier . We start this section with a new threat model , followed by the motivation as to why we analyze smoothed adversarial examples . Then we describe our approach in detail . Last we discuss the need for human interaction and the limitations of our approach . Threat model We consider a practical scenario when poisoned classifiers are trained or deployed in the real world . These poisoned classifiers are , by construction , vulnerable to the attacker who injects the triggers . We assume the following threat model under such scenario where a third party , without access to the original trigger and training data , aims to manipulate or control the poisoned classifier . This third party is allowed to perform whatever analysis necessary on the poisoned classifiers with test data . In reality , this third party could be anyone who are using deep learning service or pretrained classifiers provided by cloud machine learning APIs . 4.1 MOTIVATION FOR GENERATING SMOOTHED ADVERSARIAL EXAMPLES . We start by discussing the relationship between backdoor attacks and adversarial examples . Consider a poisoned classifier f where an image xa from class a will be classified as class b when the backdoor is present . Denote the application of the backdoor to image x as B ( x ) . Then for a poisoned classifier : f ( xa ) = a , f ( B ( xa ) ) = b ( 3 ) In addition to being a poisoned image , B ( xa ) can be viewed as an adversarial example of the poisoned classifier f . Formally , B ( xa ) is an adversarial example with perturbation size = ‖B ( xa ) − xa‖p in lp norm : B ( xa ) ∈ { x | f ( x ) 6= a , ‖x− xa‖p ≤ } ( 4 ) However , this does not necessarily mean that the backdoor will be present in the adversarial examples of the poisoned classifier . This is because poisoned classifiers are themselves typically deep networks trained using traditional SGD , which are susceptible to small perturbations in the input ( Szegedy et al. , 2013 ) , and loss gradients of such standard classifier are often noisy and meaningless to human perception ( Tsipras et al. , 2019 ) . Thus , we propose to robustify poisoned classifiers with Denoised Smoothing ( Salman et al. , 2020 ) . Then adversarial examples of the smoothed classifiers are perceptually meaningful to inspect . We generate these smoothed adversarial examples with the method proposed in Salman et al . ( 2019 ) . Specifically , we use the SMOOTHADVPGD method in Salman et al . ( 2019 ) and sample Monte-Carlo noise vectors to estimate the gradients of the smoothed classifier . Adversarial examples are generated with a l2 norm bound . | This paper demonstrates that backdoor-poisoned machine learning models can also be vulnerable to alternative triggers. Specifically, adversarial samples that are generated against models robustified with Denoised Smoothing often show backdoor patterns. Therefore, these adversarial samples can be used to create new triggers either by (1) choosing a representative colour from a backdoor pattern, or (2) cropping an image that contains a backdoor pattern. Experimental results suggest that alternative triggers can be equally or even more effective than the original trigger. | SP:2bd729b7aa045bf74e31229c9e76e57af36e804b |
Poisoned classifiers are not only backdoored, they are fundamentally broken | 1 INTRODUCTION . Backdoor attacks ( Gu et al. , 2017 ; Chen et al. , 2017 ; Turner et al. , 2019 ; Saha et al. , 2020 ) have emerged as a prominent strategy for poisoning classification models . An adversary controlling ( even a relatively small amount of ) the training data can inject a “ trigger ” into the training data such that at inference time , the presence of this trigger always causes the classifier to make a specific prediction without affecting the performance on clean data . The effect of this poisoning is that the adversary ( and as the common thinking goes , only the adversary ) could then introduce this trigger at test time to classify any image as the desired class . Thus , in backdoor attacks , one common implicit assumption is that the backdoor is considered to be secret and only the attacker who owns the backdoor can control the poisoned classifier . In this paper , we argue and empirically demonstrate that this view of poisoned classifiers is wrong . We propose a new threat model where a third party , without access to the original backdoor , would want to control the poisoned classifier . Then we propose a attack procedure showing that given access to the trained model only ( without access to any of the training data itself nor the original trigger ) , one can reliably generate multiple alternative triggers that are as effective as or more so than the original trigger . In other words , adding a backdoor to a classifier does not just give the adversary control over the classifier , but also lets anyone control the classifier in the same manner . An overview of our attack procedure is depicted in Figure 1 . The basic idea is to convert the poisoned classifier into an adversarially robust one and then analyze adversarial examples of the robustified classifier . The advantage of adversarially robust classifiers is that they have perceptually-aligned gradients ( Tsipras et al. , 2019 ) , where adversarial examples of such models perceptually resemble other classes . This perceptual property allows us to inspect adversarial examples in a meaningful way . To convert a poisoned classifier into a robust one , we use a recently proposed technique Denoised Smoothing ( Salman et al. , 2020 ) , which applies randomized smoothing ( Cohen et al. , 2019 ) to a pretrained classifier prepended with a denoiser . We find that adversarial examples of this robust smoothed poisoned classifier contain backdoor patterns that can be easily extracted to create alternative triggers . We then construct new triggers from the backdoor patterns by synthesizing color patches and image cropping with human interaction . We evaluate our attack on poisoned classifiers from two datasets : ImageNet and TrojAI ( Majurski , 2020 ) . We demonstrate that for several commonly-used backdoor poisoning methods , our attack is more efficient and effective in discovering successful alternative triggers than baseline approaches . Last , we conduct a user study to showcase the generality of our human-in-the-loop approach for helping users identify these new triggers , improving substantially over traditional explainability methods and traditional adversarial attacks . The main contributions of this paper are as follows : ( 1 ) we consider a new thread model of poisoned classifiers where a third party aims to gain control of the poisoned classifiers without access to the original trigger , ( 2 ) we propose a interpretable , human-in-the-loop attack method under this threat model by first visualizing smoothed adversarial examples and then using human inspection to construct effective alternative triggers , ( 3 ) we demonstrate the effectiveness of our approach on constructing alternative backdoor triggers in high-resolution datasets and compare our method to existing work on modelling trigger distributions in poisoned classifiers ( Qiao et al. , 2019 ) , ( 4 ) last , we conduct a user study to assess the generality of the human-in-the-loop procedure and show promising results of our approach in helping users identify poisoned classifiers . 2 RELATED WORK . Backdoor Attacks In backdoor attacks ( Chen et al. , 2017 ; Gu et al. , 2017 ; Li et al. , 2019 ; 2020 ; Weng et al. , 2020 ; Nguyen & Tran , 2020 ) , an adversary injects poisoned data into the training set so that at test time , clean images are misclassified into the target class when the trigger is present . BadNet ( Gu et al. , 2017 ) , Clean-label backdoor attack ( CLBD ) ( Turner et al. , 2019 ) and Hidden trigger backdoor attack ( HTBA ) ( Saha et al. , 2020 ) achieve this by modifying a subset of training data with the backdoor trigger . Many backdoor defenses have been proposed to defend against backdoor attacks ( Tran et al. , 2018 ; Wang et al. , 2019 ; Gao et al. , 2019 ; Guo et al. , 2020 ; Wang et al. , 2020 ; Soremekun et al. , 2020 ) . Our work is most related to defense methods based on trigger reconstruction ( Wang et al. , 2019 ; Guo et al. , 2020 ; Wang et al. , 2020 ; Soremekun et al. , 2020 ) . Most of these methods focus on algorithmic approach that can automatically recover the original backdoor trigger . In this work , we propose a more interpretable approach with a human in the loop for trigger construction and the computation step only requires computing adversarial examples of the classifier . Qiao et al . ( 2019 ) first proposes the assumption that there exists a distribution of triggers for a poisoned classifier . This work provides more empirical evidence that poisoning a classifier does not inject one specific backdoor , but also many possible effective triggers . Adversarial Robustness Aside from backdoor attacks , another major line of work in adversarial machine learning focuses on adversarial robustness ( Szegedy et al. , 2013 ; Goodfellow et al. , 2015 ; Madry et al. , 2017 ; Ilyas et al. , 2019 ) , which studies the existence of imperceptibly perturbed inputs that cause misclassification in state-of-the-art classifiers . The effort to defend against adversarial examples has led to building adversarially robust models ( Madry et al. , 2017 ) . In addition to being robust against adversarial examples , adversarially robust models are shown to have perceptuallyaligned gradients ( Tsipras et al. , 2019 ; Engstrom et al. , 2019 ) : adversarial examples of those classifiers show salient characteristics of other classes . This property of adversarially robust classifiers can be used , for example , to perform image synthesis ( Santurkar et al. , 2019 ) . Randomized Smoothing Our work is also related to a recently proposed robust certification method : randomized smoothing ( Cohen et al. , 2019 ; Salman et al. , 2019 ) . Cohen et al . ( 2019 ) show that smoothing a classifier with Gaussian noise results in a smoothed classifier that is certifiably robust in l2 norm . Kaur et al . ( 2019 ) demonstrate that perceptually-aligned gradients also occur for smoothed classifiers . Although randomized smoothing is shown to be promising in robust certification , it requires the underlying model to be custom trained , for example , with Gaussian data augmentation ( Cohen et al. , 2019 ) or adversarial training ( Salman et al. , 2019 ) . To avoid the tedious customized training , Salman et al . ( 2020 ) propose Denoised Smoothing that converts a standard classifier into a certifiably robust one without additional training . 3 BACKGROUND . Perceptual property of adversarially robust classifiers Adversarially robust models are , by definition , robust to adversarial examples , where such models are usually obtained via adversarial training ( Madry et al. , 2017 ) . Previous work ( Tsipras et al. , 2019 ; Santurkar et al. , 2019 ) analyzed adversarially robust classifiers from a perceptual perspective and found that their loss gradients align well with human perception . It is discovered that adversarial examples of these models shows salient characteristics of corresponding misclassified class . Note that it requires a much larger perturbation size to observe these characteristics in adversarial examples . Randomized Smoothing and Denoised Smoothing Randomized smoothing ( Cohen et al. , 2019 ) is a certification procedure that converts a base classifier f into a smoothed classifier g under Gaussian noise which is certifiably robust in l2 norm ( noise level σ controls the tradeoff between robustness and accuracy ) : g ( x ) = argmax c P ( f ( x+ δ ) = c ) where δ ∼ N ( 0 , σ2I ) ( 1 ) For randomized smoothing to be effective , it usually requires the base classifier f to be trained via Gaussian data augmentation . Denoised Smoothing ( Salman et al. , 2020 ) is able to convert a standard pretrained classifier into a certifiably robust one . It first prepends a pretrained classifier f with a custom-trained denoiser D , then applies randomized smoothing to the joint network f ◦D , resulting in a robust smoothed classifier f smoothed : f smoothed ( x ) = argmax c P ( f ◦D ( x+ δ ) = c ) where δ ∼ N ( 0 , σ2I ) ( 2 ) Note that the goal of adding the denoiser is to convert the noisy input x+ δ into clean image x since the base classifier f is assumed to classify x well . Backdoor poisoning model For backdoor attacks , we use the commonly-used ways to inject backdoor : image patching ( Gu et al. , 2017 ; Turner et al. , 2019 ; Saha et al. , 2020 ) . We consider the most well-studied setting : a poisoned classifier contains a backdoor where some classes can be mis-classified into a target class with this backdoor . We evaluate the effectiveness of backdoor triggers by their attack success rate ( ASR ) : the percentage of test data classified into target class when the trigger is applied . 4 METHODOLOGY . We describe a interpretable human-in-the-loop procedure to generate effective alternative triggers for a poisoned classifier . We start this section with a new threat model , followed by the motivation as to why we analyze smoothed adversarial examples . Then we describe our approach in detail . Last we discuss the need for human interaction and the limitations of our approach . Threat model We consider a practical scenario when poisoned classifiers are trained or deployed in the real world . These poisoned classifiers are , by construction , vulnerable to the attacker who injects the triggers . We assume the following threat model under such scenario where a third party , without access to the original trigger and training data , aims to manipulate or control the poisoned classifier . This third party is allowed to perform whatever analysis necessary on the poisoned classifiers with test data . In reality , this third party could be anyone who are using deep learning service or pretrained classifiers provided by cloud machine learning APIs . 4.1 MOTIVATION FOR GENERATING SMOOTHED ADVERSARIAL EXAMPLES . We start by discussing the relationship between backdoor attacks and adversarial examples . Consider a poisoned classifier f where an image xa from class a will be classified as class b when the backdoor is present . Denote the application of the backdoor to image x as B ( x ) . Then for a poisoned classifier : f ( xa ) = a , f ( B ( xa ) ) = b ( 3 ) In addition to being a poisoned image , B ( xa ) can be viewed as an adversarial example of the poisoned classifier f . Formally , B ( xa ) is an adversarial example with perturbation size = ‖B ( xa ) − xa‖p in lp norm : B ( xa ) ∈ { x | f ( x ) 6= a , ‖x− xa‖p ≤ } ( 4 ) However , this does not necessarily mean that the backdoor will be present in the adversarial examples of the poisoned classifier . This is because poisoned classifiers are themselves typically deep networks trained using traditional SGD , which are susceptible to small perturbations in the input ( Szegedy et al. , 2013 ) , and loss gradients of such standard classifier are often noisy and meaningless to human perception ( Tsipras et al. , 2019 ) . Thus , we propose to robustify poisoned classifiers with Denoised Smoothing ( Salman et al. , 2020 ) . Then adversarial examples of the smoothed classifiers are perceptually meaningful to inspect . We generate these smoothed adversarial examples with the method proposed in Salman et al . ( 2019 ) . Specifically , we use the SMOOTHADVPGD method in Salman et al . ( 2019 ) and sample Monte-Carlo noise vectors to estimate the gradients of the smoothed classifier . Adversarial examples are generated with a l2 norm bound . | This is an interesting study on the analysis of poisoned classifiers and backdoor attacks. The authors showed that with some post-processing analysis on a poisoned classifier, it is possible to construct effective alternative triggers against a backdoor classifier. In particular, after creating several poisoned classifiers, and smoothing them using a Denoised smoothing technique, one can generate adversarial examples. Using these examples, it is possible to extract color or cropped patch as new triggers to break the poisoned classifier. | SP:2bd729b7aa045bf74e31229c9e76e57af36e804b |
Towards Defending Multiple Adversarial Perturbations via Gated Batch Normalization | 1 INTRODUCTION . Deep neural networks ( DNNs ) have achieved remarkable performance across a wide areas of applications ( Krizhevsky et al. , 2012 ; Bahdanau et al. , 2014 ; Hinton et al. , 2012 ) , but they are susceptible to adversarial examples ( Szegedy et al. , 2013 ) . These elaborately designed perturbations are imperceptible to humans but can easily lead DNNs to wrong predictions , threatening both digital and physical deep learning applications ( Kurakin et al. , 2016 ; Liu et al. , 2019a ) . To improve model robustness against adversarial perturbations , a number of adversarial defense methods have been proposed ( Papernot et al. , 2015 ; Engstrom et al. , 2018 ; Goodfellow et al. , 2014 ) . Many of these defense methods are based on adversarial training ( Goodfellow et al. , 2014 ; Madry et al. , 2018 ) , which augment training data with adversarial examples . However , most adversarial defenses are designed to counteract a single type of perturbation ( e.g. , small ` ∞-noise ) ( Madry et al. , 2018 ; Kurakin et al. , 2017 ; Dong et al. , 2018 ) . These defenses offer no guarantees for other perturbations ( e.g. , ` 1 , ` 2 ) , and sometimes even increase model vulnerability ( Kang et al. , 2019 ; Tramèr & Boneh , 2019 ) . To address this problem , other adversarial training strategies have been proposed with the goal of simultaneously achieving robustness against multiple types of attacks , i.e. , ` ∞ , ` 1 , and ` 2 attacks ( Tramèr & Boneh , 2019 ; Maini et al. , 2020 ) . Although these methods improve overall model robustness against adversarial attacks in multiple ` p balls , the performance for each individual perturbation type is still far from satisfactory . In this work , we propose the multi-domain hypothesis , which states that different types of adversarial perturbation arise in different domains , and thus have separable characteristics . Training on data from multiple domains can be regarded as solving the invariant risk minimization problem ( Ahuja et al. , 2020 ) , in which an invariant predictor is learnt to achieve the minimum risk for different environments . For a deep learning model , instance-related knowledge can be stored in the weight matrix 1Our code will be available upon publication . of each layer , whereas domain-related knowledge can be represented by the batch normalization ( BN ) layer statistics ( Li et al. , 2017 ) . Inspired by the multi-domain hypothesis , we propose to improve model robustness against multiple perturbation types by separating domain-specific information for different perturbation types , and using BN layer statistics to better align data from the mixture distribution and learn domain-invariant representations for multiple adversarial examples types . In particular , we propose a novel building block for DNNs , referred to as Gated Batch Normalization ( GBN ) , which consists of a gated subnetwork and a multi-branch BN layer . GBN first learns to separate perturbations from different domains on-the-fly and then normalizes them by obtaining domain-specific features . Specifically , each BN branch handles a single perturbation type ( i.e. , domain ) . Then , features computed from different branches are aligned as domain-invariant representations that are aggregated as the input to subsequent layers . Extensive experiments on MNIST , CIFAR-10 , and Tiny-ImageNet demonstrate that our method outperforms previous defense strategies by large margins , i.e. , 10-20 % . 2 BACKGROUND AND RELATED WORK . In this section , we provide a brief overview of existing work on adversarial attacks and defenses , as well as batch normalization techniques . 2.1 ADVERSARIAL ATTACKS AND DEFENSES . Adversarial examples are inputs intentionally designed to mislead DNNs ( Szegedy et al. , 2013 ; Goodfellow et al. , 2014 ) . Given a DNN fΘ and an input image x ∈ X with the ground truth label y ∈ Y , an adversarial example xadv satisfies fΘ ( xadv ) 6= y s.t . ‖x− xadv‖ ≤ , where ‖ · ‖ is a distance metric . Commonly , ‖ · ‖ is measured by the ` p-norm ( p ∈ { 1,2 , ∞ } ) . Various defense approaches have been proposed to improve model robustness against adversarial examples ( Papernot et al. , 2015 ; Xie et al. , 2018 ; Madry et al. , 2018 ; Liao et al. , 2018 ; Cisse et al. , 2017 ) , among which adversarial training has been widely studied and demonstrated to be the most effective ( Goodfellow et al. , 2014 ; Madry et al. , 2018 ) . Specifically , adversarial training minimizes the worst case loss within some perturbation region for classifiers , by augmenting the training set { x ( i ) , y ( i ) } i=1 ... n with adversarial examples . However , these defenses only improve model robustness for one type of perturbation ( e.g. , ` ∞ ) and typically offer no robustness guarantees against other attacks ( Kang et al. , 2019 ; Tramèr & Boneh , 2019 ; Schott et al. , 2019 ) . To address this problem , recent works have attempted to improve the robustness against several types of perturbation ( Schott et al. , 2019 ; Tramèr & Boneh , 2019 ; Maini et al. , 2020 ) . Schott et al . ( 2019 ) proposed Analysis by Synthesis ( ABS ) , which used multiple variational autoencoders to defend ` 0 , ` 2 , and ` ∞ adversaries . However , ABS only works on the MNIST dataset . Croce & Hein ( 2020a ) proposed a provable adversarial defense against all ` p norms for p ≥1 using a regularization term . However , it is not applicable to the empirical setting , since it only guarantees robustness for very small perturbations ( e.g. , 0.1 and 2/255 for ` 2 and ` ∞ on CIFAR-10 ) . Tramèr & Boneh ( 2019 ) tried to defend against multiple perturbation types ( ` 1 , ` 2 , and ` ∞ ) by combining different types of adversarial examples for adversarial training . Specifically , they introduced two training strategies , “ MAX ” and “ AVG ” , where for each input image , the model is either trained on its strongest adversarial example or all types of perturbations . More recently , Maini et al . ( 2020 ) proposed multi steepest descent ( MSD ) , and showed that a simple modification to standard PGD adversarial training improves robustness to ` 1 , ` 2 , and ` ∞ adversaries . In this work , we follow ( Tramèr & Boneh , 2019 ; Maini et al. , 2020 ) to focus on defense against ` 1 , ` 2 , and ` ∞ adversarial perturbations , which are the most representative and commonly used perturbations . However , we propose a completely different perspective and solution to the problem . 2.2 BATCH NORMALIZATION . BN ( Ioffe & Szegedy , 2015 ) is typically used to stabilize and accelerate DNN training . Let x ∈ Rd denote the input to a neural network layer . During training , BN normalizes each neuron/channel within m mini-batch data by x̂j = BN ( xj ) = γj xj − µj√ σ2j + ξ + βj , j = 1 , 2 , ... , d , ( 1 ) where µj = 1m ∑m i=1 x ( i ) j and σ 2 j = 1 m ∑m i=1 ( x ( i ) j − µj ) 2 are the mini-batch mean and variance for each neuron , respectively , and ξ is a small number to prevent numerical instability . The learnable parameters γ and β are used to recover the representation capacity . During inference , the population statistics of mean µ̂ and variance σ̂2 are used in Eqn . 1 , which are usually calculated as the running average over different training iterations t with update factor α : µ̂t = ( 1− α ) µ̂t−1 + αµt−1 , ( σ̂t ) 2 = ( 1− α ) ( σ̂t−1 ) 2 + α ( σt−1 ) 2 . ( 2 ) A number of normalization techniques have been proposed to improve BN for style-transfer ( Huang & Belongie , 2017 ) and domain adaption ( Li et al. , 2017 ; Chang et al. , 2019 ; Deecke et al. , 2019 ) . Compared to studies for domain adaptation , our GBN does not require input domain knowledge during inference . In contrast to Mode Normalization ( Deecke et al. , 2019 ) , which aims to learn a mixture distribution for multi-task learning , GBN separates domain-specific statistics for different input types and then aligns the data to build domain-invariant representations . Recently , Xie & Yuille ( 2020 ) ; Xie et al . ( 2020 ) applied separate BNs to clean and adversarial examples for statistics estimation . In contrast to the above two studies that improve image recognition or analyze the properties of BN to adversarial training , we aim to defend against multiple adversarial perturbations . Furthermore , GBN can predict the domain for an input sample and then jointly incorporate the outputs of multiple BN branches to provide the final classification result . Conversely , Xie & Yuille ( 2020 ) ; Xie et al . ( 2020 ) manually selected the BN branch for each input image , which requires prior knowledge of whether the input is an adversarial or clean example ( the same as domain adaptation ) . 3 GATED BATCH NORMALIZATION . In this section , we present our proposed Gated Batch Normalization ( GBN ) approach , to improve the model robustness against multiple adversarial perturbations . We first illustrate our multi-domain hypothesis , which states that adversarial examples of different perturbation types are drawn from different domains . Motivated by this hypothesis , we demonstrate the architecture of our GBN block , then describe the training and inference procedures . 3.1 MOTIVATION : MULTI-DOMAIN HYPOTHESIS . We assumeN adversarial perturbation types2 , each characterized by a set Sk of perturbations for an input x . Let D0 denote the set of clean examples , and Dk ( k = 1 , ... , N ) denote the set of adversarial examples generated by the k-th adversarial perturbation type Sk . An adversarial example of the k-th type xkadv is generated by the pixel-wise addition of the perturbation δ k , i.e. , xkadv = x + δ k. Our multi-domain hypothesis states that different types of perturbations Dk ( for all k ≥ 0 , including the clean examples ) are drawn from different domains , inspired by the following observations : ( 1 ) Training on a single perturbation type is insufficient for achieving the robustness against other perturbations . Further , training on a mixture of different perturbation types still fail to achieve acceptable performance for each type of perturbation ( Tramèr & Boneh , 2019 ; Maini et al. , 2020 ) . ( 2 ) Adversarial examples are separable from clean examples ( Metzen et al. , 2018 ) . Xie & Yuille ( 2020 ) also suggested that clean and adversarial examples are drawn from two different domains . We first empirically investigate the hypothesis for deep neural networks . Specifically , we train separate BNs for different input domains Dk ( k ≥ 0 ) . As illustrated in Figure 1 ( b ) , we construct separate mini-batches to estimate BN statistics for different Dk , i.e. , ` 1 , ` 2 , and ` ∞ adversarial images , as well as for clean images . We defer the implementation details to Appendix A . Figure 1 ( c ) and 1 ( d ) show that different Dk induce significantly different running statistics , according to the running means and variances of different BN branches . 2In this work , we consider N = 3 adversarial perturbation types : ` 1 , ` 2 and ` ∞ . We further theoretically demonstrate that for a linear classifier f ( x ) = sign ( wTx + b ) , different types of adversarial perturbations belong to different domains , with pair-wise Wasserstein distances greater than 0 ( c.f . Appendix B ) . These theoretical and empirical results support our multi-domain hypothesis , and motivate our design of GBN , as discussed below . | This paper introduces an algorithm for defending against multiple adversarial attacks (L1, L2, L-inf) by learning separate batch-norm statistics for each attack type. At inference time, the batch-normalized outputs corresponding to the different attack types are averaged according to the probability of attack types as given by a separate prediction network (one per batch-norm layer). The algorithm is evaluated on a range of datasets (MNIST, CIFAR-10, Tiny-ImageNet) and is shown to outperform recent competing approaches on a range of adversarial attacks. | SP:ae5069e4b8fe352a287a7487aff8cf012cbd035d |
Towards Defending Multiple Adversarial Perturbations via Gated Batch Normalization | 1 INTRODUCTION . Deep neural networks ( DNNs ) have achieved remarkable performance across a wide areas of applications ( Krizhevsky et al. , 2012 ; Bahdanau et al. , 2014 ; Hinton et al. , 2012 ) , but they are susceptible to adversarial examples ( Szegedy et al. , 2013 ) . These elaborately designed perturbations are imperceptible to humans but can easily lead DNNs to wrong predictions , threatening both digital and physical deep learning applications ( Kurakin et al. , 2016 ; Liu et al. , 2019a ) . To improve model robustness against adversarial perturbations , a number of adversarial defense methods have been proposed ( Papernot et al. , 2015 ; Engstrom et al. , 2018 ; Goodfellow et al. , 2014 ) . Many of these defense methods are based on adversarial training ( Goodfellow et al. , 2014 ; Madry et al. , 2018 ) , which augment training data with adversarial examples . However , most adversarial defenses are designed to counteract a single type of perturbation ( e.g. , small ` ∞-noise ) ( Madry et al. , 2018 ; Kurakin et al. , 2017 ; Dong et al. , 2018 ) . These defenses offer no guarantees for other perturbations ( e.g. , ` 1 , ` 2 ) , and sometimes even increase model vulnerability ( Kang et al. , 2019 ; Tramèr & Boneh , 2019 ) . To address this problem , other adversarial training strategies have been proposed with the goal of simultaneously achieving robustness against multiple types of attacks , i.e. , ` ∞ , ` 1 , and ` 2 attacks ( Tramèr & Boneh , 2019 ; Maini et al. , 2020 ) . Although these methods improve overall model robustness against adversarial attacks in multiple ` p balls , the performance for each individual perturbation type is still far from satisfactory . In this work , we propose the multi-domain hypothesis , which states that different types of adversarial perturbation arise in different domains , and thus have separable characteristics . Training on data from multiple domains can be regarded as solving the invariant risk minimization problem ( Ahuja et al. , 2020 ) , in which an invariant predictor is learnt to achieve the minimum risk for different environments . For a deep learning model , instance-related knowledge can be stored in the weight matrix 1Our code will be available upon publication . of each layer , whereas domain-related knowledge can be represented by the batch normalization ( BN ) layer statistics ( Li et al. , 2017 ) . Inspired by the multi-domain hypothesis , we propose to improve model robustness against multiple perturbation types by separating domain-specific information for different perturbation types , and using BN layer statistics to better align data from the mixture distribution and learn domain-invariant representations for multiple adversarial examples types . In particular , we propose a novel building block for DNNs , referred to as Gated Batch Normalization ( GBN ) , which consists of a gated subnetwork and a multi-branch BN layer . GBN first learns to separate perturbations from different domains on-the-fly and then normalizes them by obtaining domain-specific features . Specifically , each BN branch handles a single perturbation type ( i.e. , domain ) . Then , features computed from different branches are aligned as domain-invariant representations that are aggregated as the input to subsequent layers . Extensive experiments on MNIST , CIFAR-10 , and Tiny-ImageNet demonstrate that our method outperforms previous defense strategies by large margins , i.e. , 10-20 % . 2 BACKGROUND AND RELATED WORK . In this section , we provide a brief overview of existing work on adversarial attacks and defenses , as well as batch normalization techniques . 2.1 ADVERSARIAL ATTACKS AND DEFENSES . Adversarial examples are inputs intentionally designed to mislead DNNs ( Szegedy et al. , 2013 ; Goodfellow et al. , 2014 ) . Given a DNN fΘ and an input image x ∈ X with the ground truth label y ∈ Y , an adversarial example xadv satisfies fΘ ( xadv ) 6= y s.t . ‖x− xadv‖ ≤ , where ‖ · ‖ is a distance metric . Commonly , ‖ · ‖ is measured by the ` p-norm ( p ∈ { 1,2 , ∞ } ) . Various defense approaches have been proposed to improve model robustness against adversarial examples ( Papernot et al. , 2015 ; Xie et al. , 2018 ; Madry et al. , 2018 ; Liao et al. , 2018 ; Cisse et al. , 2017 ) , among which adversarial training has been widely studied and demonstrated to be the most effective ( Goodfellow et al. , 2014 ; Madry et al. , 2018 ) . Specifically , adversarial training minimizes the worst case loss within some perturbation region for classifiers , by augmenting the training set { x ( i ) , y ( i ) } i=1 ... n with adversarial examples . However , these defenses only improve model robustness for one type of perturbation ( e.g. , ` ∞ ) and typically offer no robustness guarantees against other attacks ( Kang et al. , 2019 ; Tramèr & Boneh , 2019 ; Schott et al. , 2019 ) . To address this problem , recent works have attempted to improve the robustness against several types of perturbation ( Schott et al. , 2019 ; Tramèr & Boneh , 2019 ; Maini et al. , 2020 ) . Schott et al . ( 2019 ) proposed Analysis by Synthesis ( ABS ) , which used multiple variational autoencoders to defend ` 0 , ` 2 , and ` ∞ adversaries . However , ABS only works on the MNIST dataset . Croce & Hein ( 2020a ) proposed a provable adversarial defense against all ` p norms for p ≥1 using a regularization term . However , it is not applicable to the empirical setting , since it only guarantees robustness for very small perturbations ( e.g. , 0.1 and 2/255 for ` 2 and ` ∞ on CIFAR-10 ) . Tramèr & Boneh ( 2019 ) tried to defend against multiple perturbation types ( ` 1 , ` 2 , and ` ∞ ) by combining different types of adversarial examples for adversarial training . Specifically , they introduced two training strategies , “ MAX ” and “ AVG ” , where for each input image , the model is either trained on its strongest adversarial example or all types of perturbations . More recently , Maini et al . ( 2020 ) proposed multi steepest descent ( MSD ) , and showed that a simple modification to standard PGD adversarial training improves robustness to ` 1 , ` 2 , and ` ∞ adversaries . In this work , we follow ( Tramèr & Boneh , 2019 ; Maini et al. , 2020 ) to focus on defense against ` 1 , ` 2 , and ` ∞ adversarial perturbations , which are the most representative and commonly used perturbations . However , we propose a completely different perspective and solution to the problem . 2.2 BATCH NORMALIZATION . BN ( Ioffe & Szegedy , 2015 ) is typically used to stabilize and accelerate DNN training . Let x ∈ Rd denote the input to a neural network layer . During training , BN normalizes each neuron/channel within m mini-batch data by x̂j = BN ( xj ) = γj xj − µj√ σ2j + ξ + βj , j = 1 , 2 , ... , d , ( 1 ) where µj = 1m ∑m i=1 x ( i ) j and σ 2 j = 1 m ∑m i=1 ( x ( i ) j − µj ) 2 are the mini-batch mean and variance for each neuron , respectively , and ξ is a small number to prevent numerical instability . The learnable parameters γ and β are used to recover the representation capacity . During inference , the population statistics of mean µ̂ and variance σ̂2 are used in Eqn . 1 , which are usually calculated as the running average over different training iterations t with update factor α : µ̂t = ( 1− α ) µ̂t−1 + αµt−1 , ( σ̂t ) 2 = ( 1− α ) ( σ̂t−1 ) 2 + α ( σt−1 ) 2 . ( 2 ) A number of normalization techniques have been proposed to improve BN for style-transfer ( Huang & Belongie , 2017 ) and domain adaption ( Li et al. , 2017 ; Chang et al. , 2019 ; Deecke et al. , 2019 ) . Compared to studies for domain adaptation , our GBN does not require input domain knowledge during inference . In contrast to Mode Normalization ( Deecke et al. , 2019 ) , which aims to learn a mixture distribution for multi-task learning , GBN separates domain-specific statistics for different input types and then aligns the data to build domain-invariant representations . Recently , Xie & Yuille ( 2020 ) ; Xie et al . ( 2020 ) applied separate BNs to clean and adversarial examples for statistics estimation . In contrast to the above two studies that improve image recognition or analyze the properties of BN to adversarial training , we aim to defend against multiple adversarial perturbations . Furthermore , GBN can predict the domain for an input sample and then jointly incorporate the outputs of multiple BN branches to provide the final classification result . Conversely , Xie & Yuille ( 2020 ) ; Xie et al . ( 2020 ) manually selected the BN branch for each input image , which requires prior knowledge of whether the input is an adversarial or clean example ( the same as domain adaptation ) . 3 GATED BATCH NORMALIZATION . In this section , we present our proposed Gated Batch Normalization ( GBN ) approach , to improve the model robustness against multiple adversarial perturbations . We first illustrate our multi-domain hypothesis , which states that adversarial examples of different perturbation types are drawn from different domains . Motivated by this hypothesis , we demonstrate the architecture of our GBN block , then describe the training and inference procedures . 3.1 MOTIVATION : MULTI-DOMAIN HYPOTHESIS . We assumeN adversarial perturbation types2 , each characterized by a set Sk of perturbations for an input x . Let D0 denote the set of clean examples , and Dk ( k = 1 , ... , N ) denote the set of adversarial examples generated by the k-th adversarial perturbation type Sk . An adversarial example of the k-th type xkadv is generated by the pixel-wise addition of the perturbation δ k , i.e. , xkadv = x + δ k. Our multi-domain hypothesis states that different types of perturbations Dk ( for all k ≥ 0 , including the clean examples ) are drawn from different domains , inspired by the following observations : ( 1 ) Training on a single perturbation type is insufficient for achieving the robustness against other perturbations . Further , training on a mixture of different perturbation types still fail to achieve acceptable performance for each type of perturbation ( Tramèr & Boneh , 2019 ; Maini et al. , 2020 ) . ( 2 ) Adversarial examples are separable from clean examples ( Metzen et al. , 2018 ) . Xie & Yuille ( 2020 ) also suggested that clean and adversarial examples are drawn from two different domains . We first empirically investigate the hypothesis for deep neural networks . Specifically , we train separate BNs for different input domains Dk ( k ≥ 0 ) . As illustrated in Figure 1 ( b ) , we construct separate mini-batches to estimate BN statistics for different Dk , i.e. , ` 1 , ` 2 , and ` ∞ adversarial images , as well as for clean images . We defer the implementation details to Appendix A . Figure 1 ( c ) and 1 ( d ) show that different Dk induce significantly different running statistics , according to the running means and variances of different BN branches . 2In this work , we consider N = 3 adversarial perturbation types : ` 1 , ` 2 and ` ∞ . We further theoretically demonstrate that for a linear classifier f ( x ) = sign ( wTx + b ) , different types of adversarial perturbations belong to different domains , with pair-wise Wasserstein distances greater than 0 ( c.f . Appendix B ) . These theoretical and empirical results support our multi-domain hypothesis , and motivate our design of GBN , as discussed below . | The authors propose to improve the robustness against adversarial attacks in deep networks via the use of a customized normalization strategy. Their central methodological suggestion is called gated batch normalization (GBN), and involves a (soft, but some other variants are briefly explored as well) gating mechanism that maps to distinct normalization branches. Their idea is evaluated on a set of benchmarks and robustness is measured threefold: in terms of $L_1$, $L_2$ and $L_\infty$ perturbations. | SP:ae5069e4b8fe352a287a7487aff8cf012cbd035d |
Towards Defending Multiple Adversarial Perturbations via Gated Batch Normalization | 1 INTRODUCTION . Deep neural networks ( DNNs ) have achieved remarkable performance across a wide areas of applications ( Krizhevsky et al. , 2012 ; Bahdanau et al. , 2014 ; Hinton et al. , 2012 ) , but they are susceptible to adversarial examples ( Szegedy et al. , 2013 ) . These elaborately designed perturbations are imperceptible to humans but can easily lead DNNs to wrong predictions , threatening both digital and physical deep learning applications ( Kurakin et al. , 2016 ; Liu et al. , 2019a ) . To improve model robustness against adversarial perturbations , a number of adversarial defense methods have been proposed ( Papernot et al. , 2015 ; Engstrom et al. , 2018 ; Goodfellow et al. , 2014 ) . Many of these defense methods are based on adversarial training ( Goodfellow et al. , 2014 ; Madry et al. , 2018 ) , which augment training data with adversarial examples . However , most adversarial defenses are designed to counteract a single type of perturbation ( e.g. , small ` ∞-noise ) ( Madry et al. , 2018 ; Kurakin et al. , 2017 ; Dong et al. , 2018 ) . These defenses offer no guarantees for other perturbations ( e.g. , ` 1 , ` 2 ) , and sometimes even increase model vulnerability ( Kang et al. , 2019 ; Tramèr & Boneh , 2019 ) . To address this problem , other adversarial training strategies have been proposed with the goal of simultaneously achieving robustness against multiple types of attacks , i.e. , ` ∞ , ` 1 , and ` 2 attacks ( Tramèr & Boneh , 2019 ; Maini et al. , 2020 ) . Although these methods improve overall model robustness against adversarial attacks in multiple ` p balls , the performance for each individual perturbation type is still far from satisfactory . In this work , we propose the multi-domain hypothesis , which states that different types of adversarial perturbation arise in different domains , and thus have separable characteristics . Training on data from multiple domains can be regarded as solving the invariant risk minimization problem ( Ahuja et al. , 2020 ) , in which an invariant predictor is learnt to achieve the minimum risk for different environments . For a deep learning model , instance-related knowledge can be stored in the weight matrix 1Our code will be available upon publication . of each layer , whereas domain-related knowledge can be represented by the batch normalization ( BN ) layer statistics ( Li et al. , 2017 ) . Inspired by the multi-domain hypothesis , we propose to improve model robustness against multiple perturbation types by separating domain-specific information for different perturbation types , and using BN layer statistics to better align data from the mixture distribution and learn domain-invariant representations for multiple adversarial examples types . In particular , we propose a novel building block for DNNs , referred to as Gated Batch Normalization ( GBN ) , which consists of a gated subnetwork and a multi-branch BN layer . GBN first learns to separate perturbations from different domains on-the-fly and then normalizes them by obtaining domain-specific features . Specifically , each BN branch handles a single perturbation type ( i.e. , domain ) . Then , features computed from different branches are aligned as domain-invariant representations that are aggregated as the input to subsequent layers . Extensive experiments on MNIST , CIFAR-10 , and Tiny-ImageNet demonstrate that our method outperforms previous defense strategies by large margins , i.e. , 10-20 % . 2 BACKGROUND AND RELATED WORK . In this section , we provide a brief overview of existing work on adversarial attacks and defenses , as well as batch normalization techniques . 2.1 ADVERSARIAL ATTACKS AND DEFENSES . Adversarial examples are inputs intentionally designed to mislead DNNs ( Szegedy et al. , 2013 ; Goodfellow et al. , 2014 ) . Given a DNN fΘ and an input image x ∈ X with the ground truth label y ∈ Y , an adversarial example xadv satisfies fΘ ( xadv ) 6= y s.t . ‖x− xadv‖ ≤ , where ‖ · ‖ is a distance metric . Commonly , ‖ · ‖ is measured by the ` p-norm ( p ∈ { 1,2 , ∞ } ) . Various defense approaches have been proposed to improve model robustness against adversarial examples ( Papernot et al. , 2015 ; Xie et al. , 2018 ; Madry et al. , 2018 ; Liao et al. , 2018 ; Cisse et al. , 2017 ) , among which adversarial training has been widely studied and demonstrated to be the most effective ( Goodfellow et al. , 2014 ; Madry et al. , 2018 ) . Specifically , adversarial training minimizes the worst case loss within some perturbation region for classifiers , by augmenting the training set { x ( i ) , y ( i ) } i=1 ... n with adversarial examples . However , these defenses only improve model robustness for one type of perturbation ( e.g. , ` ∞ ) and typically offer no robustness guarantees against other attacks ( Kang et al. , 2019 ; Tramèr & Boneh , 2019 ; Schott et al. , 2019 ) . To address this problem , recent works have attempted to improve the robustness against several types of perturbation ( Schott et al. , 2019 ; Tramèr & Boneh , 2019 ; Maini et al. , 2020 ) . Schott et al . ( 2019 ) proposed Analysis by Synthesis ( ABS ) , which used multiple variational autoencoders to defend ` 0 , ` 2 , and ` ∞ adversaries . However , ABS only works on the MNIST dataset . Croce & Hein ( 2020a ) proposed a provable adversarial defense against all ` p norms for p ≥1 using a regularization term . However , it is not applicable to the empirical setting , since it only guarantees robustness for very small perturbations ( e.g. , 0.1 and 2/255 for ` 2 and ` ∞ on CIFAR-10 ) . Tramèr & Boneh ( 2019 ) tried to defend against multiple perturbation types ( ` 1 , ` 2 , and ` ∞ ) by combining different types of adversarial examples for adversarial training . Specifically , they introduced two training strategies , “ MAX ” and “ AVG ” , where for each input image , the model is either trained on its strongest adversarial example or all types of perturbations . More recently , Maini et al . ( 2020 ) proposed multi steepest descent ( MSD ) , and showed that a simple modification to standard PGD adversarial training improves robustness to ` 1 , ` 2 , and ` ∞ adversaries . In this work , we follow ( Tramèr & Boneh , 2019 ; Maini et al. , 2020 ) to focus on defense against ` 1 , ` 2 , and ` ∞ adversarial perturbations , which are the most representative and commonly used perturbations . However , we propose a completely different perspective and solution to the problem . 2.2 BATCH NORMALIZATION . BN ( Ioffe & Szegedy , 2015 ) is typically used to stabilize and accelerate DNN training . Let x ∈ Rd denote the input to a neural network layer . During training , BN normalizes each neuron/channel within m mini-batch data by x̂j = BN ( xj ) = γj xj − µj√ σ2j + ξ + βj , j = 1 , 2 , ... , d , ( 1 ) where µj = 1m ∑m i=1 x ( i ) j and σ 2 j = 1 m ∑m i=1 ( x ( i ) j − µj ) 2 are the mini-batch mean and variance for each neuron , respectively , and ξ is a small number to prevent numerical instability . The learnable parameters γ and β are used to recover the representation capacity . During inference , the population statistics of mean µ̂ and variance σ̂2 are used in Eqn . 1 , which are usually calculated as the running average over different training iterations t with update factor α : µ̂t = ( 1− α ) µ̂t−1 + αµt−1 , ( σ̂t ) 2 = ( 1− α ) ( σ̂t−1 ) 2 + α ( σt−1 ) 2 . ( 2 ) A number of normalization techniques have been proposed to improve BN for style-transfer ( Huang & Belongie , 2017 ) and domain adaption ( Li et al. , 2017 ; Chang et al. , 2019 ; Deecke et al. , 2019 ) . Compared to studies for domain adaptation , our GBN does not require input domain knowledge during inference . In contrast to Mode Normalization ( Deecke et al. , 2019 ) , which aims to learn a mixture distribution for multi-task learning , GBN separates domain-specific statistics for different input types and then aligns the data to build domain-invariant representations . Recently , Xie & Yuille ( 2020 ) ; Xie et al . ( 2020 ) applied separate BNs to clean and adversarial examples for statistics estimation . In contrast to the above two studies that improve image recognition or analyze the properties of BN to adversarial training , we aim to defend against multiple adversarial perturbations . Furthermore , GBN can predict the domain for an input sample and then jointly incorporate the outputs of multiple BN branches to provide the final classification result . Conversely , Xie & Yuille ( 2020 ) ; Xie et al . ( 2020 ) manually selected the BN branch for each input image , which requires prior knowledge of whether the input is an adversarial or clean example ( the same as domain adaptation ) . 3 GATED BATCH NORMALIZATION . In this section , we present our proposed Gated Batch Normalization ( GBN ) approach , to improve the model robustness against multiple adversarial perturbations . We first illustrate our multi-domain hypothesis , which states that adversarial examples of different perturbation types are drawn from different domains . Motivated by this hypothesis , we demonstrate the architecture of our GBN block , then describe the training and inference procedures . 3.1 MOTIVATION : MULTI-DOMAIN HYPOTHESIS . We assumeN adversarial perturbation types2 , each characterized by a set Sk of perturbations for an input x . Let D0 denote the set of clean examples , and Dk ( k = 1 , ... , N ) denote the set of adversarial examples generated by the k-th adversarial perturbation type Sk . An adversarial example of the k-th type xkadv is generated by the pixel-wise addition of the perturbation δ k , i.e. , xkadv = x + δ k. Our multi-domain hypothesis states that different types of perturbations Dk ( for all k ≥ 0 , including the clean examples ) are drawn from different domains , inspired by the following observations : ( 1 ) Training on a single perturbation type is insufficient for achieving the robustness against other perturbations . Further , training on a mixture of different perturbation types still fail to achieve acceptable performance for each type of perturbation ( Tramèr & Boneh , 2019 ; Maini et al. , 2020 ) . ( 2 ) Adversarial examples are separable from clean examples ( Metzen et al. , 2018 ) . Xie & Yuille ( 2020 ) also suggested that clean and adversarial examples are drawn from two different domains . We first empirically investigate the hypothesis for deep neural networks . Specifically , we train separate BNs for different input domains Dk ( k ≥ 0 ) . As illustrated in Figure 1 ( b ) , we construct separate mini-batches to estimate BN statistics for different Dk , i.e. , ` 1 , ` 2 , and ` ∞ adversarial images , as well as for clean images . We defer the implementation details to Appendix A . Figure 1 ( c ) and 1 ( d ) show that different Dk induce significantly different running statistics , according to the running means and variances of different BN branches . 2In this work , we consider N = 3 adversarial perturbation types : ` 1 , ` 2 and ` ∞ . We further theoretically demonstrate that for a linear classifier f ( x ) = sign ( wTx + b ) , different types of adversarial perturbations belong to different domains , with pair-wise Wasserstein distances greater than 0 ( c.f . Appendix B ) . These theoretical and empirical results support our multi-domain hypothesis , and motivate our design of GBN , as discussed below . | Existing defenses are usually robust against certain types of attacks. This paper proposes to build a defense against different types of norm-bounded attacks via gated batch normalization. This work treats different types of adversarial attacks as data from different domains and proposes to use gated batch normalization to improve the robustness across different domains. The idea is interesting. The result shows the effectiveness of the defense. | SP:ae5069e4b8fe352a287a7487aff8cf012cbd035d |
RetCL: A Selection-based Approach for Retrosynthesis via Contrastive Learning | Retrosynthesis , of which the goal is to find a set of reactants for synthesizing a target product , is an emerging research area of deep learning . While the existing approaches have shown promising results , they currently lack the ability to consider availability ( e.g. , stability or purchasability ) of the reactants or generalize to unseen reaction templates ( i.e. , chemical reaction rules ) . In this paper , we propose a new approach that mitigates the issues by reformulating retrosynthesis into a selection problem of reactants from a candidate set of commercially available molecules . To this end , we design an efficient reactant selection framework , named RETCL ( retrosynthesis via contrastive learning ) , for enumerating all of the candidate molecules based on selection scores computed by graph neural networks . For learning the score functions , we also propose a novel contrastive training scheme with hard negative mining . Extensive experiments demonstrate the benefits of the proposed selection-based approach . For example , when all 671k reactants in the USPTO database are given as candidates , our RETCL achieves top-1 exact match accuracy of 71.3 % for the USPTO-50k benchmark , while a recent transformer-based approach achieves 59.6 % . We also demonstrate that RETCL generalizes well to unseen templates in various settings in contrast to template-based approaches . The code will be released . 1 INTRODUCTION . Retrosynthesis ( Corey , 1991 ) , finding a synthetic route starting from commercially available reactants to synthesize a target product ( see Figure 1a ) , is at the center of focus for discovering new materials in both academia and industry . It plays an essential role in practical applications by finding a new synthetic path , which can be more cost-effective or avoid patent infringement . However , retrosynthesis is a challenging task that requires searching over a vast number of molecules and chemical reactions , which is intractable to enumerate . Nevertheless , due to its utter importance , researchers have developed computer-aided frameworks to automate the process of retrosynthesis for more than three decades ( Corey et al. , 1985 ) . The computer-aided approaches for retrosynthesis mainly fall into two categories depending on their reliance on the reaction templates , i.e. , sub-graph patterns describing how the chemical reaction occurs among reactants ( see Figure 1b ) . The template-based approaches ( Coley et al. , 2017b ; Segler & Waller , 2017 ; Dai et al. , 2019 ) first enumerate known reaction templates and then apply a wellmatched template into the target product to obtain reactants . Although they can provide chemically interpretable predictions , they limit the search space to known templates and can not discover novel synthetic routes . In contrast , template-free approaches ( Liu et al. , 2017 ; Karpov et al. , 2019 ; Zheng et al. , 2019 ; Shi et al. , 2020 ) generate the reactants from scratch to avoid relying on the reaction templates . However , they require to search the entire molecular space , and their predictions could be either unstable or commercially unavailable . We emphasize that retrosynthesis methods are often required to consider the availability of reactants and generalize to unseen templates in real-world scenarios . For example , when a predicted reactant is not available ( e.g. , not purchasable ) for a chemist or a laboratory , the synthetic path starting from the predicted reactant can not be instantly used in practice . Moreover , chemists often require retrosynthetic analysis based on unknown reaction rules . This is especially significant due to our incomplete knowledge of chemical reactions ; e.g. , 29 million reactions were regularly recorded between 2009 and 2019 in Reaxys1 ( Mutton & Ridley , 2019 ) . Contribution . In this paper , we propose a new selection-based approach , which allows considering the commercial availability of reactants . To this end , we reformulate the task of retrosynthesis as a problem where reactants are selected from a candidate set of available molecules . This approach has two benefits over the existing ones : ( a ) it guarantees the commercial availability of the selected reactants , which allows chemists proceeding to practical procedures such as lab-scale experiments or optimization of reaction conditions ; ( b ) it can generalize to unseen reaction templates and find novel synthetic routes . For the selection-based retrosynthesis , we propose an efficient selection framework , named RETCL ( retrosynthesis via contrastive learning ) . To this end , we design two effective selection scores in synthetic and retrosynthetic manners . To be specific , we use the cosine similarity between molecular embeddings of the product and the reactants computed by graph neural networks . For training the score functions , we also propose a novel contrastive learning scheme ( Sohn , 2016 ; He et al. , 2019 ; Chen et al. , 2020b ) with hard negative mining ( Harwood et al. , 2017 ) to overcome a scalability issue while handling a large-scale candidate set . To demonstrate the effectiveness of our RETCL , we conduct various experiments based on the USPTO database ( Lowe , 2012 ) containing 1.8M chemical reactions in the US patent literature . Thanks to our prior knowledge on the candidate reactants , our method achieves 71.3 % test accuracy and significantly outperforms the baselines without such prior knowledge . Furthermore , our algorithm demonstrates its superiority even when enhancing the baselines with candidate reactants , e.g. , our algorithm improves upon the existing template-free approach ( Chen et al. , 2019 ) by 11.7 % . We also evaluate the generalization ability of RETCL by testing USPTO-50k-trained models on the USPTOfull dataset ; we obtain 39.9 % test accuracy while the state-of-the-art template-based approach ( Dai et al. , 2019 ) achieves 26.7 % . Finally , we demonstrate how our RETCL can improve multi-step retrosynthetic analysis where intermediate reactants are not in our candidate set . We believe our scheme has the potential to improve further in the future , by utilizing ( a ) additional chemical knowledge such as atom-mapping or leaving groups ( Shi et al. , 2020 ; Somnath et al. , 2020 ) ; ( b ) various constrastive learning techniques in other domains , e.g. , computer vision ( He et al. , 2019 ; Chen et al. , 2020b ; Hénaff et al. , 2019 ; Tian et al. , 2019 ) , audio processing ( Oord et al. , 2018 ) , and reinforcement learning ( Srinivas et al. , 2020 ) . 2 SELECTION-BASED RETROSYNTHESIS VIA CONTRASTIVE LEARNING . 2.1 OVERVIEW OF RETCL . In this section , we propose a selection framework for retrosynthesis via contrastive learning , coined RETCL . Our framework is based on solving the retrosynthesis task as a selection problem over a candidate set of commercially available reactants given the target product . Especially , we design a selection procedure based on molecular embeddings computed by graph neural networks and train the networks via contrastive learning . To this end , we define a chemical reactionR → P as a synthetic process of converting a reactant-set R = { R1 , . . . , Rn } , i.e. , a set of reactant molecules , to a product molecule P ( see Figure 1a ) . We 1A chemical database , https : //www.reaxys.com aim to solve the problem of retrosynthesis by finding the reactant-setR from a candidate set C which can be synthesized to the target product P . Especially , we consider the case when the candidate set C consists of commercially available molecules . Throughout this paper , we say that the synthetic direction ( fromR to P ) is forward and the retrosynthetic direction ( from P toR ) is backward . Note that our framework stands out from the existing works in terms of the candidate set C. To be specific , ( a ) template-free approaches ( Lin et al. , 2019 ; Karpov et al. , 2019 ; Shi et al. , 2020 ) choose C as the whole space of ( possibly unavailable ) molecules ; and ( b ) template-based approaches ( Coley et al. , 2017b ; Segler & Waller , 2017 ; Dai et al. , 2019 ) choose C as possible reactants extracted from the known reaction templates . In comparison , our framework neither requires ( a ) search over the entire space of molecules , or ( b ) domain knowledge to extract the reaction templates . We now briefly outline the RETCL framework . Our framework first searches the most likely reactantsetsR1 , . . . , RT ⊂ C in a sequential manner based on a backward selection score ψ ( R|P , Rgiven ) , and then ranks the reactant-sets using ψ ( R|P , Rgiven ) and another forward score φ ( P |R ) . For learning the score functions , we propose a novel contrastive learning scheme with hard negative mining for improving the selection qualities . We next provide detailed descriptions of the search procedure and the training scheme in Section 2.2 and 2.3 , respectively . 2.2 SEARCH PROCEDURE WITH GRAPH NEURAL NETWORKS . We first introduce the search procedure of RETCL in detail . To find a reactant-setR = { R1 , . . . , Rn } , we select each elementRi sequentially from the candidate set C based on the backward ( retrosynthetic ) selection score ψ ( R|P , Rgiven ) . It represents a selection score of a reactant R given a target product P and a set of previously selected reactantsRgiven ⊂ C. Note that the score function is also capable of selecting a special reactant Rhalt to stop updating the reactant-set . Using beam search , we choose top T likely reactant-setsR1 , . . . , RT . Furthermore , we rank the chosen reactant-setsR1 , . . . , RT based on the backward selection score ψ ( R|P , Rgiven ) and the forward ( synthetic ) score φ ( P |R ) . The latter represents the synthesizability ofR for P . Note that ψ ( R|P , Rgiven ) and φ ( P |R ) correspond to backward and forward directions of a chemical reaction R → P , respectively ( see Section 2.1 and Figure 1a ) . Using both score functions , we define an overall score on a chemical reactionR → P as follows : score ( P , R ) = 1 n+ 2 ( max π∈Π n+1∑ i=1 ψ ( Rπ ( i ) |P , { Rπ ( 1 ) , . . . , Rπ ( i−1 ) } ) + φ ( P |R ) ) , ( 1 ) whereRn+1 = Rhalt and Π is the space of permutations defined on the integers 1 , . . . , n+1 satisfying π ( n+1 ) = n+1 . Based on score ( P , R ) , we decide the rankings of R1 , . . . , RT for synthesizing the target product P . We note that the maxπ∈Π operator and the 1n+2 term make the overall score ( equation 1 ) be independent of order and number of reactants , respectively . Figure 2 illustrates this search procedure of our framework . Score design . We next elaborate our design choices for the score functions ψ and φ . We first observe that the molecular graph of the product P can be decomposed into subgraphs from each reactant of the reactant-set R , as illustrated in Figure 1a . Moreover , when selecting reactants sequentially , the structural information of the previously selected reactants Rgiven should be ignored to avoid duplicated selections . From these observations , we design the scores ψθ ( R|P , Rgiven ) and φ ( P |R ) as follows : ψ ( R|P , Rgiven ) = CosSim ( fθ ( P ) − ∑ S∈Rgiven gθ ( S ) , hθ ( R ) ) , φ ( P |R ) = CosSim ( ∑ R∈R gθ ( R ) , hθ ( P ) ) , where CosSim is the cosine similarity and fθ , gθ , hθ are embedding functions from a molecule to a fixed-sized vector with parameters θ . Note that one could think that fθ and gθ are query functions for a product and a reactant , respectively , while hθ is a key function for a molecule . Such a query-key separation allows the search procedure to be processed as an efficient matrix-vector multiplication . This computational efficiency is important in our selection-based setting because the number of candidates is often very large , e.g. , |C| ≈ 6× 105 for the USPTO dataset . To parameterize the embedding functions fθ , gθ and hθ , we use the recently proposed graph neural network ( GNN ) architecture , structure2vec ( Dai et al. , 2016 ; 2019 ) . The implementation details of the architecture is described in Section 3.1 . Incorporating reaction types . A human expert could have some prior information about a reaction type , e.g. , carbon-carbon bond formation , for the target product P . To utilize this prior knowledge , we add trainable embedding bias vectors u ( t ) and v ( t ) for each reaction type t into the query embeddings of ψ and φ , respectively . For example , φ ( P |R ) becomes CosSim ( ∑ R∈R gθ ( R ) + v ( t ) , hθ ( P ) ) . The bias vectors are initialized by zero at beginning of training . | This submission describes an approach to single-step retrosynthesis based on contrastive learning that selects reactants that can be used to synthesize a target product in a single step. The stated contributions are (1) an approach to retrosynthesis that is constrained to only select “available” starting materials; and (2) a novel contrastive learning scheme with hard negative mining. The use of a contrastive loss to learn an embedding of reactants and their products that exhibit the property that the sum of reactant vectors has a high cosine similarity to the product vector is clever. This is a nice way to give structure to a continuous vector space. The strategy of hard negative mining is also clever and identifies the examples that would intuitively be the most informative. | SP:88387e597974d941b7f4a9c71c7bc42fc433fd4a |
RetCL: A Selection-based Approach for Retrosynthesis via Contrastive Learning | Retrosynthesis , of which the goal is to find a set of reactants for synthesizing a target product , is an emerging research area of deep learning . While the existing approaches have shown promising results , they currently lack the ability to consider availability ( e.g. , stability or purchasability ) of the reactants or generalize to unseen reaction templates ( i.e. , chemical reaction rules ) . In this paper , we propose a new approach that mitigates the issues by reformulating retrosynthesis into a selection problem of reactants from a candidate set of commercially available molecules . To this end , we design an efficient reactant selection framework , named RETCL ( retrosynthesis via contrastive learning ) , for enumerating all of the candidate molecules based on selection scores computed by graph neural networks . For learning the score functions , we also propose a novel contrastive training scheme with hard negative mining . Extensive experiments demonstrate the benefits of the proposed selection-based approach . For example , when all 671k reactants in the USPTO database are given as candidates , our RETCL achieves top-1 exact match accuracy of 71.3 % for the USPTO-50k benchmark , while a recent transformer-based approach achieves 59.6 % . We also demonstrate that RETCL generalizes well to unseen templates in various settings in contrast to template-based approaches . The code will be released . 1 INTRODUCTION . Retrosynthesis ( Corey , 1991 ) , finding a synthetic route starting from commercially available reactants to synthesize a target product ( see Figure 1a ) , is at the center of focus for discovering new materials in both academia and industry . It plays an essential role in practical applications by finding a new synthetic path , which can be more cost-effective or avoid patent infringement . However , retrosynthesis is a challenging task that requires searching over a vast number of molecules and chemical reactions , which is intractable to enumerate . Nevertheless , due to its utter importance , researchers have developed computer-aided frameworks to automate the process of retrosynthesis for more than three decades ( Corey et al. , 1985 ) . The computer-aided approaches for retrosynthesis mainly fall into two categories depending on their reliance on the reaction templates , i.e. , sub-graph patterns describing how the chemical reaction occurs among reactants ( see Figure 1b ) . The template-based approaches ( Coley et al. , 2017b ; Segler & Waller , 2017 ; Dai et al. , 2019 ) first enumerate known reaction templates and then apply a wellmatched template into the target product to obtain reactants . Although they can provide chemically interpretable predictions , they limit the search space to known templates and can not discover novel synthetic routes . In contrast , template-free approaches ( Liu et al. , 2017 ; Karpov et al. , 2019 ; Zheng et al. , 2019 ; Shi et al. , 2020 ) generate the reactants from scratch to avoid relying on the reaction templates . However , they require to search the entire molecular space , and their predictions could be either unstable or commercially unavailable . We emphasize that retrosynthesis methods are often required to consider the availability of reactants and generalize to unseen templates in real-world scenarios . For example , when a predicted reactant is not available ( e.g. , not purchasable ) for a chemist or a laboratory , the synthetic path starting from the predicted reactant can not be instantly used in practice . Moreover , chemists often require retrosynthetic analysis based on unknown reaction rules . This is especially significant due to our incomplete knowledge of chemical reactions ; e.g. , 29 million reactions were regularly recorded between 2009 and 2019 in Reaxys1 ( Mutton & Ridley , 2019 ) . Contribution . In this paper , we propose a new selection-based approach , which allows considering the commercial availability of reactants . To this end , we reformulate the task of retrosynthesis as a problem where reactants are selected from a candidate set of available molecules . This approach has two benefits over the existing ones : ( a ) it guarantees the commercial availability of the selected reactants , which allows chemists proceeding to practical procedures such as lab-scale experiments or optimization of reaction conditions ; ( b ) it can generalize to unseen reaction templates and find novel synthetic routes . For the selection-based retrosynthesis , we propose an efficient selection framework , named RETCL ( retrosynthesis via contrastive learning ) . To this end , we design two effective selection scores in synthetic and retrosynthetic manners . To be specific , we use the cosine similarity between molecular embeddings of the product and the reactants computed by graph neural networks . For training the score functions , we also propose a novel contrastive learning scheme ( Sohn , 2016 ; He et al. , 2019 ; Chen et al. , 2020b ) with hard negative mining ( Harwood et al. , 2017 ) to overcome a scalability issue while handling a large-scale candidate set . To demonstrate the effectiveness of our RETCL , we conduct various experiments based on the USPTO database ( Lowe , 2012 ) containing 1.8M chemical reactions in the US patent literature . Thanks to our prior knowledge on the candidate reactants , our method achieves 71.3 % test accuracy and significantly outperforms the baselines without such prior knowledge . Furthermore , our algorithm demonstrates its superiority even when enhancing the baselines with candidate reactants , e.g. , our algorithm improves upon the existing template-free approach ( Chen et al. , 2019 ) by 11.7 % . We also evaluate the generalization ability of RETCL by testing USPTO-50k-trained models on the USPTOfull dataset ; we obtain 39.9 % test accuracy while the state-of-the-art template-based approach ( Dai et al. , 2019 ) achieves 26.7 % . Finally , we demonstrate how our RETCL can improve multi-step retrosynthetic analysis where intermediate reactants are not in our candidate set . We believe our scheme has the potential to improve further in the future , by utilizing ( a ) additional chemical knowledge such as atom-mapping or leaving groups ( Shi et al. , 2020 ; Somnath et al. , 2020 ) ; ( b ) various constrastive learning techniques in other domains , e.g. , computer vision ( He et al. , 2019 ; Chen et al. , 2020b ; Hénaff et al. , 2019 ; Tian et al. , 2019 ) , audio processing ( Oord et al. , 2018 ) , and reinforcement learning ( Srinivas et al. , 2020 ) . 2 SELECTION-BASED RETROSYNTHESIS VIA CONTRASTIVE LEARNING . 2.1 OVERVIEW OF RETCL . In this section , we propose a selection framework for retrosynthesis via contrastive learning , coined RETCL . Our framework is based on solving the retrosynthesis task as a selection problem over a candidate set of commercially available reactants given the target product . Especially , we design a selection procedure based on molecular embeddings computed by graph neural networks and train the networks via contrastive learning . To this end , we define a chemical reactionR → P as a synthetic process of converting a reactant-set R = { R1 , . . . , Rn } , i.e. , a set of reactant molecules , to a product molecule P ( see Figure 1a ) . We 1A chemical database , https : //www.reaxys.com aim to solve the problem of retrosynthesis by finding the reactant-setR from a candidate set C which can be synthesized to the target product P . Especially , we consider the case when the candidate set C consists of commercially available molecules . Throughout this paper , we say that the synthetic direction ( fromR to P ) is forward and the retrosynthetic direction ( from P toR ) is backward . Note that our framework stands out from the existing works in terms of the candidate set C. To be specific , ( a ) template-free approaches ( Lin et al. , 2019 ; Karpov et al. , 2019 ; Shi et al. , 2020 ) choose C as the whole space of ( possibly unavailable ) molecules ; and ( b ) template-based approaches ( Coley et al. , 2017b ; Segler & Waller , 2017 ; Dai et al. , 2019 ) choose C as possible reactants extracted from the known reaction templates . In comparison , our framework neither requires ( a ) search over the entire space of molecules , or ( b ) domain knowledge to extract the reaction templates . We now briefly outline the RETCL framework . Our framework first searches the most likely reactantsetsR1 , . . . , RT ⊂ C in a sequential manner based on a backward selection score ψ ( R|P , Rgiven ) , and then ranks the reactant-sets using ψ ( R|P , Rgiven ) and another forward score φ ( P |R ) . For learning the score functions , we propose a novel contrastive learning scheme with hard negative mining for improving the selection qualities . We next provide detailed descriptions of the search procedure and the training scheme in Section 2.2 and 2.3 , respectively . 2.2 SEARCH PROCEDURE WITH GRAPH NEURAL NETWORKS . We first introduce the search procedure of RETCL in detail . To find a reactant-setR = { R1 , . . . , Rn } , we select each elementRi sequentially from the candidate set C based on the backward ( retrosynthetic ) selection score ψ ( R|P , Rgiven ) . It represents a selection score of a reactant R given a target product P and a set of previously selected reactantsRgiven ⊂ C. Note that the score function is also capable of selecting a special reactant Rhalt to stop updating the reactant-set . Using beam search , we choose top T likely reactant-setsR1 , . . . , RT . Furthermore , we rank the chosen reactant-setsR1 , . . . , RT based on the backward selection score ψ ( R|P , Rgiven ) and the forward ( synthetic ) score φ ( P |R ) . The latter represents the synthesizability ofR for P . Note that ψ ( R|P , Rgiven ) and φ ( P |R ) correspond to backward and forward directions of a chemical reaction R → P , respectively ( see Section 2.1 and Figure 1a ) . Using both score functions , we define an overall score on a chemical reactionR → P as follows : score ( P , R ) = 1 n+ 2 ( max π∈Π n+1∑ i=1 ψ ( Rπ ( i ) |P , { Rπ ( 1 ) , . . . , Rπ ( i−1 ) } ) + φ ( P |R ) ) , ( 1 ) whereRn+1 = Rhalt and Π is the space of permutations defined on the integers 1 , . . . , n+1 satisfying π ( n+1 ) = n+1 . Based on score ( P , R ) , we decide the rankings of R1 , . . . , RT for synthesizing the target product P . We note that the maxπ∈Π operator and the 1n+2 term make the overall score ( equation 1 ) be independent of order and number of reactants , respectively . Figure 2 illustrates this search procedure of our framework . Score design . We next elaborate our design choices for the score functions ψ and φ . We first observe that the molecular graph of the product P can be decomposed into subgraphs from each reactant of the reactant-set R , as illustrated in Figure 1a . Moreover , when selecting reactants sequentially , the structural information of the previously selected reactants Rgiven should be ignored to avoid duplicated selections . From these observations , we design the scores ψθ ( R|P , Rgiven ) and φ ( P |R ) as follows : ψ ( R|P , Rgiven ) = CosSim ( fθ ( P ) − ∑ S∈Rgiven gθ ( S ) , hθ ( R ) ) , φ ( P |R ) = CosSim ( ∑ R∈R gθ ( R ) , hθ ( P ) ) , where CosSim is the cosine similarity and fθ , gθ , hθ are embedding functions from a molecule to a fixed-sized vector with parameters θ . Note that one could think that fθ and gθ are query functions for a product and a reactant , respectively , while hθ is a key function for a molecule . Such a query-key separation allows the search procedure to be processed as an efficient matrix-vector multiplication . This computational efficiency is important in our selection-based setting because the number of candidates is often very large , e.g. , |C| ≈ 6× 105 for the USPTO dataset . To parameterize the embedding functions fθ , gθ and hθ , we use the recently proposed graph neural network ( GNN ) architecture , structure2vec ( Dai et al. , 2016 ; 2019 ) . The implementation details of the architecture is described in Section 3.1 . Incorporating reaction types . A human expert could have some prior information about a reaction type , e.g. , carbon-carbon bond formation , for the target product P . To utilize this prior knowledge , we add trainable embedding bias vectors u ( t ) and v ( t ) for each reaction type t into the query embeddings of ψ and φ , respectively . For example , φ ( P |R ) becomes CosSim ( ∑ R∈R gθ ( R ) + v ( t ) , hθ ( P ) ) . The bias vectors are initialized by zero at beginning of training . | RETCL enumerates all of the candidate molecules (all US patent dataset, all 671k) based on selection scores computed by graph neural networks. The cosine similarity between products and reactants are used to design scores, which is later used for training. The way of ‘cosine similarity to bridge reactants to products are interesting. | SP:88387e597974d941b7f4a9c71c7bc42fc433fd4a |
RetCL: A Selection-based Approach for Retrosynthesis via Contrastive Learning | Retrosynthesis , of which the goal is to find a set of reactants for synthesizing a target product , is an emerging research area of deep learning . While the existing approaches have shown promising results , they currently lack the ability to consider availability ( e.g. , stability or purchasability ) of the reactants or generalize to unseen reaction templates ( i.e. , chemical reaction rules ) . In this paper , we propose a new approach that mitigates the issues by reformulating retrosynthesis into a selection problem of reactants from a candidate set of commercially available molecules . To this end , we design an efficient reactant selection framework , named RETCL ( retrosynthesis via contrastive learning ) , for enumerating all of the candidate molecules based on selection scores computed by graph neural networks . For learning the score functions , we also propose a novel contrastive training scheme with hard negative mining . Extensive experiments demonstrate the benefits of the proposed selection-based approach . For example , when all 671k reactants in the USPTO database are given as candidates , our RETCL achieves top-1 exact match accuracy of 71.3 % for the USPTO-50k benchmark , while a recent transformer-based approach achieves 59.6 % . We also demonstrate that RETCL generalizes well to unseen templates in various settings in contrast to template-based approaches . The code will be released . 1 INTRODUCTION . Retrosynthesis ( Corey , 1991 ) , finding a synthetic route starting from commercially available reactants to synthesize a target product ( see Figure 1a ) , is at the center of focus for discovering new materials in both academia and industry . It plays an essential role in practical applications by finding a new synthetic path , which can be more cost-effective or avoid patent infringement . However , retrosynthesis is a challenging task that requires searching over a vast number of molecules and chemical reactions , which is intractable to enumerate . Nevertheless , due to its utter importance , researchers have developed computer-aided frameworks to automate the process of retrosynthesis for more than three decades ( Corey et al. , 1985 ) . The computer-aided approaches for retrosynthesis mainly fall into two categories depending on their reliance on the reaction templates , i.e. , sub-graph patterns describing how the chemical reaction occurs among reactants ( see Figure 1b ) . The template-based approaches ( Coley et al. , 2017b ; Segler & Waller , 2017 ; Dai et al. , 2019 ) first enumerate known reaction templates and then apply a wellmatched template into the target product to obtain reactants . Although they can provide chemically interpretable predictions , they limit the search space to known templates and can not discover novel synthetic routes . In contrast , template-free approaches ( Liu et al. , 2017 ; Karpov et al. , 2019 ; Zheng et al. , 2019 ; Shi et al. , 2020 ) generate the reactants from scratch to avoid relying on the reaction templates . However , they require to search the entire molecular space , and their predictions could be either unstable or commercially unavailable . We emphasize that retrosynthesis methods are often required to consider the availability of reactants and generalize to unseen templates in real-world scenarios . For example , when a predicted reactant is not available ( e.g. , not purchasable ) for a chemist or a laboratory , the synthetic path starting from the predicted reactant can not be instantly used in practice . Moreover , chemists often require retrosynthetic analysis based on unknown reaction rules . This is especially significant due to our incomplete knowledge of chemical reactions ; e.g. , 29 million reactions were regularly recorded between 2009 and 2019 in Reaxys1 ( Mutton & Ridley , 2019 ) . Contribution . In this paper , we propose a new selection-based approach , which allows considering the commercial availability of reactants . To this end , we reformulate the task of retrosynthesis as a problem where reactants are selected from a candidate set of available molecules . This approach has two benefits over the existing ones : ( a ) it guarantees the commercial availability of the selected reactants , which allows chemists proceeding to practical procedures such as lab-scale experiments or optimization of reaction conditions ; ( b ) it can generalize to unseen reaction templates and find novel synthetic routes . For the selection-based retrosynthesis , we propose an efficient selection framework , named RETCL ( retrosynthesis via contrastive learning ) . To this end , we design two effective selection scores in synthetic and retrosynthetic manners . To be specific , we use the cosine similarity between molecular embeddings of the product and the reactants computed by graph neural networks . For training the score functions , we also propose a novel contrastive learning scheme ( Sohn , 2016 ; He et al. , 2019 ; Chen et al. , 2020b ) with hard negative mining ( Harwood et al. , 2017 ) to overcome a scalability issue while handling a large-scale candidate set . To demonstrate the effectiveness of our RETCL , we conduct various experiments based on the USPTO database ( Lowe , 2012 ) containing 1.8M chemical reactions in the US patent literature . Thanks to our prior knowledge on the candidate reactants , our method achieves 71.3 % test accuracy and significantly outperforms the baselines without such prior knowledge . Furthermore , our algorithm demonstrates its superiority even when enhancing the baselines with candidate reactants , e.g. , our algorithm improves upon the existing template-free approach ( Chen et al. , 2019 ) by 11.7 % . We also evaluate the generalization ability of RETCL by testing USPTO-50k-trained models on the USPTOfull dataset ; we obtain 39.9 % test accuracy while the state-of-the-art template-based approach ( Dai et al. , 2019 ) achieves 26.7 % . Finally , we demonstrate how our RETCL can improve multi-step retrosynthetic analysis where intermediate reactants are not in our candidate set . We believe our scheme has the potential to improve further in the future , by utilizing ( a ) additional chemical knowledge such as atom-mapping or leaving groups ( Shi et al. , 2020 ; Somnath et al. , 2020 ) ; ( b ) various constrastive learning techniques in other domains , e.g. , computer vision ( He et al. , 2019 ; Chen et al. , 2020b ; Hénaff et al. , 2019 ; Tian et al. , 2019 ) , audio processing ( Oord et al. , 2018 ) , and reinforcement learning ( Srinivas et al. , 2020 ) . 2 SELECTION-BASED RETROSYNTHESIS VIA CONTRASTIVE LEARNING . 2.1 OVERVIEW OF RETCL . In this section , we propose a selection framework for retrosynthesis via contrastive learning , coined RETCL . Our framework is based on solving the retrosynthesis task as a selection problem over a candidate set of commercially available reactants given the target product . Especially , we design a selection procedure based on molecular embeddings computed by graph neural networks and train the networks via contrastive learning . To this end , we define a chemical reactionR → P as a synthetic process of converting a reactant-set R = { R1 , . . . , Rn } , i.e. , a set of reactant molecules , to a product molecule P ( see Figure 1a ) . We 1A chemical database , https : //www.reaxys.com aim to solve the problem of retrosynthesis by finding the reactant-setR from a candidate set C which can be synthesized to the target product P . Especially , we consider the case when the candidate set C consists of commercially available molecules . Throughout this paper , we say that the synthetic direction ( fromR to P ) is forward and the retrosynthetic direction ( from P toR ) is backward . Note that our framework stands out from the existing works in terms of the candidate set C. To be specific , ( a ) template-free approaches ( Lin et al. , 2019 ; Karpov et al. , 2019 ; Shi et al. , 2020 ) choose C as the whole space of ( possibly unavailable ) molecules ; and ( b ) template-based approaches ( Coley et al. , 2017b ; Segler & Waller , 2017 ; Dai et al. , 2019 ) choose C as possible reactants extracted from the known reaction templates . In comparison , our framework neither requires ( a ) search over the entire space of molecules , or ( b ) domain knowledge to extract the reaction templates . We now briefly outline the RETCL framework . Our framework first searches the most likely reactantsetsR1 , . . . , RT ⊂ C in a sequential manner based on a backward selection score ψ ( R|P , Rgiven ) , and then ranks the reactant-sets using ψ ( R|P , Rgiven ) and another forward score φ ( P |R ) . For learning the score functions , we propose a novel contrastive learning scheme with hard negative mining for improving the selection qualities . We next provide detailed descriptions of the search procedure and the training scheme in Section 2.2 and 2.3 , respectively . 2.2 SEARCH PROCEDURE WITH GRAPH NEURAL NETWORKS . We first introduce the search procedure of RETCL in detail . To find a reactant-setR = { R1 , . . . , Rn } , we select each elementRi sequentially from the candidate set C based on the backward ( retrosynthetic ) selection score ψ ( R|P , Rgiven ) . It represents a selection score of a reactant R given a target product P and a set of previously selected reactantsRgiven ⊂ C. Note that the score function is also capable of selecting a special reactant Rhalt to stop updating the reactant-set . Using beam search , we choose top T likely reactant-setsR1 , . . . , RT . Furthermore , we rank the chosen reactant-setsR1 , . . . , RT based on the backward selection score ψ ( R|P , Rgiven ) and the forward ( synthetic ) score φ ( P |R ) . The latter represents the synthesizability ofR for P . Note that ψ ( R|P , Rgiven ) and φ ( P |R ) correspond to backward and forward directions of a chemical reaction R → P , respectively ( see Section 2.1 and Figure 1a ) . Using both score functions , we define an overall score on a chemical reactionR → P as follows : score ( P , R ) = 1 n+ 2 ( max π∈Π n+1∑ i=1 ψ ( Rπ ( i ) |P , { Rπ ( 1 ) , . . . , Rπ ( i−1 ) } ) + φ ( P |R ) ) , ( 1 ) whereRn+1 = Rhalt and Π is the space of permutations defined on the integers 1 , . . . , n+1 satisfying π ( n+1 ) = n+1 . Based on score ( P , R ) , we decide the rankings of R1 , . . . , RT for synthesizing the target product P . We note that the maxπ∈Π operator and the 1n+2 term make the overall score ( equation 1 ) be independent of order and number of reactants , respectively . Figure 2 illustrates this search procedure of our framework . Score design . We next elaborate our design choices for the score functions ψ and φ . We first observe that the molecular graph of the product P can be decomposed into subgraphs from each reactant of the reactant-set R , as illustrated in Figure 1a . Moreover , when selecting reactants sequentially , the structural information of the previously selected reactants Rgiven should be ignored to avoid duplicated selections . From these observations , we design the scores ψθ ( R|P , Rgiven ) and φ ( P |R ) as follows : ψ ( R|P , Rgiven ) = CosSim ( fθ ( P ) − ∑ S∈Rgiven gθ ( S ) , hθ ( R ) ) , φ ( P |R ) = CosSim ( ∑ R∈R gθ ( R ) , hθ ( P ) ) , where CosSim is the cosine similarity and fθ , gθ , hθ are embedding functions from a molecule to a fixed-sized vector with parameters θ . Note that one could think that fθ and gθ are query functions for a product and a reactant , respectively , while hθ is a key function for a molecule . Such a query-key separation allows the search procedure to be processed as an efficient matrix-vector multiplication . This computational efficiency is important in our selection-based setting because the number of candidates is often very large , e.g. , |C| ≈ 6× 105 for the USPTO dataset . To parameterize the embedding functions fθ , gθ and hθ , we use the recently proposed graph neural network ( GNN ) architecture , structure2vec ( Dai et al. , 2016 ; 2019 ) . The implementation details of the architecture is described in Section 3.1 . Incorporating reaction types . A human expert could have some prior information about a reaction type , e.g. , carbon-carbon bond formation , for the target product P . To utilize this prior knowledge , we add trainable embedding bias vectors u ( t ) and v ( t ) for each reaction type t into the query embeddings of ψ and φ , respectively . For example , φ ( P |R ) becomes CosSim ( ∑ R∈R gθ ( R ) + v ( t ) , hθ ( P ) ) . The bias vectors are initialized by zero at beginning of training . | This paper poses an approach to retrosynthesis that addresses the challenges of (i) availability of reactants and (ii) generalization to unseen templates. To achieve this the authors reformulate retrosynthesis as the selection of reactants from a fixed set, in the case of the USPTO database this is the set of 671,578 commercially available reactants used in the database. Their reactant selection framework RetCL uses GNNs to calculate selection scores for all candidate molecules. A novel contrastive training scheme is used to learn the selection score, which is computed as the cosine similarity between embeddings of the product and the reactants computed by the graph neural networks. The authors provide a good summary of related work in this area. | SP:88387e597974d941b7f4a9c71c7bc42fc433fd4a |
Ranking Cost: One-Stage Circuit Routing by Directly Optimizing Global Objective Function | 1 INTRODUCTION . As described in Moore ’ s Law ( Schaller , 1997 ) , the number of transistors in a dense integrated circuit ( IC ) increases exponentially over time and the complexity of chips and printed circuit boards ( PCBs ) becomes higher and higher . Such high complexity makes the IC design a time-consuming and errorprone work . Thus more capable automatic design systems , such as electronic design automation ( EDA ) tools , are needed to improve the performance . In the flow of IC designs , we need to find proper paths to place wires which connect electronic components on ICs , and these wires need to achieve expected connectivity under certain constraints . One of the most important constraints is that wires on the same layout should not intersect . In addition , to reduce the signal propagation delay , the wire-length should be minimized . This is a critical and challenging stage in the IC design flow ( Hu & Sapatnekar , 2001 ) , known as circuit routing , which has been studied by lots of researchers ( Kramer , 1984 ; Zhang & Chu , 2012 ; He & Bao , 2020 ) . Circuit routing involves a large number of nets ( a net is a set of vertices with the same electrical property ) to be routed , which is computationally expensive and makes manual design extremely time-consuming ( Kong et al. , 2009 ; Coombs & Holden , 2001 ) . Even under the simplest setting , where only two pairs of pins need to be routed , it is an NP-complete problem ( Kramer , 1984 ) . Although lots of circuit routing algorithms have been proposed ( Zhang , 2016 ) , there still remain three major challenges : ( 1 ) Early solutions ( Hu & Sapatnekar , 2001 ) are typically designed with hard-coded heuristics , which suffer from problems of non-optimal solutions ( Zhang , 2016 ) and lack of flexibility over new design needs . Therefore , a more powerful routing method that does not depend on domain knowledge is highly desired . ( 2 ) To reduce the difficulty of complex routing problems , traditional routing algorithms often adopt a two-stage procedure — first global routing and then detailed routing ( Chen & Chang , 2009 ; Kahng et al. , 2011 ) . The problem is that these two stages do not always coordinate well ( Zhang & Chu , 2012 ; Shi & Davoodi , 2017 ) . Sometimes a low-congested global routing result may lead to downstream detailed router un-routable . Hence , an end-to-end algorithm is preferred which can optimize the final global objective ( e.g. , the total wire-length ) directly . ( 3 ) Although a few learning-based methods have been proposed ( Liao et al. , 2020 ; He & Bao , 2020 ) recently , their methods are hard to extend to large-scale applications . In real settings , there are lots of components and nets on a single chip , which shows greater demand for the scalability of routing algorithms . To relieve the problems mentioned above , we propose a new algorithm , denoted as Ranking Cost ( RC ) , for circuit routing . In this paper , we innovatively combine search-based methods ( i.e. , A * algorithm ) and learning-based methods ( i.e. , Evolution Strategies ( Salimans et al. , 2017 ) ) to form an trainable router with proper parametrization . Our method is flexible for integrating new constraints and rules so long as they can be merged into the global objective function . Moreover , our method is an one-stage algorithm , which optimizes the global objective function directly . In our method , we introduce a new set of variables called cost maps , which can help the A * routers to find out proper paths to achieve the global objective . We also train a ranking parameter , which can produce the ranking order and further improve the performance of our method . In the experiments , we compare our method with the commonly used A * method and a canonical reinforcement learning approach , and results show that our method outperforms these baselines with higher connectivity rates . Our ablation study also shows that trained cost maps can capture the global information and guide the routing solution to approach global optimal . Experiments also show that our method is scalable to larger applications . 2 RELATED WORK . In this section , we summarize the related work on circuit routing . 2.1 TWO-STAGE ROUTING ALGORITHMS . The routing problem can be heuristically separated into two stages , the first being the global routing step , followed by detailed routing . On the one hand , there are multiple heuristic-based approaches for global routing including regionwise routing ( Hu & Sapatnekar , 2001 ) , force-directed routing ( Mo et al. , 2001 ) , and rip-up and reroute ( Cho et al. , 2007 ) . On the other hand , the most commonly used detailed routing algorithms are channel routing and its variants ( Ho et al. , 1991 ; Mandal et al. , 2020 ) , which decompose the routing region into routing channels and generate wires in these channels ( Chen & Chang , 2009 ) . One main issue of the two-stage methods is that these two stages do not always coordinate well ( Shi & Davoodi , 2017 ) , which results in enormous difficulty in joint optimization . Instead , our method is an one-stage algorithm and new design constraints can be simply involved into the objective function without changing the algorithm itself . 2.2 SEQUENTIAL ROUTING ALGORITHMS . A more straightforward strategy for circuit routing is to select a specific order and then route nets sequentially , e.g. , sequential A * algorithm and Lees algorithm ( Huang et al. , 2014 ; Malavasi & Sangiovanni-Vincentelli , 1993 ) . The major advantage of this type of approaches is that the congestion information for previously routed nets can be taken into consideration while routing the current one . However , the drawback of these sequential approaches is that the quality of the solution is very sensitive to the orders ( Zhang , 2016 ) . Moreover , earlier routed paths only focus on finding their own best solutions and are impossible to take into account the situation of subsequent paths . Such greedy strategies may make a solvable circuit routing problem insolvable . Figure 1 shows an example that the sequential A * algorithm will fail to handle . In this example , there are two pairs of points to be routed , i.e. , we should connect start vertices Si and end vertices Ei , i ∈ { 1 , 2 } , respectively . If we connect the pair ( S1 , E1 ) first in its shortest path , it will make ( S2 , E2 ) disconnected as showed in Figure 1 ( d ) , and vice versa ( Figure 1 ( e ) ) . But this case can be solved easily by our algorithm as showed in Figure 1 ( f ) , which means that our algorithm can take into account the global information when generating each path . 2.3 LEARNING-BASED ALGORITHMS FOR CIRCUIT ROUTING . There are some learning-based algorithms for circuit routing ( Qi et al. , 2014 ; Liao et al. , 2020 ) . Early methods are more focusing on supervised learning , such as learning models to predict routing congestion ( Qi et al. , 2014 ) or predicting the routability ( Zhou et al. , 2015 ; Xie et al. , 2018 ) . But the performances of these supervised models are constrained by the limits of human knowledge . Recently , Liao et al . ( 2020 ) trained a deep Q-network ( DQN ) to solve the global routing problem and their method still suffers from the miscoupling problem of two-stage routing algorithms . In addition , He & Bao ( 2020 ) reform circuit routing to a tree search problem and utilize a deep neural network as the rollout policy . However , their rollout policy is trained in a supervised manner with artificial data . Instead , our method optimizes the global objective function directly and does not require any artificial data or human demonstration . 3 BACKGROUND AND NOTATIONS . In this section , we will formalize the circuit routing problem first and then give a brief introduction to the OpenAI-ES algorithm ( Salimans et al. , 2017 ) . 3.1 CIRCUIT ROUTING . Circuit routing is a path search problem , where the goal is to find non-intersecting paths that connect an arbitrary number of pairs of vertices . It can be formalized as a grid graph G = ( V , E ) , where each vertex vi ∈ V represents an intersection on the grid , and each edge eij ∈ E represents the path between vi and its 1-hop neighbors vj ∈ V . And the non-routable obstructive vertices form a obstacle set , denoted as O ⊂ V . In circuit routing , a net N = { vn1 , vn2 , ... } ⊂ V is a set of vertices that need to be connected and a multi-vertex net can be decomposed into multiple two-vertex nets via a minimum spanning tree ( MST ) or a rectilinear Steiner tree ( RST ) ( de Vincente et al. , 1998 ; Hu & Sapatnekar , 2001 ) . Following He & Bao ( 2020 ) , we simplify this problem by letting each net only contain two vertices , i.e , a two-vertex net is defined as N = { vs , ve } with a start vertex vs and an end vertex ve . The net should be connected by a path P = [ v1 , v2 , ... , vn ] with vs = v1 , ve = vn and P ∩ O = ∅ . We use |P | to represent the length of the path P . Given a set N of nets { Ni } , we need to find a set P of paths { Pi } that connect these nets . A reasonable routing plan for a given set of nets is that all the paths do not share any vertex . In some cases , the routing problem do not have a solution because such a non-intersecting set P does not exist . In circuit routing , the routed paths should satisfy some constraints or achieve some goals . In this paper , we choose the most commonly used goal , i.e. , minimize the total length of paths . Given a solution P , the total length of paths is defined as L = ∑ P∈P |P | . 3.2 EVOLUTION STRATEGIES . Evolution Strategies ( ES ) is a class of black box optimization methods ( Rechenberg , 1994 ; Hansen & Ostermeier , 2001 ) . Recently , an evolution strategy variant , referred as the OpenAI-ES ( Salimans et al. , 2017 ) , has attracted attention because it could rival the performance of modern deep reinforcement learning methods on multiple control tasks . In the OpenAI-ES , there is a reward function , denoted as F ( ψ ) , where ψ is a solution vector , which is sampled from a probability distribution function ψ ∼ pθ ( ψ ) . The goal is to maximize the expected value J ( θ ) , which is defined as : max θ J ( θ ) = max θ Eψ∼pθ [ F ( ψ ) ] = max θ ∫ F ( ψ ) pθ ( ψ ) dψ . ( 1 ) A straightforward way to achieve this is to use the gradient ascent : θ ← θ + α∇θJ ( θ ) , ( 2 ) where α is the learning rate . In the OpenAI-ES , a score function estimator is used to calculate the gradient , which is similar to REINFORCE ( Williams , 1992 ) : ∇θJ ( θ ) = ∇θEψ∼pθ [ F ( ψ ) ] = Eψ∼pθ [ F ( ψ ) ∇θ log pθ ( ψ ) ] . ( 3 ) Usually , pθ is an isotropic multivariate Gaussian with mean θ and fixed covariance σ2I . And the expected value can be rewritten as Eψ∼pθ [ F ( ψ ) ] = E ∼N ( 0 , I ) [ F ( θ+σ ) ] . Thus the gradient estimator changes to : ∇θJ ( θ ) = ∇θE ∼N ( 0 , I ) [ F ( θ + σ ) ] = 1 σ E ∼N ( 0 , I ) [ F ( θ + σ ) ] , ( 4 ) where is sampled from a standard normal distribution . Once we form an objective function J ( θ ) , the gradient ∇θJ ( θ ) can be approximated via Equation 4 and parameters θ can be updated via Equation 2 . | In this paper the authors attempt to solve the circuit routing problem through a novel approach of combining search-based routing techniques (e.g. A* search) and evolutionary strategies (e.g. OpenAI-ES). The authors define new parameters e.g. cost maps and a ranking parameter which improve the efficiency and effectiveness of their circuit routing solution. As opposed to heuristics based (2-step) routing solutions, the authors develop a solution which optimizes a single global cost function. This makes the solution easily scalable to new constraints and designs while avoiding sub-optimal solutions (common problem for 2-stage routing). The authors show that their approach doesn’t require human demonstrations or training data of any kind thereby giving their solution an edge over learning-based techniques requiring training data. Lastly, through experiments the authors establish that their approach is scalable to larger applications. | SP:d72d696772354772231126f097a0cb17218625c2 |
Ranking Cost: One-Stage Circuit Routing by Directly Optimizing Global Objective Function | 1 INTRODUCTION . As described in Moore ’ s Law ( Schaller , 1997 ) , the number of transistors in a dense integrated circuit ( IC ) increases exponentially over time and the complexity of chips and printed circuit boards ( PCBs ) becomes higher and higher . Such high complexity makes the IC design a time-consuming and errorprone work . Thus more capable automatic design systems , such as electronic design automation ( EDA ) tools , are needed to improve the performance . In the flow of IC designs , we need to find proper paths to place wires which connect electronic components on ICs , and these wires need to achieve expected connectivity under certain constraints . One of the most important constraints is that wires on the same layout should not intersect . In addition , to reduce the signal propagation delay , the wire-length should be minimized . This is a critical and challenging stage in the IC design flow ( Hu & Sapatnekar , 2001 ) , known as circuit routing , which has been studied by lots of researchers ( Kramer , 1984 ; Zhang & Chu , 2012 ; He & Bao , 2020 ) . Circuit routing involves a large number of nets ( a net is a set of vertices with the same electrical property ) to be routed , which is computationally expensive and makes manual design extremely time-consuming ( Kong et al. , 2009 ; Coombs & Holden , 2001 ) . Even under the simplest setting , where only two pairs of pins need to be routed , it is an NP-complete problem ( Kramer , 1984 ) . Although lots of circuit routing algorithms have been proposed ( Zhang , 2016 ) , there still remain three major challenges : ( 1 ) Early solutions ( Hu & Sapatnekar , 2001 ) are typically designed with hard-coded heuristics , which suffer from problems of non-optimal solutions ( Zhang , 2016 ) and lack of flexibility over new design needs . Therefore , a more powerful routing method that does not depend on domain knowledge is highly desired . ( 2 ) To reduce the difficulty of complex routing problems , traditional routing algorithms often adopt a two-stage procedure — first global routing and then detailed routing ( Chen & Chang , 2009 ; Kahng et al. , 2011 ) . The problem is that these two stages do not always coordinate well ( Zhang & Chu , 2012 ; Shi & Davoodi , 2017 ) . Sometimes a low-congested global routing result may lead to downstream detailed router un-routable . Hence , an end-to-end algorithm is preferred which can optimize the final global objective ( e.g. , the total wire-length ) directly . ( 3 ) Although a few learning-based methods have been proposed ( Liao et al. , 2020 ; He & Bao , 2020 ) recently , their methods are hard to extend to large-scale applications . In real settings , there are lots of components and nets on a single chip , which shows greater demand for the scalability of routing algorithms . To relieve the problems mentioned above , we propose a new algorithm , denoted as Ranking Cost ( RC ) , for circuit routing . In this paper , we innovatively combine search-based methods ( i.e. , A * algorithm ) and learning-based methods ( i.e. , Evolution Strategies ( Salimans et al. , 2017 ) ) to form an trainable router with proper parametrization . Our method is flexible for integrating new constraints and rules so long as they can be merged into the global objective function . Moreover , our method is an one-stage algorithm , which optimizes the global objective function directly . In our method , we introduce a new set of variables called cost maps , which can help the A * routers to find out proper paths to achieve the global objective . We also train a ranking parameter , which can produce the ranking order and further improve the performance of our method . In the experiments , we compare our method with the commonly used A * method and a canonical reinforcement learning approach , and results show that our method outperforms these baselines with higher connectivity rates . Our ablation study also shows that trained cost maps can capture the global information and guide the routing solution to approach global optimal . Experiments also show that our method is scalable to larger applications . 2 RELATED WORK . In this section , we summarize the related work on circuit routing . 2.1 TWO-STAGE ROUTING ALGORITHMS . The routing problem can be heuristically separated into two stages , the first being the global routing step , followed by detailed routing . On the one hand , there are multiple heuristic-based approaches for global routing including regionwise routing ( Hu & Sapatnekar , 2001 ) , force-directed routing ( Mo et al. , 2001 ) , and rip-up and reroute ( Cho et al. , 2007 ) . On the other hand , the most commonly used detailed routing algorithms are channel routing and its variants ( Ho et al. , 1991 ; Mandal et al. , 2020 ) , which decompose the routing region into routing channels and generate wires in these channels ( Chen & Chang , 2009 ) . One main issue of the two-stage methods is that these two stages do not always coordinate well ( Shi & Davoodi , 2017 ) , which results in enormous difficulty in joint optimization . Instead , our method is an one-stage algorithm and new design constraints can be simply involved into the objective function without changing the algorithm itself . 2.2 SEQUENTIAL ROUTING ALGORITHMS . A more straightforward strategy for circuit routing is to select a specific order and then route nets sequentially , e.g. , sequential A * algorithm and Lees algorithm ( Huang et al. , 2014 ; Malavasi & Sangiovanni-Vincentelli , 1993 ) . The major advantage of this type of approaches is that the congestion information for previously routed nets can be taken into consideration while routing the current one . However , the drawback of these sequential approaches is that the quality of the solution is very sensitive to the orders ( Zhang , 2016 ) . Moreover , earlier routed paths only focus on finding their own best solutions and are impossible to take into account the situation of subsequent paths . Such greedy strategies may make a solvable circuit routing problem insolvable . Figure 1 shows an example that the sequential A * algorithm will fail to handle . In this example , there are two pairs of points to be routed , i.e. , we should connect start vertices Si and end vertices Ei , i ∈ { 1 , 2 } , respectively . If we connect the pair ( S1 , E1 ) first in its shortest path , it will make ( S2 , E2 ) disconnected as showed in Figure 1 ( d ) , and vice versa ( Figure 1 ( e ) ) . But this case can be solved easily by our algorithm as showed in Figure 1 ( f ) , which means that our algorithm can take into account the global information when generating each path . 2.3 LEARNING-BASED ALGORITHMS FOR CIRCUIT ROUTING . There are some learning-based algorithms for circuit routing ( Qi et al. , 2014 ; Liao et al. , 2020 ) . Early methods are more focusing on supervised learning , such as learning models to predict routing congestion ( Qi et al. , 2014 ) or predicting the routability ( Zhou et al. , 2015 ; Xie et al. , 2018 ) . But the performances of these supervised models are constrained by the limits of human knowledge . Recently , Liao et al . ( 2020 ) trained a deep Q-network ( DQN ) to solve the global routing problem and their method still suffers from the miscoupling problem of two-stage routing algorithms . In addition , He & Bao ( 2020 ) reform circuit routing to a tree search problem and utilize a deep neural network as the rollout policy . However , their rollout policy is trained in a supervised manner with artificial data . Instead , our method optimizes the global objective function directly and does not require any artificial data or human demonstration . 3 BACKGROUND AND NOTATIONS . In this section , we will formalize the circuit routing problem first and then give a brief introduction to the OpenAI-ES algorithm ( Salimans et al. , 2017 ) . 3.1 CIRCUIT ROUTING . Circuit routing is a path search problem , where the goal is to find non-intersecting paths that connect an arbitrary number of pairs of vertices . It can be formalized as a grid graph G = ( V , E ) , where each vertex vi ∈ V represents an intersection on the grid , and each edge eij ∈ E represents the path between vi and its 1-hop neighbors vj ∈ V . And the non-routable obstructive vertices form a obstacle set , denoted as O ⊂ V . In circuit routing , a net N = { vn1 , vn2 , ... } ⊂ V is a set of vertices that need to be connected and a multi-vertex net can be decomposed into multiple two-vertex nets via a minimum spanning tree ( MST ) or a rectilinear Steiner tree ( RST ) ( de Vincente et al. , 1998 ; Hu & Sapatnekar , 2001 ) . Following He & Bao ( 2020 ) , we simplify this problem by letting each net only contain two vertices , i.e , a two-vertex net is defined as N = { vs , ve } with a start vertex vs and an end vertex ve . The net should be connected by a path P = [ v1 , v2 , ... , vn ] with vs = v1 , ve = vn and P ∩ O = ∅ . We use |P | to represent the length of the path P . Given a set N of nets { Ni } , we need to find a set P of paths { Pi } that connect these nets . A reasonable routing plan for a given set of nets is that all the paths do not share any vertex . In some cases , the routing problem do not have a solution because such a non-intersecting set P does not exist . In circuit routing , the routed paths should satisfy some constraints or achieve some goals . In this paper , we choose the most commonly used goal , i.e. , minimize the total length of paths . Given a solution P , the total length of paths is defined as L = ∑ P∈P |P | . 3.2 EVOLUTION STRATEGIES . Evolution Strategies ( ES ) is a class of black box optimization methods ( Rechenberg , 1994 ; Hansen & Ostermeier , 2001 ) . Recently , an evolution strategy variant , referred as the OpenAI-ES ( Salimans et al. , 2017 ) , has attracted attention because it could rival the performance of modern deep reinforcement learning methods on multiple control tasks . In the OpenAI-ES , there is a reward function , denoted as F ( ψ ) , where ψ is a solution vector , which is sampled from a probability distribution function ψ ∼ pθ ( ψ ) . The goal is to maximize the expected value J ( θ ) , which is defined as : max θ J ( θ ) = max θ Eψ∼pθ [ F ( ψ ) ] = max θ ∫ F ( ψ ) pθ ( ψ ) dψ . ( 1 ) A straightforward way to achieve this is to use the gradient ascent : θ ← θ + α∇θJ ( θ ) , ( 2 ) where α is the learning rate . In the OpenAI-ES , a score function estimator is used to calculate the gradient , which is similar to REINFORCE ( Williams , 1992 ) : ∇θJ ( θ ) = ∇θEψ∼pθ [ F ( ψ ) ] = Eψ∼pθ [ F ( ψ ) ∇θ log pθ ( ψ ) ] . ( 3 ) Usually , pθ is an isotropic multivariate Gaussian with mean θ and fixed covariance σ2I . And the expected value can be rewritten as Eψ∼pθ [ F ( ψ ) ] = E ∼N ( 0 , I ) [ F ( θ+σ ) ] . Thus the gradient estimator changes to : ∇θJ ( θ ) = ∇θE ∼N ( 0 , I ) [ F ( θ + σ ) ] = 1 σ E ∼N ( 0 , I ) [ F ( θ + σ ) ] , ( 4 ) where is sampled from a standard normal distribution . Once we form an objective function J ( θ ) , the gradient ∇θJ ( θ ) can be approximated via Equation 4 and parameters θ can be updated via Equation 2 . | Author considers the circuit routing problem, where each net contains two nodes. The exact circuit routing problem is NP-hard in general, and author proposed to an approximate method. It uses several parameters to control the solution returned by a greedy search, i.e. the order of the nets to be routed and the greedy route selected by each net. At last, evolution strategy is deployed to find the best parameter that results in the most optimal greedy solution. Author evaluated the method on multiple grid environments, and shows that the method performs better in terms of both accuracy and scalability compared to other similar methods that uses learning to find a good solution. | SP:d72d696772354772231126f097a0cb17218625c2 |
Ranking Cost: One-Stage Circuit Routing by Directly Optimizing Global Objective Function | 1 INTRODUCTION . As described in Moore ’ s Law ( Schaller , 1997 ) , the number of transistors in a dense integrated circuit ( IC ) increases exponentially over time and the complexity of chips and printed circuit boards ( PCBs ) becomes higher and higher . Such high complexity makes the IC design a time-consuming and errorprone work . Thus more capable automatic design systems , such as electronic design automation ( EDA ) tools , are needed to improve the performance . In the flow of IC designs , we need to find proper paths to place wires which connect electronic components on ICs , and these wires need to achieve expected connectivity under certain constraints . One of the most important constraints is that wires on the same layout should not intersect . In addition , to reduce the signal propagation delay , the wire-length should be minimized . This is a critical and challenging stage in the IC design flow ( Hu & Sapatnekar , 2001 ) , known as circuit routing , which has been studied by lots of researchers ( Kramer , 1984 ; Zhang & Chu , 2012 ; He & Bao , 2020 ) . Circuit routing involves a large number of nets ( a net is a set of vertices with the same electrical property ) to be routed , which is computationally expensive and makes manual design extremely time-consuming ( Kong et al. , 2009 ; Coombs & Holden , 2001 ) . Even under the simplest setting , where only two pairs of pins need to be routed , it is an NP-complete problem ( Kramer , 1984 ) . Although lots of circuit routing algorithms have been proposed ( Zhang , 2016 ) , there still remain three major challenges : ( 1 ) Early solutions ( Hu & Sapatnekar , 2001 ) are typically designed with hard-coded heuristics , which suffer from problems of non-optimal solutions ( Zhang , 2016 ) and lack of flexibility over new design needs . Therefore , a more powerful routing method that does not depend on domain knowledge is highly desired . ( 2 ) To reduce the difficulty of complex routing problems , traditional routing algorithms often adopt a two-stage procedure — first global routing and then detailed routing ( Chen & Chang , 2009 ; Kahng et al. , 2011 ) . The problem is that these two stages do not always coordinate well ( Zhang & Chu , 2012 ; Shi & Davoodi , 2017 ) . Sometimes a low-congested global routing result may lead to downstream detailed router un-routable . Hence , an end-to-end algorithm is preferred which can optimize the final global objective ( e.g. , the total wire-length ) directly . ( 3 ) Although a few learning-based methods have been proposed ( Liao et al. , 2020 ; He & Bao , 2020 ) recently , their methods are hard to extend to large-scale applications . In real settings , there are lots of components and nets on a single chip , which shows greater demand for the scalability of routing algorithms . To relieve the problems mentioned above , we propose a new algorithm , denoted as Ranking Cost ( RC ) , for circuit routing . In this paper , we innovatively combine search-based methods ( i.e. , A * algorithm ) and learning-based methods ( i.e. , Evolution Strategies ( Salimans et al. , 2017 ) ) to form an trainable router with proper parametrization . Our method is flexible for integrating new constraints and rules so long as they can be merged into the global objective function . Moreover , our method is an one-stage algorithm , which optimizes the global objective function directly . In our method , we introduce a new set of variables called cost maps , which can help the A * routers to find out proper paths to achieve the global objective . We also train a ranking parameter , which can produce the ranking order and further improve the performance of our method . In the experiments , we compare our method with the commonly used A * method and a canonical reinforcement learning approach , and results show that our method outperforms these baselines with higher connectivity rates . Our ablation study also shows that trained cost maps can capture the global information and guide the routing solution to approach global optimal . Experiments also show that our method is scalable to larger applications . 2 RELATED WORK . In this section , we summarize the related work on circuit routing . 2.1 TWO-STAGE ROUTING ALGORITHMS . The routing problem can be heuristically separated into two stages , the first being the global routing step , followed by detailed routing . On the one hand , there are multiple heuristic-based approaches for global routing including regionwise routing ( Hu & Sapatnekar , 2001 ) , force-directed routing ( Mo et al. , 2001 ) , and rip-up and reroute ( Cho et al. , 2007 ) . On the other hand , the most commonly used detailed routing algorithms are channel routing and its variants ( Ho et al. , 1991 ; Mandal et al. , 2020 ) , which decompose the routing region into routing channels and generate wires in these channels ( Chen & Chang , 2009 ) . One main issue of the two-stage methods is that these two stages do not always coordinate well ( Shi & Davoodi , 2017 ) , which results in enormous difficulty in joint optimization . Instead , our method is an one-stage algorithm and new design constraints can be simply involved into the objective function without changing the algorithm itself . 2.2 SEQUENTIAL ROUTING ALGORITHMS . A more straightforward strategy for circuit routing is to select a specific order and then route nets sequentially , e.g. , sequential A * algorithm and Lees algorithm ( Huang et al. , 2014 ; Malavasi & Sangiovanni-Vincentelli , 1993 ) . The major advantage of this type of approaches is that the congestion information for previously routed nets can be taken into consideration while routing the current one . However , the drawback of these sequential approaches is that the quality of the solution is very sensitive to the orders ( Zhang , 2016 ) . Moreover , earlier routed paths only focus on finding their own best solutions and are impossible to take into account the situation of subsequent paths . Such greedy strategies may make a solvable circuit routing problem insolvable . Figure 1 shows an example that the sequential A * algorithm will fail to handle . In this example , there are two pairs of points to be routed , i.e. , we should connect start vertices Si and end vertices Ei , i ∈ { 1 , 2 } , respectively . If we connect the pair ( S1 , E1 ) first in its shortest path , it will make ( S2 , E2 ) disconnected as showed in Figure 1 ( d ) , and vice versa ( Figure 1 ( e ) ) . But this case can be solved easily by our algorithm as showed in Figure 1 ( f ) , which means that our algorithm can take into account the global information when generating each path . 2.3 LEARNING-BASED ALGORITHMS FOR CIRCUIT ROUTING . There are some learning-based algorithms for circuit routing ( Qi et al. , 2014 ; Liao et al. , 2020 ) . Early methods are more focusing on supervised learning , such as learning models to predict routing congestion ( Qi et al. , 2014 ) or predicting the routability ( Zhou et al. , 2015 ; Xie et al. , 2018 ) . But the performances of these supervised models are constrained by the limits of human knowledge . Recently , Liao et al . ( 2020 ) trained a deep Q-network ( DQN ) to solve the global routing problem and their method still suffers from the miscoupling problem of two-stage routing algorithms . In addition , He & Bao ( 2020 ) reform circuit routing to a tree search problem and utilize a deep neural network as the rollout policy . However , their rollout policy is trained in a supervised manner with artificial data . Instead , our method optimizes the global objective function directly and does not require any artificial data or human demonstration . 3 BACKGROUND AND NOTATIONS . In this section , we will formalize the circuit routing problem first and then give a brief introduction to the OpenAI-ES algorithm ( Salimans et al. , 2017 ) . 3.1 CIRCUIT ROUTING . Circuit routing is a path search problem , where the goal is to find non-intersecting paths that connect an arbitrary number of pairs of vertices . It can be formalized as a grid graph G = ( V , E ) , where each vertex vi ∈ V represents an intersection on the grid , and each edge eij ∈ E represents the path between vi and its 1-hop neighbors vj ∈ V . And the non-routable obstructive vertices form a obstacle set , denoted as O ⊂ V . In circuit routing , a net N = { vn1 , vn2 , ... } ⊂ V is a set of vertices that need to be connected and a multi-vertex net can be decomposed into multiple two-vertex nets via a minimum spanning tree ( MST ) or a rectilinear Steiner tree ( RST ) ( de Vincente et al. , 1998 ; Hu & Sapatnekar , 2001 ) . Following He & Bao ( 2020 ) , we simplify this problem by letting each net only contain two vertices , i.e , a two-vertex net is defined as N = { vs , ve } with a start vertex vs and an end vertex ve . The net should be connected by a path P = [ v1 , v2 , ... , vn ] with vs = v1 , ve = vn and P ∩ O = ∅ . We use |P | to represent the length of the path P . Given a set N of nets { Ni } , we need to find a set P of paths { Pi } that connect these nets . A reasonable routing plan for a given set of nets is that all the paths do not share any vertex . In some cases , the routing problem do not have a solution because such a non-intersecting set P does not exist . In circuit routing , the routed paths should satisfy some constraints or achieve some goals . In this paper , we choose the most commonly used goal , i.e. , minimize the total length of paths . Given a solution P , the total length of paths is defined as L = ∑ P∈P |P | . 3.2 EVOLUTION STRATEGIES . Evolution Strategies ( ES ) is a class of black box optimization methods ( Rechenberg , 1994 ; Hansen & Ostermeier , 2001 ) . Recently , an evolution strategy variant , referred as the OpenAI-ES ( Salimans et al. , 2017 ) , has attracted attention because it could rival the performance of modern deep reinforcement learning methods on multiple control tasks . In the OpenAI-ES , there is a reward function , denoted as F ( ψ ) , where ψ is a solution vector , which is sampled from a probability distribution function ψ ∼ pθ ( ψ ) . The goal is to maximize the expected value J ( θ ) , which is defined as : max θ J ( θ ) = max θ Eψ∼pθ [ F ( ψ ) ] = max θ ∫ F ( ψ ) pθ ( ψ ) dψ . ( 1 ) A straightforward way to achieve this is to use the gradient ascent : θ ← θ + α∇θJ ( θ ) , ( 2 ) where α is the learning rate . In the OpenAI-ES , a score function estimator is used to calculate the gradient , which is similar to REINFORCE ( Williams , 1992 ) : ∇θJ ( θ ) = ∇θEψ∼pθ [ F ( ψ ) ] = Eψ∼pθ [ F ( ψ ) ∇θ log pθ ( ψ ) ] . ( 3 ) Usually , pθ is an isotropic multivariate Gaussian with mean θ and fixed covariance σ2I . And the expected value can be rewritten as Eψ∼pθ [ F ( ψ ) ] = E ∼N ( 0 , I ) [ F ( θ+σ ) ] . Thus the gradient estimator changes to : ∇θJ ( θ ) = ∇θE ∼N ( 0 , I ) [ F ( θ + σ ) ] = 1 σ E ∼N ( 0 , I ) [ F ( θ + σ ) ] , ( 4 ) where is sampled from a standard normal distribution . Once we form an objective function J ( θ ) , the gradient ∇θJ ( θ ) can be approximated via Equation 4 and parameters θ can be updated via Equation 2 . | The paper considers the problem of determining efficient routes for connecting pairs of source, destination points over a circuit board. Due to physical constraints no two routes may intersect, and the routes may not pass through obstacles if there are any. For efficient performance it is desirable that the paths are as short as possible; as such the authors consider minimizing the sum length of all the paths as the objective. The paper proposes a ranking cost algorithm that combines A* search with an evolution optimization technique for learning efficient routes. Experimental evaluations show the proposed approach outperforming an RL based approach. | SP:d72d696772354772231126f097a0cb17218625c2 |
Teleport Graph Convolutional Networks | 1 INTRODUCTION . Graph neural networks ( GNNs ) have shown great capability in solving challenging tasks on graph data such as node classification ( Grover & Leskovec , 2016 ; Kipf & Welling , 2017 ; Veličković et al. , 2017 ; Gao et al. , 2018 ) , graph classification ( Xu et al. , 2018 ; Gao & Ji , 2019 ; You et al. , 2019 ) , and link prediction ( Zhang & Chen , 2018 ; Chen et al. , 2019 ; Zhou et al. , 2019 ) . Most graph convolutional networks are based on message-passing operations , in which each node aggregates information from its neighboring nodes . To enable a larger receptive field ( Chen et al. , 2016 ) , GNNs need to stack multiple layers , which is straightforward but can result in several issues . Firstly , stacking multiple layers involves massive trainable parameters , which consequently increases the risk of over-fitting . Secondly , message-passing operations mostly use averaging to combine the aggregated features , which significantly reduces the distinguishability of network embeddings . From this point , GNNs that are based on message-passing operations can not use deep network architecture due to these limitations . Some works such as Geom-GCN ( Pei et al. , 2020 ) try to solve these issues by involving more nodes in the feature aggregation process . However , Geom-GCN doesn ’ t consider the original graph topology information when generating the additional set of nodes for aggregation , which can neglect some relevant nodes from a structural perspective . To address the above limitations and increase the receptive field effectively , we propose a teleport graph convolution layer ( TeleGCL ) that uses teleport functions to select highly-relevant nodes at the global scope . A teleport function computes relevances between the center node and other nodes beyond the local neighborhood . The nodes with particular relevances are teleported for the center node . Here , the selection of teleported nodes is not restricted by the graph topology . This enables the center node to gather information from a larger neighborhood without going deep , which helps to avoid over-fitting and over-smoothing issues . In particular , we propose two teleport functions ; those are structure-aware and feature-aware teleport functions . They compute the nodes ’ relevances from graph structural perspective and node features perspective , respectively . Based on our TeleGCL , we build a family of teleport graph convolutional networks . The empirical results on graph and node classification tasks demonstrate the effectiveness of our proposed methods . 2 BACKGROUND AND RELATED WORK . In this section , we describe message-passing operations on graph data and geometric graph convolutional networks . Graph neural networks ( Fan et al. , 2019 ; Wu et al. , 2019 ; Morris et al. , 2019 ; Wu et al. , 2020 ) have achieved state-of-the-art performances on various challenging tasks in the field of network embedding . The mainstream of graph deep learning operations follows a message-passing schema . In a message-passing operation , each node sends its features , known as message , to its neighboring nodes in the graph . Then each node aggregates messages from its neighborhood and uses them to update its features . When combing the aggregated features , different strategies can be applied . In the graph convolution layer ( GCN ) ( Kipf & Welling , 2017 ) , features from neighboring nodes are given equal weights in the aggregation process . To assign different weights to different neighboring nodes , the graph attention network ( Veličković et al. , 2017 ) employs an attention mechanism to compute aggregation weights . Based on these message-passing operations , graph neural networks stack multiple layers , which enables a larger receptive field . Recently , some research works try to perform message passing beyond the local neighborhood . Pei et al . ( 2020 ) proposed to construct a continuous latent space that enables graph neural networks to perform feature learning in the latent space . To be specific , it first projects nodes ’ features to a 2-dimensional latent and continuous space . Based on the latent space , a structural neighborhood is constructed based on the Euclidean distance of each pair of nodes in the 2-dimensional space . In this process , the construction of structural features does not consider the graph connectivity information in the graph . Thus , the structural neighborhood in ( Pei et al. , 2020 ) is still built on node features without considering the graph topology . In this work , we propose a method to generate structure-aware features for each node . In particular , we use the graph connectivity and similarity information with the neighboring nodes and construct a feature vector for each node . By considering graph connectivity , our constructed structural features can reflect graph topology information . 3 TELEPORT GRAPH CONVOLUTIONAL NETWORKS . In this work , we propose the teleport graph convolution layer ( TeleGCL ) that enables a center node to aggregate information beyond regular neighborhood structure by using some teleport functions . To enable effective node teleportation , we propose two teleport functions from structure-aware and feature-aware perspectives . Specifically , we propose a novel method to construct structural features for nodes , which can be used by structure-aware functions to select relevant nodes . Based on our TeleGCL , we propose the teleport graph convolutional networks for network embedding learning . 3.1 LIMITATIONS OF MESSAGE-PASSING OPERATIONS . Currently , most graph convolution networks are based on message-passing operations . In a messagepassing operation , each node aggregates information from its neighboring nodes that usually are the one-hop neighborhood . Intuitively , it is beneficial to use information from a large neighborhood for network embedding learning . To enlarge the receptive field , a straight way is to stack multiple message-passing layers . A graph convolutional network with k layers enables nodes to receive information from a k-hop neighborhood . However , this method results in two issues . Firstly , it increases the risk of over-fitting by involving much more trainable parameters . The number of trainable parameters in the network increases when stacking multiple layers . Unlike regular convolutional neural networks , there is no effective graph pooling layer that can enlarge the receptive field without involving trainable parameters . Stacking many graph convolution layers will inevitably increase the risk of over-fitting . Secondly , stacking multiple layers will reduce the distinguishability of network embeddings , which is often referred to as the over-smoothing issue ( Pei et al. , 2020 ) . Due to the invariant property in graph structures , message-passing operations can not learn trainable weights in the aggregation process ( Kipf & Welling , 2017 ; Gao et al. , 2018 ) . Averaging operation is usually used for information aggregation from the neighborhood . Consequently , information from relevant distant nodes will be diluted and each node carries similar information . In this work , we propose a teleport graph convolution layer to address this issue . This layer enables each node to aggregate information from a set of relevant nodes that are not directly connected to the center node in the original graph structure . Teleport functions are used to determine the relevant nodes from different perspectives . 3.2 TELEPORT GRAPH CONVOLUTION LAYER . To address the limitations in message-passing operations , we propose the teleport graph convolution layer ( TeleGCL ) , which enables nodes to aggregate information beyond their local neighborhoods . In this layer , we employ multiple teleport functions to generate neighborhoods for each node . The teleport functions select some nodes that are relevant but not directly connected . Since these nodes are teleported from a global context , the receptive field of each node can be effectively enlarged . We require these functions to be permutation invariant such that the property retains in this layer . Given a graph G = ( V , E ) , where n = |V | , each node v ∈ V is associated with a feature vector xv ∈ Rd , and each edge ( u , v ) ∈ E connects node u and node v in the graph . X = [ x1 , x2 , . . . , xn ] ∈ Rd×n and A ∈ Rn×n are the feature matrix and adjacency matrix , respectively . A teleport function g ( v , G ) → N takes as input a node v and outputs a neighborhood N that includes a set of relevant nodes for node v ’ s feature aggregation . In Section 3.3 and Section 3.4 , we propose two teleport functions that can construct structure-aware and feature-aware neighborhoods . Suppose we have m teleport functions , node v aggregates information from a neighborhood N ( v ) = { Nl ( v ) , N1 ( v ) , N2 ( v ) , . . . , Nm ( v ) } , where Nl ( v ) = { u|u ∈ V , ( v , u ) ∈ E } is the local neighborhood and Ni ( v ) = gi ( v , G ) is a neighborhood created by the ith teleport function . Based on this neighborhood , the layer-wise propagation of TeleGCL ` for node v is formulated as x ( ` ) v = σ 1 |N ( v ) | ∑ u∈N ( v ) x ( ` −1 ) u , ( 1 ) where σ denotes an activation function such as ReLU ( Nair & Hinton , 2010 ) . By using teleport functions , a node can aggregate features beyond the local neighborhood , thereby leading to a larger receptive field . In Section 3.2 , we propose the teleport graph convolution layer that enables feature aggregation regardless of the original graph structure . A TeleGCL highly depends on teleport functions which select distant nodes in the feature aggregation process . In previous works ( Pei et al. , 2020 ) , teleport functions are mainly based on node features while neglecting the graph structural information . The graph topology information should be considered to include nodes that share the same structural patterns such as graph motifs ( Ren & Jin , 2020 ) . In this section , we propose two teleport functions ; those are structure-aware teleport function and feature-aware teleport function . They select teleport nodes based on graph topology and node features , respectively . 3.3 STRUCTURE-AWARE TELEPORT FUNCTION . Structure-aware teleport function focuses on selecting nodes based on the graph topology . In a graph , the nodes that share the same structural pattern contain related features . It is desirable for a node to aggregate information from these relevant nodes . A structure-aware function can be used to capture relevant nodes from a graph structural perspective . With a structure-aware function , the teleported nodes for node v are selected as : Ns ( v ) = { u|u ∈ V , ( v , u ) /∈ E , ts ( v , u ) > θ1 } , ( 2 ) where ts ( v , u ) is a structure-aware function that computes the relevance of two nodes from a structural perspective . Here , θ1 is used to determine if node u is relevant . In this work , we propose a novel structure-aware teleport function , which computes the relevance of two nodes by checking if they share the same structural pattern . Our proposed method is based on an intuition that the nodes with the same structural pattern have similar connections with their neighboring nodes . From this point , we create a structure feature vector for each node , which can reflect its structural pattern such as graph motifs . For each node , we first compute its similarity scores with its neighboring nodes . Then we rank these similarity scores and use them as the structural feature of this node . To be specific , the structural feature vector yv for node v is constructed as wv = X Txv , ∈Rn ( 3 ) idxv = rankk ( wv ◦A : ,v ) , ∈Rk ( 4 ) yv = wv ( idxv ) , ∈Rk ( 5 ) where ◦ denotes an element-wise vector multiplication , and A : ,v is the vth column of the adjacency matrix . rankk operator ranks the similarity scores and outputs the indices of the top-k values in wv . wv ( idxv ) returns a subset of rows in wv indexed by idxv . We first compute the similarity scores between node v and its neighboring nodes in Eq . ( 3 ) . Each element wu , v in wv measures the similarity between node u and node v. In Eq . ( 4 ) , we rank these similarity scores and select the k-largest values in wv . The indices of the selected values are stored in idxv . Using indices idxv , we extract a structural feature vector yv from wv . By repeating these operations on each node , we can obtain a structural feature matrix Y = [ y1 , y2 , . . . , yn ] ∈ Rk×n for all nodes in the graph . In this way , the structural feature vector is constructed from similarity scores between the center node and its neighboring nodes . These similarity scores encode its connectivity pattern with surrounding nodes , thereby reflecting the structural information in the graph . Based on structural features , we use dot product to compute the relevance of node u and node v : ts ( u , v ) = softmax ( yTu yv ) , which can measure relevance from the perspectives of both angle and magnitude in an efficient way . As illustrated in Eq . ( 2 ) , the teleport nodes can be selected based on our constructed structural features . | A new architecture for graph neural networks, which the authors name as Teleport Graph Convolutional Networks (TGL), is proposed in this paper. Teleport graph convolution layer is proposed to address the limitations in message-passing operations of graph neural networks: 1. over-smoothing and 2. over-fitting. The architecture enables nodes to aggregate information beyond their local neighborhoods. TGL operates as follows: 1) it first aggregates neighbors as in normal graph neural networks, 2) it selects some nodes that are relevant but not directly connected using 2a) feature similarity and 2b) similarity of structure. | SP:fc0f6a067f55acbf6b9ad8166ce128831a1829da |
Teleport Graph Convolutional Networks | 1 INTRODUCTION . Graph neural networks ( GNNs ) have shown great capability in solving challenging tasks on graph data such as node classification ( Grover & Leskovec , 2016 ; Kipf & Welling , 2017 ; Veličković et al. , 2017 ; Gao et al. , 2018 ) , graph classification ( Xu et al. , 2018 ; Gao & Ji , 2019 ; You et al. , 2019 ) , and link prediction ( Zhang & Chen , 2018 ; Chen et al. , 2019 ; Zhou et al. , 2019 ) . Most graph convolutional networks are based on message-passing operations , in which each node aggregates information from its neighboring nodes . To enable a larger receptive field ( Chen et al. , 2016 ) , GNNs need to stack multiple layers , which is straightforward but can result in several issues . Firstly , stacking multiple layers involves massive trainable parameters , which consequently increases the risk of over-fitting . Secondly , message-passing operations mostly use averaging to combine the aggregated features , which significantly reduces the distinguishability of network embeddings . From this point , GNNs that are based on message-passing operations can not use deep network architecture due to these limitations . Some works such as Geom-GCN ( Pei et al. , 2020 ) try to solve these issues by involving more nodes in the feature aggregation process . However , Geom-GCN doesn ’ t consider the original graph topology information when generating the additional set of nodes for aggregation , which can neglect some relevant nodes from a structural perspective . To address the above limitations and increase the receptive field effectively , we propose a teleport graph convolution layer ( TeleGCL ) that uses teleport functions to select highly-relevant nodes at the global scope . A teleport function computes relevances between the center node and other nodes beyond the local neighborhood . The nodes with particular relevances are teleported for the center node . Here , the selection of teleported nodes is not restricted by the graph topology . This enables the center node to gather information from a larger neighborhood without going deep , which helps to avoid over-fitting and over-smoothing issues . In particular , we propose two teleport functions ; those are structure-aware and feature-aware teleport functions . They compute the nodes ’ relevances from graph structural perspective and node features perspective , respectively . Based on our TeleGCL , we build a family of teleport graph convolutional networks . The empirical results on graph and node classification tasks demonstrate the effectiveness of our proposed methods . 2 BACKGROUND AND RELATED WORK . In this section , we describe message-passing operations on graph data and geometric graph convolutional networks . Graph neural networks ( Fan et al. , 2019 ; Wu et al. , 2019 ; Morris et al. , 2019 ; Wu et al. , 2020 ) have achieved state-of-the-art performances on various challenging tasks in the field of network embedding . The mainstream of graph deep learning operations follows a message-passing schema . In a message-passing operation , each node sends its features , known as message , to its neighboring nodes in the graph . Then each node aggregates messages from its neighborhood and uses them to update its features . When combing the aggregated features , different strategies can be applied . In the graph convolution layer ( GCN ) ( Kipf & Welling , 2017 ) , features from neighboring nodes are given equal weights in the aggregation process . To assign different weights to different neighboring nodes , the graph attention network ( Veličković et al. , 2017 ) employs an attention mechanism to compute aggregation weights . Based on these message-passing operations , graph neural networks stack multiple layers , which enables a larger receptive field . Recently , some research works try to perform message passing beyond the local neighborhood . Pei et al . ( 2020 ) proposed to construct a continuous latent space that enables graph neural networks to perform feature learning in the latent space . To be specific , it first projects nodes ’ features to a 2-dimensional latent and continuous space . Based on the latent space , a structural neighborhood is constructed based on the Euclidean distance of each pair of nodes in the 2-dimensional space . In this process , the construction of structural features does not consider the graph connectivity information in the graph . Thus , the structural neighborhood in ( Pei et al. , 2020 ) is still built on node features without considering the graph topology . In this work , we propose a method to generate structure-aware features for each node . In particular , we use the graph connectivity and similarity information with the neighboring nodes and construct a feature vector for each node . By considering graph connectivity , our constructed structural features can reflect graph topology information . 3 TELEPORT GRAPH CONVOLUTIONAL NETWORKS . In this work , we propose the teleport graph convolution layer ( TeleGCL ) that enables a center node to aggregate information beyond regular neighborhood structure by using some teleport functions . To enable effective node teleportation , we propose two teleport functions from structure-aware and feature-aware perspectives . Specifically , we propose a novel method to construct structural features for nodes , which can be used by structure-aware functions to select relevant nodes . Based on our TeleGCL , we propose the teleport graph convolutional networks for network embedding learning . 3.1 LIMITATIONS OF MESSAGE-PASSING OPERATIONS . Currently , most graph convolution networks are based on message-passing operations . In a messagepassing operation , each node aggregates information from its neighboring nodes that usually are the one-hop neighborhood . Intuitively , it is beneficial to use information from a large neighborhood for network embedding learning . To enlarge the receptive field , a straight way is to stack multiple message-passing layers . A graph convolutional network with k layers enables nodes to receive information from a k-hop neighborhood . However , this method results in two issues . Firstly , it increases the risk of over-fitting by involving much more trainable parameters . The number of trainable parameters in the network increases when stacking multiple layers . Unlike regular convolutional neural networks , there is no effective graph pooling layer that can enlarge the receptive field without involving trainable parameters . Stacking many graph convolution layers will inevitably increase the risk of over-fitting . Secondly , stacking multiple layers will reduce the distinguishability of network embeddings , which is often referred to as the over-smoothing issue ( Pei et al. , 2020 ) . Due to the invariant property in graph structures , message-passing operations can not learn trainable weights in the aggregation process ( Kipf & Welling , 2017 ; Gao et al. , 2018 ) . Averaging operation is usually used for information aggregation from the neighborhood . Consequently , information from relevant distant nodes will be diluted and each node carries similar information . In this work , we propose a teleport graph convolution layer to address this issue . This layer enables each node to aggregate information from a set of relevant nodes that are not directly connected to the center node in the original graph structure . Teleport functions are used to determine the relevant nodes from different perspectives . 3.2 TELEPORT GRAPH CONVOLUTION LAYER . To address the limitations in message-passing operations , we propose the teleport graph convolution layer ( TeleGCL ) , which enables nodes to aggregate information beyond their local neighborhoods . In this layer , we employ multiple teleport functions to generate neighborhoods for each node . The teleport functions select some nodes that are relevant but not directly connected . Since these nodes are teleported from a global context , the receptive field of each node can be effectively enlarged . We require these functions to be permutation invariant such that the property retains in this layer . Given a graph G = ( V , E ) , where n = |V | , each node v ∈ V is associated with a feature vector xv ∈ Rd , and each edge ( u , v ) ∈ E connects node u and node v in the graph . X = [ x1 , x2 , . . . , xn ] ∈ Rd×n and A ∈ Rn×n are the feature matrix and adjacency matrix , respectively . A teleport function g ( v , G ) → N takes as input a node v and outputs a neighborhood N that includes a set of relevant nodes for node v ’ s feature aggregation . In Section 3.3 and Section 3.4 , we propose two teleport functions that can construct structure-aware and feature-aware neighborhoods . Suppose we have m teleport functions , node v aggregates information from a neighborhood N ( v ) = { Nl ( v ) , N1 ( v ) , N2 ( v ) , . . . , Nm ( v ) } , where Nl ( v ) = { u|u ∈ V , ( v , u ) ∈ E } is the local neighborhood and Ni ( v ) = gi ( v , G ) is a neighborhood created by the ith teleport function . Based on this neighborhood , the layer-wise propagation of TeleGCL ` for node v is formulated as x ( ` ) v = σ 1 |N ( v ) | ∑ u∈N ( v ) x ( ` −1 ) u , ( 1 ) where σ denotes an activation function such as ReLU ( Nair & Hinton , 2010 ) . By using teleport functions , a node can aggregate features beyond the local neighborhood , thereby leading to a larger receptive field . In Section 3.2 , we propose the teleport graph convolution layer that enables feature aggregation regardless of the original graph structure . A TeleGCL highly depends on teleport functions which select distant nodes in the feature aggregation process . In previous works ( Pei et al. , 2020 ) , teleport functions are mainly based on node features while neglecting the graph structural information . The graph topology information should be considered to include nodes that share the same structural patterns such as graph motifs ( Ren & Jin , 2020 ) . In this section , we propose two teleport functions ; those are structure-aware teleport function and feature-aware teleport function . They select teleport nodes based on graph topology and node features , respectively . 3.3 STRUCTURE-AWARE TELEPORT FUNCTION . Structure-aware teleport function focuses on selecting nodes based on the graph topology . In a graph , the nodes that share the same structural pattern contain related features . It is desirable for a node to aggregate information from these relevant nodes . A structure-aware function can be used to capture relevant nodes from a graph structural perspective . With a structure-aware function , the teleported nodes for node v are selected as : Ns ( v ) = { u|u ∈ V , ( v , u ) /∈ E , ts ( v , u ) > θ1 } , ( 2 ) where ts ( v , u ) is a structure-aware function that computes the relevance of two nodes from a structural perspective . Here , θ1 is used to determine if node u is relevant . In this work , we propose a novel structure-aware teleport function , which computes the relevance of two nodes by checking if they share the same structural pattern . Our proposed method is based on an intuition that the nodes with the same structural pattern have similar connections with their neighboring nodes . From this point , we create a structure feature vector for each node , which can reflect its structural pattern such as graph motifs . For each node , we first compute its similarity scores with its neighboring nodes . Then we rank these similarity scores and use them as the structural feature of this node . To be specific , the structural feature vector yv for node v is constructed as wv = X Txv , ∈Rn ( 3 ) idxv = rankk ( wv ◦A : ,v ) , ∈Rk ( 4 ) yv = wv ( idxv ) , ∈Rk ( 5 ) where ◦ denotes an element-wise vector multiplication , and A : ,v is the vth column of the adjacency matrix . rankk operator ranks the similarity scores and outputs the indices of the top-k values in wv . wv ( idxv ) returns a subset of rows in wv indexed by idxv . We first compute the similarity scores between node v and its neighboring nodes in Eq . ( 3 ) . Each element wu , v in wv measures the similarity between node u and node v. In Eq . ( 4 ) , we rank these similarity scores and select the k-largest values in wv . The indices of the selected values are stored in idxv . Using indices idxv , we extract a structural feature vector yv from wv . By repeating these operations on each node , we can obtain a structural feature matrix Y = [ y1 , y2 , . . . , yn ] ∈ Rk×n for all nodes in the graph . In this way , the structural feature vector is constructed from similarity scores between the center node and its neighboring nodes . These similarity scores encode its connectivity pattern with surrounding nodes , thereby reflecting the structural information in the graph . Based on structural features , we use dot product to compute the relevance of node u and node v : ts ( u , v ) = softmax ( yTu yv ) , which can measure relevance from the perspectives of both angle and magnitude in an efficient way . As illustrated in Eq . ( 2 ) , the teleport nodes can be selected based on our constructed structural features . | The paper proposes a method to increase the receptive field of GNNs, while avoiding oversmoothing. The idea is to create extra connections by linking distant nodes based on two criteria: node feature similarity and node structure similarity. Pairs of nodes that are more similar than a threshold are connected. For structure-aware linking (teleport) a descriptor of the local structure is constructed for each node, by stacking the similarity scores to the most similar k neighbours. Computing the dot product between descriptors, gives a similarity measure of the local structure of each node. For feature-aware linking the features dot product is directly used as a measure. Experiments show that both types of teleport functions are helpful. | SP:fc0f6a067f55acbf6b9ad8166ce128831a1829da |
Teleport Graph Convolutional Networks | 1 INTRODUCTION . Graph neural networks ( GNNs ) have shown great capability in solving challenging tasks on graph data such as node classification ( Grover & Leskovec , 2016 ; Kipf & Welling , 2017 ; Veličković et al. , 2017 ; Gao et al. , 2018 ) , graph classification ( Xu et al. , 2018 ; Gao & Ji , 2019 ; You et al. , 2019 ) , and link prediction ( Zhang & Chen , 2018 ; Chen et al. , 2019 ; Zhou et al. , 2019 ) . Most graph convolutional networks are based on message-passing operations , in which each node aggregates information from its neighboring nodes . To enable a larger receptive field ( Chen et al. , 2016 ) , GNNs need to stack multiple layers , which is straightforward but can result in several issues . Firstly , stacking multiple layers involves massive trainable parameters , which consequently increases the risk of over-fitting . Secondly , message-passing operations mostly use averaging to combine the aggregated features , which significantly reduces the distinguishability of network embeddings . From this point , GNNs that are based on message-passing operations can not use deep network architecture due to these limitations . Some works such as Geom-GCN ( Pei et al. , 2020 ) try to solve these issues by involving more nodes in the feature aggregation process . However , Geom-GCN doesn ’ t consider the original graph topology information when generating the additional set of nodes for aggregation , which can neglect some relevant nodes from a structural perspective . To address the above limitations and increase the receptive field effectively , we propose a teleport graph convolution layer ( TeleGCL ) that uses teleport functions to select highly-relevant nodes at the global scope . A teleport function computes relevances between the center node and other nodes beyond the local neighborhood . The nodes with particular relevances are teleported for the center node . Here , the selection of teleported nodes is not restricted by the graph topology . This enables the center node to gather information from a larger neighborhood without going deep , which helps to avoid over-fitting and over-smoothing issues . In particular , we propose two teleport functions ; those are structure-aware and feature-aware teleport functions . They compute the nodes ’ relevances from graph structural perspective and node features perspective , respectively . Based on our TeleGCL , we build a family of teleport graph convolutional networks . The empirical results on graph and node classification tasks demonstrate the effectiveness of our proposed methods . 2 BACKGROUND AND RELATED WORK . In this section , we describe message-passing operations on graph data and geometric graph convolutional networks . Graph neural networks ( Fan et al. , 2019 ; Wu et al. , 2019 ; Morris et al. , 2019 ; Wu et al. , 2020 ) have achieved state-of-the-art performances on various challenging tasks in the field of network embedding . The mainstream of graph deep learning operations follows a message-passing schema . In a message-passing operation , each node sends its features , known as message , to its neighboring nodes in the graph . Then each node aggregates messages from its neighborhood and uses them to update its features . When combing the aggregated features , different strategies can be applied . In the graph convolution layer ( GCN ) ( Kipf & Welling , 2017 ) , features from neighboring nodes are given equal weights in the aggregation process . To assign different weights to different neighboring nodes , the graph attention network ( Veličković et al. , 2017 ) employs an attention mechanism to compute aggregation weights . Based on these message-passing operations , graph neural networks stack multiple layers , which enables a larger receptive field . Recently , some research works try to perform message passing beyond the local neighborhood . Pei et al . ( 2020 ) proposed to construct a continuous latent space that enables graph neural networks to perform feature learning in the latent space . To be specific , it first projects nodes ’ features to a 2-dimensional latent and continuous space . Based on the latent space , a structural neighborhood is constructed based on the Euclidean distance of each pair of nodes in the 2-dimensional space . In this process , the construction of structural features does not consider the graph connectivity information in the graph . Thus , the structural neighborhood in ( Pei et al. , 2020 ) is still built on node features without considering the graph topology . In this work , we propose a method to generate structure-aware features for each node . In particular , we use the graph connectivity and similarity information with the neighboring nodes and construct a feature vector for each node . By considering graph connectivity , our constructed structural features can reflect graph topology information . 3 TELEPORT GRAPH CONVOLUTIONAL NETWORKS . In this work , we propose the teleport graph convolution layer ( TeleGCL ) that enables a center node to aggregate information beyond regular neighborhood structure by using some teleport functions . To enable effective node teleportation , we propose two teleport functions from structure-aware and feature-aware perspectives . Specifically , we propose a novel method to construct structural features for nodes , which can be used by structure-aware functions to select relevant nodes . Based on our TeleGCL , we propose the teleport graph convolutional networks for network embedding learning . 3.1 LIMITATIONS OF MESSAGE-PASSING OPERATIONS . Currently , most graph convolution networks are based on message-passing operations . In a messagepassing operation , each node aggregates information from its neighboring nodes that usually are the one-hop neighborhood . Intuitively , it is beneficial to use information from a large neighborhood for network embedding learning . To enlarge the receptive field , a straight way is to stack multiple message-passing layers . A graph convolutional network with k layers enables nodes to receive information from a k-hop neighborhood . However , this method results in two issues . Firstly , it increases the risk of over-fitting by involving much more trainable parameters . The number of trainable parameters in the network increases when stacking multiple layers . Unlike regular convolutional neural networks , there is no effective graph pooling layer that can enlarge the receptive field without involving trainable parameters . Stacking many graph convolution layers will inevitably increase the risk of over-fitting . Secondly , stacking multiple layers will reduce the distinguishability of network embeddings , which is often referred to as the over-smoothing issue ( Pei et al. , 2020 ) . Due to the invariant property in graph structures , message-passing operations can not learn trainable weights in the aggregation process ( Kipf & Welling , 2017 ; Gao et al. , 2018 ) . Averaging operation is usually used for information aggregation from the neighborhood . Consequently , information from relevant distant nodes will be diluted and each node carries similar information . In this work , we propose a teleport graph convolution layer to address this issue . This layer enables each node to aggregate information from a set of relevant nodes that are not directly connected to the center node in the original graph structure . Teleport functions are used to determine the relevant nodes from different perspectives . 3.2 TELEPORT GRAPH CONVOLUTION LAYER . To address the limitations in message-passing operations , we propose the teleport graph convolution layer ( TeleGCL ) , which enables nodes to aggregate information beyond their local neighborhoods . In this layer , we employ multiple teleport functions to generate neighborhoods for each node . The teleport functions select some nodes that are relevant but not directly connected . Since these nodes are teleported from a global context , the receptive field of each node can be effectively enlarged . We require these functions to be permutation invariant such that the property retains in this layer . Given a graph G = ( V , E ) , where n = |V | , each node v ∈ V is associated with a feature vector xv ∈ Rd , and each edge ( u , v ) ∈ E connects node u and node v in the graph . X = [ x1 , x2 , . . . , xn ] ∈ Rd×n and A ∈ Rn×n are the feature matrix and adjacency matrix , respectively . A teleport function g ( v , G ) → N takes as input a node v and outputs a neighborhood N that includes a set of relevant nodes for node v ’ s feature aggregation . In Section 3.3 and Section 3.4 , we propose two teleport functions that can construct structure-aware and feature-aware neighborhoods . Suppose we have m teleport functions , node v aggregates information from a neighborhood N ( v ) = { Nl ( v ) , N1 ( v ) , N2 ( v ) , . . . , Nm ( v ) } , where Nl ( v ) = { u|u ∈ V , ( v , u ) ∈ E } is the local neighborhood and Ni ( v ) = gi ( v , G ) is a neighborhood created by the ith teleport function . Based on this neighborhood , the layer-wise propagation of TeleGCL ` for node v is formulated as x ( ` ) v = σ 1 |N ( v ) | ∑ u∈N ( v ) x ( ` −1 ) u , ( 1 ) where σ denotes an activation function such as ReLU ( Nair & Hinton , 2010 ) . By using teleport functions , a node can aggregate features beyond the local neighborhood , thereby leading to a larger receptive field . In Section 3.2 , we propose the teleport graph convolution layer that enables feature aggregation regardless of the original graph structure . A TeleGCL highly depends on teleport functions which select distant nodes in the feature aggregation process . In previous works ( Pei et al. , 2020 ) , teleport functions are mainly based on node features while neglecting the graph structural information . The graph topology information should be considered to include nodes that share the same structural patterns such as graph motifs ( Ren & Jin , 2020 ) . In this section , we propose two teleport functions ; those are structure-aware teleport function and feature-aware teleport function . They select teleport nodes based on graph topology and node features , respectively . 3.3 STRUCTURE-AWARE TELEPORT FUNCTION . Structure-aware teleport function focuses on selecting nodes based on the graph topology . In a graph , the nodes that share the same structural pattern contain related features . It is desirable for a node to aggregate information from these relevant nodes . A structure-aware function can be used to capture relevant nodes from a graph structural perspective . With a structure-aware function , the teleported nodes for node v are selected as : Ns ( v ) = { u|u ∈ V , ( v , u ) /∈ E , ts ( v , u ) > θ1 } , ( 2 ) where ts ( v , u ) is a structure-aware function that computes the relevance of two nodes from a structural perspective . Here , θ1 is used to determine if node u is relevant . In this work , we propose a novel structure-aware teleport function , which computes the relevance of two nodes by checking if they share the same structural pattern . Our proposed method is based on an intuition that the nodes with the same structural pattern have similar connections with their neighboring nodes . From this point , we create a structure feature vector for each node , which can reflect its structural pattern such as graph motifs . For each node , we first compute its similarity scores with its neighboring nodes . Then we rank these similarity scores and use them as the structural feature of this node . To be specific , the structural feature vector yv for node v is constructed as wv = X Txv , ∈Rn ( 3 ) idxv = rankk ( wv ◦A : ,v ) , ∈Rk ( 4 ) yv = wv ( idxv ) , ∈Rk ( 5 ) where ◦ denotes an element-wise vector multiplication , and A : ,v is the vth column of the adjacency matrix . rankk operator ranks the similarity scores and outputs the indices of the top-k values in wv . wv ( idxv ) returns a subset of rows in wv indexed by idxv . We first compute the similarity scores between node v and its neighboring nodes in Eq . ( 3 ) . Each element wu , v in wv measures the similarity between node u and node v. In Eq . ( 4 ) , we rank these similarity scores and select the k-largest values in wv . The indices of the selected values are stored in idxv . Using indices idxv , we extract a structural feature vector yv from wv . By repeating these operations on each node , we can obtain a structural feature matrix Y = [ y1 , y2 , . . . , yn ] ∈ Rk×n for all nodes in the graph . In this way , the structural feature vector is constructed from similarity scores between the center node and its neighboring nodes . These similarity scores encode its connectivity pattern with surrounding nodes , thereby reflecting the structural information in the graph . Based on structural features , we use dot product to compute the relevance of node u and node v : ts ( u , v ) = softmax ( yTu yv ) , which can measure relevance from the perspectives of both angle and magnitude in an efficient way . As illustrated in Eq . ( 2 ) , the teleport nodes can be selected based on our constructed structural features . | This paper analyzed the key issues of the existing message-passing graph convolutional networks. That is, the multiply stacked layer might be over-fitting and over-smoothing. Thus it proposed to choose the neighbors from the entire graph based on the structure-aware and feature-aware relatedness rather than simply choosing the local neighborhood. However, the motivations of the proposed structure-aware and feature-aware teleport functions are not very convincing, and Table 3 shows that the performance improvement of TeleGCN might largely be induced by model architecture rather than the proposed TeleGCL. | SP:fc0f6a067f55acbf6b9ad8166ce128831a1829da |
Learning to Noise: Application-Agnostic Data Sharing with Local Differential Privacy | 1 INTRODUCTION . The collection of personal data is ubiquitous , and unavoidable for many in everyday life . While this has undeniably improved the quality and user experience of many products and services , evidence of data misuse and data breaches ( Sweeney , 1997 ; Jolly , 2020 ) have brought the concept of data privacy into sharp focus , fueling both regulatory changes as well as a shift in personal preferences . The onus has now fallen on organizations to determine if they are willing and able to collect personal data under these changing expectations . There is thus a growing need to collect data in a privacypreserving manner , that can still be used to improve products and services . Often coined the ‘ gold standard ’ of privacy guarantees , central differential privacy ( CDP ) ( Dwork & Roth , 2014 ) protects against an adversary determining the presence of a user in a dataset . It provides a quantifiable definition , is robust to post-processing , and allows for the protection of groups of people via its composability property ( Dwork et al. , 2006 ; Dwork & Roth , 2014 ) . The CDP framework relies on the addition of noise to the output of statistical queries on a dataset , in such a way that the same information can be extracted from that dataset whether or not any given individual is present . One can train machine learning models such that the model is CDP with respect to the training set by using training methods such as DP-SGD ( Abadi et al. , 2016 ) , DP-Adam ( Gylberth et al. , 2017 ) or PATE ( Papernot et al. , 2017 ) . Given access to a clean labelled dataset , one could train , for example , a CDP classifier this way . Similarly , one could ‘ share ’ data privately by training a generative model , such as a variational autoencoder ( VAE ) or generative adversarial network ( GAN ) , with a CDP training method , and then construct a synthetic dataset satisfying CDP with respect to the training set by generating samples from this model ( Xie et al. , 2018 ; Triastcyn & Faltings , 2019 ; Acs et al. , 2019 ; Takagi et al. , 2021 ) . While some of these approaches require only an unlabelled training set , their applications are limited in that they generate only synthetic samples that are likely under the original training set distribution . Firstly , changes in the data distribution warrant the re-training of the generative model . Secondly , the synthetic points are only representative samples , and so we lack any information about the features of given individuals . Clearly , this limits the range of applications : the model can not be used to join private and clean datasets , for applications in which we expect a distributional shift , or for privately collecting new data . Furthermore , CDP also requires a trustworthy database administrator . Federated learning ( McMahan et al. , 2017 ; Agarwal et al. , 2018 ; Rodrı́guez-Barroso et al. , 2020 ) is a related technique in which a model can be trained privately , without placing trust in a database administrator . The model is trained across multiple decentralized devices , omitting the need to share data with a central server . Unfortunately , by construction , federated learning does not allow for any data to be privately shared or collected , and is only concerned with the privacy of the model . An approach that allows data collection , while protecting the privacy of an individual against even the database administrator , is to construct a mechanism that privatizes the features of a given individual locally , before collection . Warner ( 1965 ) developed a mechanism , known as randomized response , to preserve the privacy of survey respondents : when answering a sensitive ( binary ) question , the respondent is granted plausible deniability by giving a truthful answer if a fair coin flip returns heads , and answering yes otherwise . Recent work has further developed this idea , often referred to as local differential privacy ( LDP ) ( Kasiviswanathan et al. , 2008 ; Duchi et al. , 2013 ) . LDP provides a mathematically-provable privacy guarantee for members of a database against both adversaries and database administrators . Many existing LDP mechanism focus on the collection of low-dimensional data like summary statistics , or on mechanisms which do not easily generalize to different data types . Erlingsson et al . ( 2014 ) , Ding et al . ( 2017 ) and Tang et al . ( 2017 ) introduce methods for collecting such data repeatedly over time . Erlingsson et al . ( 2014 ) find that for one time collection , directly noising data ( after hashing to a bloom filter ) is their best approach for inducing privacy . Ren et al . ( 2018 ) extend this bloom filter based approach , and attempt to estimate the clean distribution of their LDP data in order to generate a LDP synthetic dataset , though we note that the range of applications is limited , as with CDP synthetic generation above . In this paper , we adapt well-established techniques from representation learning to address the fundamental limitation of LDP in the context of high-dimensional data : datapoints in high dimensional space require prohibitive levels of noise to locally privatize ( the privacy budget , , naively scales linearly with the dimensionality ) . To motivate our approach , consider the fact that it is often a good approximation to assume that a given high-dimensional dataset lives on a much lower dimensional manifold . Applying a general privatization mechanism to low-dimensional representations should thus enable us to learn how to add noise to the high-dimensional data efficiently and applicationagnostically . Our approach is inspired by the VAE ( Kingma & Welling , 2014 ; Rezende et al. , 2014 ) ; we demonstrate that sampling in latent space is equivalent to passing a datapoint through an LDP Laplace mechanism . Furthermore , reconstructing a datapoint is equivalent to adding a complex noise distribution to the raw features , thereby inducing LDP . Our randomized algorithm , which we refer to as the variational Laplace mechanism ( VLM ) , satisfies the strict guarantees of LDP , and is agnostic to both data type and downstream task . We demonstrate that we can use the data privatized with our mechanism to train downstream machine learning models that act on both clean and privatized data at inference time . Furthermore , we demonstrate multiple concrete applications of our model : we privately collect data from individuals for downstream model training ; we use a transfer-learning-inspired approach to privately collect data of an unseen class type upon which we train a classifier ; and we augment a clean dataset with additional privatized features to improve the accuracy of a classifier on the combined data . None of these applications can be solved with CDP , and we find significant performance gains over the naive approach of directly noising the data . 2 BASIC DEFINITIONS AND NOTATION . To formalize the concept of differential privacy , we first introduce some definitions and notation . Definition ( ( , δ ) -central differential privacy ) : Let A : D → Z be a randomized algorithm , that takes as input datasets from the dataset domain D. We sayA is ( , δ ) -central differentially private if for , δ ≥ 0 , for all subsets S ⊆ Z , and for all neighboring datasets D , D′ ∈ D , we have p ( A ( D ) ∈ S ) ≤ exp ( ) p ( A ( D′ ) ∈ S ) + δ ( 1 ) where for D and D′ to be neighboring means that they are identical in all but one datapoint . Intuitively , this states that one can not tell ( with a level of certainty determined by ( , δ ) ) whether an individual is present in a database or not . When δ = 0 we say A satisfies -CDP . Definition ( ` 1 sensitivity ) : The ` 1 sensitivity of a function f : D → Rk is defined as ∆f = max adjacent ( D , D′ ) ||f ( D ) − f ( D′ ) ||1 ( 2 ) where adjacent ( D , D′ ) implies D , D′ ∈ D are neighboring datasets . Definition ( Laplace mechanism ) : The Laplace mechanismM ( central ) : D → Rk is a randomized algorithm defined as M ( central ) ( D , f ( · ) , ) = f ( D ) + ( s1 , . . . , sk ) ( 3 ) for D ∈ D , si ∼ Laplace ( 0 , ∆f/ ) , and some transformation function f : D → Rk . The Laplace mechanism induces -CDP ; see Dwork & Roth ( 2014 ) for proof . While CDP relies on a trusted database administrator , LDP provides a much stricter guarantee in which the individual does not need to trust an administrator . Instead individuals are able to privatize their data before sending it using a local randomized algorithm . Definition ( ( , δ ) -local differential privacy ) : A local randomized algorithmA : X → Z , that takes as input a datapoint from the data domain X , satisfies ( , δ ) -local differential privacy if for , δ ≥ 0 , for all S ⊆ Z , and for any inputs x , x′ ∈ X , p ( A ( x ) ∈ S ) ≤ exp ( ) p ( A ( x′ ) ∈ S ) + δ ( 4 ) When δ = 0 we say A satisfies -LDP . Definition ( Local Laplace mechanism ) : The local Laplace mechanism M ( local ) : X → Rk is a randomized algorithm defined as M ( local ) ( x , f ( · ) , ) = f ( x ) + ( s1 , . . . , sk ) ( 5 ) for x ∈ X , si ∼ Laplace ( 0 , ∆f/ ) , and some transformation function f : X → Z , where Z ⊆ Rk and the ` 1 sensitivity of f ( · ) is defined as ∆f = maxx , x′∈X ||f ( x ) − f ( x′ ) ||1 . The local Laplace mechanism satisfies -LDP ( see Appendix A for proof ) . Another common choice of mechanism for privatizing continuous data is the Gaussian mechanism , which satisfies ( , δ > 0 ) -LDP . For the remainder of the paper however , we exclusively study the local Laplace mechanism since it provides a strong privacy guarantee ( i.e . δ = 0 ) . We note that our approach could be used to learn a Gaussian mechanism with minimal modification . 3 PROPOSED METHOD . Early work on data collection algorithms , such as randomized response , have relied on very simple randomized algorithms to induce privacy . Throughout this paper we have benchmarked our results against such a mechanism , in which we add Laplace noise to all continuous features , and flip each of the categorical features with some probability . By the composition theorem ( Dwork & Roth , 2014 ) , each feature then contributes towards the overall LDP guarantee of the d-dimensional datapoint as = ∑d i=1 i . Since we have no prior knowledge about which features are most important , we choose the Laplace noise level ( or flip probability ) for each feature to be such that i = /d . See Appendix E.2 for further details . As with our approach , this benchmark mechanism can act on any date type , and forms a downstream task agnostic LDP version of the data . As d increases , i decreases for each feature i . The noise required to induce -LDP thus grows with data dimensionality . For high-dimensional datasets like images or large tables , features are often highly correlated ; consequently , noising features independently is wasteful towards privatizing the information content in each datapoint . A more effective approach to privatization involves noising a learned lower-dimensional representation of each datapoint using a generic noising mechanism . To this end , we use a VAE-based approach to learn a low-dimensional latent representation of our data . This learned mapping from data space to latent space forms our function f ( · ) in Equation 5 , and requires only a small unlabelled dataset from a similar distribution , which most organizations will typically already have access to , either internally or publicly . Applying the Laplace mechanism ( as described in Section 3.1 ) thus ensures the encoded latents , as well as reconstructed datapoints , satisfy LDP . We can therefore privatize data at the latent level or the original-feature level ; preference between these two options is application specific , and we investigate both experimentally . Data owners can apply this learned LDP mechanism to their data before sharing , and the database administrator forms an LDP data set from the collected data . This set , along with information on the type of noise added , is used to train downstream machine learning algorithms . Though our privatization method is task agnostic , in this paper we focus on classification tasks in which we have some features x for which we want to predict the corresponding label y . At inference time , we show that this classifier can act on either clean or privatized datapoints , depending on the application . | This paper presents a new privatization mechanism for Local Differential Privacy based on representation learning. The proposed VAE-based method is used for the low-dimensional latent representation of the data and uses the Laplace mechanism to satisfy Local DP. The paper shows this mechanism can be used across various applications such as private data collection, private novel-class classification, data joining, etc. | SP:bf68937b0e23da990383e48608af226ad5f250cf |
Learning to Noise: Application-Agnostic Data Sharing with Local Differential Privacy | 1 INTRODUCTION . The collection of personal data is ubiquitous , and unavoidable for many in everyday life . While this has undeniably improved the quality and user experience of many products and services , evidence of data misuse and data breaches ( Sweeney , 1997 ; Jolly , 2020 ) have brought the concept of data privacy into sharp focus , fueling both regulatory changes as well as a shift in personal preferences . The onus has now fallen on organizations to determine if they are willing and able to collect personal data under these changing expectations . There is thus a growing need to collect data in a privacypreserving manner , that can still be used to improve products and services . Often coined the ‘ gold standard ’ of privacy guarantees , central differential privacy ( CDP ) ( Dwork & Roth , 2014 ) protects against an adversary determining the presence of a user in a dataset . It provides a quantifiable definition , is robust to post-processing , and allows for the protection of groups of people via its composability property ( Dwork et al. , 2006 ; Dwork & Roth , 2014 ) . The CDP framework relies on the addition of noise to the output of statistical queries on a dataset , in such a way that the same information can be extracted from that dataset whether or not any given individual is present . One can train machine learning models such that the model is CDP with respect to the training set by using training methods such as DP-SGD ( Abadi et al. , 2016 ) , DP-Adam ( Gylberth et al. , 2017 ) or PATE ( Papernot et al. , 2017 ) . Given access to a clean labelled dataset , one could train , for example , a CDP classifier this way . Similarly , one could ‘ share ’ data privately by training a generative model , such as a variational autoencoder ( VAE ) or generative adversarial network ( GAN ) , with a CDP training method , and then construct a synthetic dataset satisfying CDP with respect to the training set by generating samples from this model ( Xie et al. , 2018 ; Triastcyn & Faltings , 2019 ; Acs et al. , 2019 ; Takagi et al. , 2021 ) . While some of these approaches require only an unlabelled training set , their applications are limited in that they generate only synthetic samples that are likely under the original training set distribution . Firstly , changes in the data distribution warrant the re-training of the generative model . Secondly , the synthetic points are only representative samples , and so we lack any information about the features of given individuals . Clearly , this limits the range of applications : the model can not be used to join private and clean datasets , for applications in which we expect a distributional shift , or for privately collecting new data . Furthermore , CDP also requires a trustworthy database administrator . Federated learning ( McMahan et al. , 2017 ; Agarwal et al. , 2018 ; Rodrı́guez-Barroso et al. , 2020 ) is a related technique in which a model can be trained privately , without placing trust in a database administrator . The model is trained across multiple decentralized devices , omitting the need to share data with a central server . Unfortunately , by construction , federated learning does not allow for any data to be privately shared or collected , and is only concerned with the privacy of the model . An approach that allows data collection , while protecting the privacy of an individual against even the database administrator , is to construct a mechanism that privatizes the features of a given individual locally , before collection . Warner ( 1965 ) developed a mechanism , known as randomized response , to preserve the privacy of survey respondents : when answering a sensitive ( binary ) question , the respondent is granted plausible deniability by giving a truthful answer if a fair coin flip returns heads , and answering yes otherwise . Recent work has further developed this idea , often referred to as local differential privacy ( LDP ) ( Kasiviswanathan et al. , 2008 ; Duchi et al. , 2013 ) . LDP provides a mathematically-provable privacy guarantee for members of a database against both adversaries and database administrators . Many existing LDP mechanism focus on the collection of low-dimensional data like summary statistics , or on mechanisms which do not easily generalize to different data types . Erlingsson et al . ( 2014 ) , Ding et al . ( 2017 ) and Tang et al . ( 2017 ) introduce methods for collecting such data repeatedly over time . Erlingsson et al . ( 2014 ) find that for one time collection , directly noising data ( after hashing to a bloom filter ) is their best approach for inducing privacy . Ren et al . ( 2018 ) extend this bloom filter based approach , and attempt to estimate the clean distribution of their LDP data in order to generate a LDP synthetic dataset , though we note that the range of applications is limited , as with CDP synthetic generation above . In this paper , we adapt well-established techniques from representation learning to address the fundamental limitation of LDP in the context of high-dimensional data : datapoints in high dimensional space require prohibitive levels of noise to locally privatize ( the privacy budget , , naively scales linearly with the dimensionality ) . To motivate our approach , consider the fact that it is often a good approximation to assume that a given high-dimensional dataset lives on a much lower dimensional manifold . Applying a general privatization mechanism to low-dimensional representations should thus enable us to learn how to add noise to the high-dimensional data efficiently and applicationagnostically . Our approach is inspired by the VAE ( Kingma & Welling , 2014 ; Rezende et al. , 2014 ) ; we demonstrate that sampling in latent space is equivalent to passing a datapoint through an LDP Laplace mechanism . Furthermore , reconstructing a datapoint is equivalent to adding a complex noise distribution to the raw features , thereby inducing LDP . Our randomized algorithm , which we refer to as the variational Laplace mechanism ( VLM ) , satisfies the strict guarantees of LDP , and is agnostic to both data type and downstream task . We demonstrate that we can use the data privatized with our mechanism to train downstream machine learning models that act on both clean and privatized data at inference time . Furthermore , we demonstrate multiple concrete applications of our model : we privately collect data from individuals for downstream model training ; we use a transfer-learning-inspired approach to privately collect data of an unseen class type upon which we train a classifier ; and we augment a clean dataset with additional privatized features to improve the accuracy of a classifier on the combined data . None of these applications can be solved with CDP , and we find significant performance gains over the naive approach of directly noising the data . 2 BASIC DEFINITIONS AND NOTATION . To formalize the concept of differential privacy , we first introduce some definitions and notation . Definition ( ( , δ ) -central differential privacy ) : Let A : D → Z be a randomized algorithm , that takes as input datasets from the dataset domain D. We sayA is ( , δ ) -central differentially private if for , δ ≥ 0 , for all subsets S ⊆ Z , and for all neighboring datasets D , D′ ∈ D , we have p ( A ( D ) ∈ S ) ≤ exp ( ) p ( A ( D′ ) ∈ S ) + δ ( 1 ) where for D and D′ to be neighboring means that they are identical in all but one datapoint . Intuitively , this states that one can not tell ( with a level of certainty determined by ( , δ ) ) whether an individual is present in a database or not . When δ = 0 we say A satisfies -CDP . Definition ( ` 1 sensitivity ) : The ` 1 sensitivity of a function f : D → Rk is defined as ∆f = max adjacent ( D , D′ ) ||f ( D ) − f ( D′ ) ||1 ( 2 ) where adjacent ( D , D′ ) implies D , D′ ∈ D are neighboring datasets . Definition ( Laplace mechanism ) : The Laplace mechanismM ( central ) : D → Rk is a randomized algorithm defined as M ( central ) ( D , f ( · ) , ) = f ( D ) + ( s1 , . . . , sk ) ( 3 ) for D ∈ D , si ∼ Laplace ( 0 , ∆f/ ) , and some transformation function f : D → Rk . The Laplace mechanism induces -CDP ; see Dwork & Roth ( 2014 ) for proof . While CDP relies on a trusted database administrator , LDP provides a much stricter guarantee in which the individual does not need to trust an administrator . Instead individuals are able to privatize their data before sending it using a local randomized algorithm . Definition ( ( , δ ) -local differential privacy ) : A local randomized algorithmA : X → Z , that takes as input a datapoint from the data domain X , satisfies ( , δ ) -local differential privacy if for , δ ≥ 0 , for all S ⊆ Z , and for any inputs x , x′ ∈ X , p ( A ( x ) ∈ S ) ≤ exp ( ) p ( A ( x′ ) ∈ S ) + δ ( 4 ) When δ = 0 we say A satisfies -LDP . Definition ( Local Laplace mechanism ) : The local Laplace mechanism M ( local ) : X → Rk is a randomized algorithm defined as M ( local ) ( x , f ( · ) , ) = f ( x ) + ( s1 , . . . , sk ) ( 5 ) for x ∈ X , si ∼ Laplace ( 0 , ∆f/ ) , and some transformation function f : X → Z , where Z ⊆ Rk and the ` 1 sensitivity of f ( · ) is defined as ∆f = maxx , x′∈X ||f ( x ) − f ( x′ ) ||1 . The local Laplace mechanism satisfies -LDP ( see Appendix A for proof ) . Another common choice of mechanism for privatizing continuous data is the Gaussian mechanism , which satisfies ( , δ > 0 ) -LDP . For the remainder of the paper however , we exclusively study the local Laplace mechanism since it provides a strong privacy guarantee ( i.e . δ = 0 ) . We note that our approach could be used to learn a Gaussian mechanism with minimal modification . 3 PROPOSED METHOD . Early work on data collection algorithms , such as randomized response , have relied on very simple randomized algorithms to induce privacy . Throughout this paper we have benchmarked our results against such a mechanism , in which we add Laplace noise to all continuous features , and flip each of the categorical features with some probability . By the composition theorem ( Dwork & Roth , 2014 ) , each feature then contributes towards the overall LDP guarantee of the d-dimensional datapoint as = ∑d i=1 i . Since we have no prior knowledge about which features are most important , we choose the Laplace noise level ( or flip probability ) for each feature to be such that i = /d . See Appendix E.2 for further details . As with our approach , this benchmark mechanism can act on any date type , and forms a downstream task agnostic LDP version of the data . As d increases , i decreases for each feature i . The noise required to induce -LDP thus grows with data dimensionality . For high-dimensional datasets like images or large tables , features are often highly correlated ; consequently , noising features independently is wasteful towards privatizing the information content in each datapoint . A more effective approach to privatization involves noising a learned lower-dimensional representation of each datapoint using a generic noising mechanism . To this end , we use a VAE-based approach to learn a low-dimensional latent representation of our data . This learned mapping from data space to latent space forms our function f ( · ) in Equation 5 , and requires only a small unlabelled dataset from a similar distribution , which most organizations will typically already have access to , either internally or publicly . Applying the Laplace mechanism ( as described in Section 3.1 ) thus ensures the encoded latents , as well as reconstructed datapoints , satisfy LDP . We can therefore privatize data at the latent level or the original-feature level ; preference between these two options is application specific , and we investigate both experimentally . Data owners can apply this learned LDP mechanism to their data before sharing , and the database administrator forms an LDP data set from the collected data . This set , along with information on the type of noise added , is used to train downstream machine learning algorithms . Though our privatization method is task agnostic , in this paper we focus on classification tasks in which we have some features x for which we want to predict the corresponding label y . At inference time , we show that this classifier can act on either clean or privatized datapoints , depending on the application . | For LDP, when applying noise directly to high-dimensional data, the required noise entirely destroys data utility. In this paper, authors introduce a novel, application-agnostic privatization mechanism that leverages representation learning to overcome the prohibitive noise requirements of direct methods. They further demonstrate that this privatization mechanism can be used to train machine learning algorithms across a range of applications. They achieve significant gains in performance for high-dimensional data. | SP:bf68937b0e23da990383e48608af226ad5f250cf |
Learning to Noise: Application-Agnostic Data Sharing with Local Differential Privacy | 1 INTRODUCTION . The collection of personal data is ubiquitous , and unavoidable for many in everyday life . While this has undeniably improved the quality and user experience of many products and services , evidence of data misuse and data breaches ( Sweeney , 1997 ; Jolly , 2020 ) have brought the concept of data privacy into sharp focus , fueling both regulatory changes as well as a shift in personal preferences . The onus has now fallen on organizations to determine if they are willing and able to collect personal data under these changing expectations . There is thus a growing need to collect data in a privacypreserving manner , that can still be used to improve products and services . Often coined the ‘ gold standard ’ of privacy guarantees , central differential privacy ( CDP ) ( Dwork & Roth , 2014 ) protects against an adversary determining the presence of a user in a dataset . It provides a quantifiable definition , is robust to post-processing , and allows for the protection of groups of people via its composability property ( Dwork et al. , 2006 ; Dwork & Roth , 2014 ) . The CDP framework relies on the addition of noise to the output of statistical queries on a dataset , in such a way that the same information can be extracted from that dataset whether or not any given individual is present . One can train machine learning models such that the model is CDP with respect to the training set by using training methods such as DP-SGD ( Abadi et al. , 2016 ) , DP-Adam ( Gylberth et al. , 2017 ) or PATE ( Papernot et al. , 2017 ) . Given access to a clean labelled dataset , one could train , for example , a CDP classifier this way . Similarly , one could ‘ share ’ data privately by training a generative model , such as a variational autoencoder ( VAE ) or generative adversarial network ( GAN ) , with a CDP training method , and then construct a synthetic dataset satisfying CDP with respect to the training set by generating samples from this model ( Xie et al. , 2018 ; Triastcyn & Faltings , 2019 ; Acs et al. , 2019 ; Takagi et al. , 2021 ) . While some of these approaches require only an unlabelled training set , their applications are limited in that they generate only synthetic samples that are likely under the original training set distribution . Firstly , changes in the data distribution warrant the re-training of the generative model . Secondly , the synthetic points are only representative samples , and so we lack any information about the features of given individuals . Clearly , this limits the range of applications : the model can not be used to join private and clean datasets , for applications in which we expect a distributional shift , or for privately collecting new data . Furthermore , CDP also requires a trustworthy database administrator . Federated learning ( McMahan et al. , 2017 ; Agarwal et al. , 2018 ; Rodrı́guez-Barroso et al. , 2020 ) is a related technique in which a model can be trained privately , without placing trust in a database administrator . The model is trained across multiple decentralized devices , omitting the need to share data with a central server . Unfortunately , by construction , federated learning does not allow for any data to be privately shared or collected , and is only concerned with the privacy of the model . An approach that allows data collection , while protecting the privacy of an individual against even the database administrator , is to construct a mechanism that privatizes the features of a given individual locally , before collection . Warner ( 1965 ) developed a mechanism , known as randomized response , to preserve the privacy of survey respondents : when answering a sensitive ( binary ) question , the respondent is granted plausible deniability by giving a truthful answer if a fair coin flip returns heads , and answering yes otherwise . Recent work has further developed this idea , often referred to as local differential privacy ( LDP ) ( Kasiviswanathan et al. , 2008 ; Duchi et al. , 2013 ) . LDP provides a mathematically-provable privacy guarantee for members of a database against both adversaries and database administrators . Many existing LDP mechanism focus on the collection of low-dimensional data like summary statistics , or on mechanisms which do not easily generalize to different data types . Erlingsson et al . ( 2014 ) , Ding et al . ( 2017 ) and Tang et al . ( 2017 ) introduce methods for collecting such data repeatedly over time . Erlingsson et al . ( 2014 ) find that for one time collection , directly noising data ( after hashing to a bloom filter ) is their best approach for inducing privacy . Ren et al . ( 2018 ) extend this bloom filter based approach , and attempt to estimate the clean distribution of their LDP data in order to generate a LDP synthetic dataset , though we note that the range of applications is limited , as with CDP synthetic generation above . In this paper , we adapt well-established techniques from representation learning to address the fundamental limitation of LDP in the context of high-dimensional data : datapoints in high dimensional space require prohibitive levels of noise to locally privatize ( the privacy budget , , naively scales linearly with the dimensionality ) . To motivate our approach , consider the fact that it is often a good approximation to assume that a given high-dimensional dataset lives on a much lower dimensional manifold . Applying a general privatization mechanism to low-dimensional representations should thus enable us to learn how to add noise to the high-dimensional data efficiently and applicationagnostically . Our approach is inspired by the VAE ( Kingma & Welling , 2014 ; Rezende et al. , 2014 ) ; we demonstrate that sampling in latent space is equivalent to passing a datapoint through an LDP Laplace mechanism . Furthermore , reconstructing a datapoint is equivalent to adding a complex noise distribution to the raw features , thereby inducing LDP . Our randomized algorithm , which we refer to as the variational Laplace mechanism ( VLM ) , satisfies the strict guarantees of LDP , and is agnostic to both data type and downstream task . We demonstrate that we can use the data privatized with our mechanism to train downstream machine learning models that act on both clean and privatized data at inference time . Furthermore , we demonstrate multiple concrete applications of our model : we privately collect data from individuals for downstream model training ; we use a transfer-learning-inspired approach to privately collect data of an unseen class type upon which we train a classifier ; and we augment a clean dataset with additional privatized features to improve the accuracy of a classifier on the combined data . None of these applications can be solved with CDP , and we find significant performance gains over the naive approach of directly noising the data . 2 BASIC DEFINITIONS AND NOTATION . To formalize the concept of differential privacy , we first introduce some definitions and notation . Definition ( ( , δ ) -central differential privacy ) : Let A : D → Z be a randomized algorithm , that takes as input datasets from the dataset domain D. We sayA is ( , δ ) -central differentially private if for , δ ≥ 0 , for all subsets S ⊆ Z , and for all neighboring datasets D , D′ ∈ D , we have p ( A ( D ) ∈ S ) ≤ exp ( ) p ( A ( D′ ) ∈ S ) + δ ( 1 ) where for D and D′ to be neighboring means that they are identical in all but one datapoint . Intuitively , this states that one can not tell ( with a level of certainty determined by ( , δ ) ) whether an individual is present in a database or not . When δ = 0 we say A satisfies -CDP . Definition ( ` 1 sensitivity ) : The ` 1 sensitivity of a function f : D → Rk is defined as ∆f = max adjacent ( D , D′ ) ||f ( D ) − f ( D′ ) ||1 ( 2 ) where adjacent ( D , D′ ) implies D , D′ ∈ D are neighboring datasets . Definition ( Laplace mechanism ) : The Laplace mechanismM ( central ) : D → Rk is a randomized algorithm defined as M ( central ) ( D , f ( · ) , ) = f ( D ) + ( s1 , . . . , sk ) ( 3 ) for D ∈ D , si ∼ Laplace ( 0 , ∆f/ ) , and some transformation function f : D → Rk . The Laplace mechanism induces -CDP ; see Dwork & Roth ( 2014 ) for proof . While CDP relies on a trusted database administrator , LDP provides a much stricter guarantee in which the individual does not need to trust an administrator . Instead individuals are able to privatize their data before sending it using a local randomized algorithm . Definition ( ( , δ ) -local differential privacy ) : A local randomized algorithmA : X → Z , that takes as input a datapoint from the data domain X , satisfies ( , δ ) -local differential privacy if for , δ ≥ 0 , for all S ⊆ Z , and for any inputs x , x′ ∈ X , p ( A ( x ) ∈ S ) ≤ exp ( ) p ( A ( x′ ) ∈ S ) + δ ( 4 ) When δ = 0 we say A satisfies -LDP . Definition ( Local Laplace mechanism ) : The local Laplace mechanism M ( local ) : X → Rk is a randomized algorithm defined as M ( local ) ( x , f ( · ) , ) = f ( x ) + ( s1 , . . . , sk ) ( 5 ) for x ∈ X , si ∼ Laplace ( 0 , ∆f/ ) , and some transformation function f : X → Z , where Z ⊆ Rk and the ` 1 sensitivity of f ( · ) is defined as ∆f = maxx , x′∈X ||f ( x ) − f ( x′ ) ||1 . The local Laplace mechanism satisfies -LDP ( see Appendix A for proof ) . Another common choice of mechanism for privatizing continuous data is the Gaussian mechanism , which satisfies ( , δ > 0 ) -LDP . For the remainder of the paper however , we exclusively study the local Laplace mechanism since it provides a strong privacy guarantee ( i.e . δ = 0 ) . We note that our approach could be used to learn a Gaussian mechanism with minimal modification . 3 PROPOSED METHOD . Early work on data collection algorithms , such as randomized response , have relied on very simple randomized algorithms to induce privacy . Throughout this paper we have benchmarked our results against such a mechanism , in which we add Laplace noise to all continuous features , and flip each of the categorical features with some probability . By the composition theorem ( Dwork & Roth , 2014 ) , each feature then contributes towards the overall LDP guarantee of the d-dimensional datapoint as = ∑d i=1 i . Since we have no prior knowledge about which features are most important , we choose the Laplace noise level ( or flip probability ) for each feature to be such that i = /d . See Appendix E.2 for further details . As with our approach , this benchmark mechanism can act on any date type , and forms a downstream task agnostic LDP version of the data . As d increases , i decreases for each feature i . The noise required to induce -LDP thus grows with data dimensionality . For high-dimensional datasets like images or large tables , features are often highly correlated ; consequently , noising features independently is wasteful towards privatizing the information content in each datapoint . A more effective approach to privatization involves noising a learned lower-dimensional representation of each datapoint using a generic noising mechanism . To this end , we use a VAE-based approach to learn a low-dimensional latent representation of our data . This learned mapping from data space to latent space forms our function f ( · ) in Equation 5 , and requires only a small unlabelled dataset from a similar distribution , which most organizations will typically already have access to , either internally or publicly . Applying the Laplace mechanism ( as described in Section 3.1 ) thus ensures the encoded latents , as well as reconstructed datapoints , satisfy LDP . We can therefore privatize data at the latent level or the original-feature level ; preference between these two options is application specific , and we investigate both experimentally . Data owners can apply this learned LDP mechanism to their data before sharing , and the database administrator forms an LDP data set from the collected data . This set , along with information on the type of noise added , is used to train downstream machine learning algorithms . Though our privatization method is task agnostic , in this paper we focus on classification tasks in which we have some features x for which we want to predict the corresponding label y . At inference time , we show that this classifier can act on either clean or privatized datapoints , depending on the application . | In this paper, the authors present a generative-model-based Laplace mechanism. By training the VAE on some dataset, the trained encoder can be used to privatize raw data towards epsilon, delta-LDP. Though the method is novel, the privacy guarantee of the proposed method is not clearly stated and proved. Related experiments are not convincing, either. | SP:bf68937b0e23da990383e48608af226ad5f250cf |
Efficiently Troubleshooting Image Segmentation Models with Human-In-The-Loop | 1 INTRODUCTION . Image segmentation ( i.e. , pixel-level image labelling ) has recently risen to explosive popularity , due in part to its profound impact on many high-stakes vision applications , such as autonomous driving and medical image analysis . While the performance of segmentation models , as measured by excessively reused test sets ( Everingham et al. , 2010 ; Lin et al. , 2014 ) , keeps improving ( Chen et al. , 2018a ; Badrinarayanan et al. , 2017 ; Yu et al. , 2018 ) , two scientific questions have arisen to capture the community ’ s curiosity , and motivate the current work : Q1 : Do “ top-performing ” segmentation models on existing benchmarks generalize to the real world with much richer variations ? Q2 : Can we identify and rectify the trained models ’ sparse but fatal mistakes , without incurring significant workload of human labelling ? The answer to the first question is conceptually clearer , by taking reference to a series of recent work on image classification ( Recht et al. , 2019 ; Hendrycks et al. , 2019 ) . A typical test set for image classification can only include a maximum of ten thousands of images because human labelling ( or verification of predicted labels ) is expensive and time-consuming . Considering the high dimensionality of image space and the “ human-level ” performance of existing methods , such test sets may only spot an extremely small subset of possible mistakes that the model will make , suggesting their insufficiency to cover hard examples that may be encountered in the real world ( Wang et al. , 2020 ) . The existence of natural adversarial examples ( Hendrycks et al. , 2019 ) also echos such hidden fragility of the classifiers to unseen examples , despite the impressive accuracy on existing benchmarks . While the above problem has not been studied in the context of image segmentation , we argue that it would only be much amplified for two main reasons . First , segmentation benchmarks require pixel-level dense annotation . Compared to classification databases , they are much more expensive , laborious , and error-prone to label1 , making existing segmentation datasets even more restricted in scale . Second , it is much harder for segmentation data to be class-balanced in the pixel level , making highly skewed class distributions notoriously common for this particular task ( Kervadec et al. , 2019 ; Bischke et al. , 2018 ) . Besides , the “ universal ” background class ( often set to cover the distracting or uninteresting classes ( Everingham et al. , 2010 ) ) adds additional complicacy to image segmentation ( Mostajabi et al. , 2015 ) . Thus , it remains questionable to what extent the impressive performance on existing benchmarks can be interpreted as ( or translated into ) real-world robustness . If “ top-performing ” segmentation models make sparse yet catastrophic mistakes that have not been spotted beforehand , they will fall short of the need by high-stakes applications . The answer to the second question constitutes the main body of our technical work . In order to identify sparse failures of existing segmentation models , it is necessary to expose them to a much larger corpus of real-world labelled images ( on the order millions or even billions ) . This is , however , implausible due to the expensiveness of dense labelling in image segmentation . The core question essentially boils down to : how to efficiently decide what to label from the massive unlabelled images , such that a small number of annotated images maximally expose corner-case defects , and can be leveraged to improve the models . In this paper , we introduce a two-stage framework with human-in-the-loop for efficiently troubleshooting image segmentation models ( see Figure 1 ) . The first stage automatically mines , from a large pool D of unlabelled images , a small image set M , which are the most informative in exposing weaknesses of the target model . Specifically , inspired by previous studies on model falsification as model comparison ( Wang & Simoncelli , 2008 ; Ma et al. , 2018 ; Wang et al. , 2020 ) , we let the target model compete with a set of state-of-the-art methods with different design methodologies , and sample images by MAximizing the Discrepancy ( MAD ) between the methods . To reduce the number of false positives , we propose a weakly labelling method of filteringM to obtain a smaller refined set S , subject to segmentation by human subjects . In the second stage , we fine-tune the target model to learn from the counterexamples in S without forgetting previously seen data . The two stages may be iterated , enabling progressive troubleshooting of image segmentation models . Experiments on PASCAL VOC ( Everingham et al. , 2010 ) demonstrate the feasibility of the proposed method to address this new challenging problem , where we successfully discover corner-case errors of a “ top-performing ” segmentation model ( Chen et al. , 2017 ) , and fix it for improved generalization in the wild . 2 RELATED WORK . MAD competition The proposed method takes inspiration from the MAD competition ( Wang & Simoncelli , 2008 ; Wang et al. , 2020 ) to efficiently spot model failures . Previous works focused on performance evaluation . We take one step further to also fix the model errors detected in the MAD competition . To the best of our knowledge , our work is the first to extend the MAD idea to image segmentation , where labeling efficiency is more desired since pixel-wise human annotation for image segmentation is much more time-consuming than image quality assessment ( Wang & Simoncelli , 2008 ) and image classification ( Wang et al. , 2020 ) tasks previously explored . 1According to Everingham et al . ( Everingham et al. , 2010 ) and our practice , it can easily take ten times as long to segment an object than to draw a bounding box around it . Differential testing Our method is also loosely related to the cross-disciplinary field of software/system testing , especially the differential testing technique ( McKeeman , 1998 ) . By providing the same tests to multiple software implementations , differential testing aims to find bug-exposing test samples that lead to different results . Programmers can then dig into these test cases for potential bug fixing . While debugging software is very different from troubleshooting machine learning algorithms , a handful of recent work explored this idea to find pitfalls of deep learning-based autonomous driving systems ( Pei et al. , 2017 ; Tian et al. , 2018 ; Zhang et al. , 2018 ) . Aiming to be fully automated without human intervention , these methods have to make strong assumptions such as the ground truth labels can be determined by majority vote2 or are unchanged under some synthetic image transformations3 ( e.g. , brightness and contrast change , or style transfer ) . Therefore , it is unclear how to generalize the results obtained in such noisy and often unrealistic settings , to the real world with both great content fidelity and diversity . Adversarial examples Introduced by Dalvi et al . ( Dalvi et al. , 2004 ) and reignited by Szegedy et al . ( Szegedy et al. , 2013 ) , most adversarial attacks add small synthetic perturbations to inputs of computational models that cause them to make incorrect decisions . In image classification , Hendrycks et al . ( Hendrycks et al. , 2019 ) identified a set of natural images that behave like synthetic adversarial examples , which possess inherent transferability to falsify different image classifiers with the same type of errors . The selected counterexamples by the proposed framework might be treated as a new type of natural adversarial examples , that force the two models to make distinct predictions , therefore capable of fooling at least one model . Similar as natural counterexamples focused in this work , synthetic adversarial examples pose security risks of deploying machine learning algorithms in real-world applications . A large body of research ( Madry et al. , 2018 ; Zhang et al. , 2019 ) delves deep into adversarial training , trying to defend against adversarial perturbations at the expensive cost of sacrificing the generalization on original test sets without perturbations ( Tsipras et al. , 2019 ; Zhang et al. , 2019 ; Schmidt et al. , 2018 ) . This seems to suggest a trade-off between generalization to real-world benign examples and robustness to adversarial attacks . Semantic segmentation with deep learning Fully convolutional network ( Long et al. , 2015 ) was among the first deep architectures adopted for high-quality segmentation . Skip connection ( Ronneberger et al. , 2015 ) , recurrent module ( Zheng et al. , 2015 ) , max index pooling ( Noh et al. , 2015 ; Badrinarayanan et al. , 2017 ) , dilated convolution ( Chen et al. , 2014 ; Yu & Koltun , 2016 ; Chen et al. , 2018a ) , and multi-scale training ( Chen et al. , 2016 ; 2018a ) are typical strategies to boost the segmentation performance . Conditional random fields ( Ladickỳ et al. , 2010 ) used to dominate image segmentation before the advent of deep learning were also combined with convolutional networks to model spatial relationships ( Zheng et al. , 2015 ) . We refer interested readers to ( Minaee et al. , 2020 ) for a comprehensive survey of this field . 3 PROPOSED METHOD . Suppose we have a target segmentation model ft : Rh×w 7→ { 1 , · · · , c } h×w , where h and w are the height and width of the input image , and c denotes the number of categories . Our goal is to efficiently identify and fix the failure cases of ft encountered in the real world , while minimizing human labelling effort in this process . We start by constructing a large image database D , whose collection may be guided by the keywords that represent the c categories . Rather than conducting large-scale subjective testing to obtain the ground truth segmentation map for each x ∈ D , we choose to create a small subset of imagesM ⊂ D , which are strong candidates for revealing corner-case behaviors of ft. To further reduce false positive examples inM , we describe a method to gather a weak label for each x ∈ M as an overall indicator of segmentation quality . Based on the labels , an even smaller set S ⊂M can be obtained for dense annotation by humans . Last , we fine-tune ft 2As per ( Hendrycks et al. , 2019 ) , machine learning algorithms with similar design philosophies tend to make common mistakes . 3In many areas of computer vision , methods trained on synthetic data can not generalize to realistic data , and specialized techniques such as domain adaptation ( Zhang et al. , 2017 ; Zhao et al. , 2019 ) have to be used to bridge the performance gap . on the combination of S and previously trained data , in an attempt to learn from the found failures without forgetting ( Li & Hoiem , 2017 ) . 3.1 FAILURE IDENTIFICATION . ConstructingM Inspired by model falsification methodologies from computational vision ( Wang & Simoncelli , 2008 ) and software engineering ( McKeeman , 1998 ) , we construct the setM = { xi } n2i=1 by sampling the most “ controversial ” images from the large-scale unlabelled database D = { xi } n1i=1 , where n2 n1 . Specifically , given the target model ft , we let it compete with a group of state-ofthe-art segmentation models { gj } mj=1 by maximizing the discrepancy ( Wang et al. , 2020 ) between ft and gj on D : x̂ ( j ) = argmax x∈D d ( ft ( x ) , gj ( x ) ) , j = 1 , . . . , m , ( 1 ) where d ( · ) is a distance metric to gauge the dissimilarity between two segmentation maps ( e.g. , negative pixel accuracy , or mean region intersection over union ( mIoU ) ) . x̂ ( j ) represents the most controversial image according to ft and gj , and therefore is the most informative in distinguishing between them . If the competing model gj performs at a high level , and differs from the target model ft in design , x̂ ( j ) is likely to be a failure of ft. To avoid identifying different instantiations of the same underlying root cause ( Pei et al. , 2017 ) and to encourage content diversity of the candidate images , we describe a “ contentaware ” method for constructing M. We first partition D into c overlapped subgroups { Dt , k } ck=1 based on ft ’ s predicted maps , where x ∈ Dt , k if at least one pixel in ft ( x ) belongs to the k-th category . After that , we add a content constraint by restricting the size of predicted pixels in the k-th category , i.e. , ∑ 1 [ ft ( x ) == k ] / ( h × w ) , within the range of [ pk , qk ] . This allows excluding images of exceedingly large ( or small ) object sizes , which may be of less practical relevance . Moreover , instead of focusing on the most controversial example defined in Eq . ( 1 ) , we look at top-n3 images in Dt , k with n3 largest distances computed by { x̂ ( j , k ) i } n3 i=1 = argmax { xi } n3 i=1∈Dt , k n3∑ i=1 d ( ft ( xi ) , gj ( xi ) ) , j = 1 , . . . , m , k = 1 , . . . , c. ( 2 ) We then repeat this procedure , but with the roles of ft and gj reversed . That is , we partition D into c subgroups { Dj , k } ck=1 according to gj , and solve the maximization problem over Dj , k . Finally , we gather all candidate images to arrive at the setM = { xi } n2i=1 , where n2 ≤ 2mcn3 n1.4 Constructing S Although images in the candidate setM have great potentials of being counterexamples of ft , some false positives may be included ( see Figure 2 ) , especially when gj is inferior to ft . In addition , no data screening is involved in the construction of D , increasing chances of including images that are out-of-domain ( e.g. , falling out of the c categories and/or containing inappropriate content ) . In view of these , we reduce false positives inM via a weakly labelling strategy . For each x ∈M , we ask human subjects to give a discrete score on an absolute category rating ( ACR ) scale to indicate the segmentation quality of ft ( x ) . The labels on the scale are “ bad ” , “ poor ” , “ fair ” , “ good ” , 4We have n2 ≤ 2mcn3 because the same images may be optimal in different problems specified in Eq . ( 2 ) . and “ excellent ” ( see Figure 8 ) . We then rank all images inM by the mean opinion scores , and choose top-n4 images with the smallest scores to form the counterexample set S = { xi } n4i=1 . Finally , we seek pixel-level segmentation results from human annotators for each image in S ( see Figure 9 ) . 3.2 MODEL RECTIFICATION Algorithm 1 : The proposed framework for efficiently troubleshooting segmentation models Input : An unlabelled image set D , a target model f ( 0 ) t and the dataset S ( 0 ) on which it is pre-trained , a group of competing models { gj } mj=1 , the maximum number r of fine-tuning rounds , hyper-parameters n3 , n4 Output : Improved f ( r ) t 1 S ← ∅ 2 for j ← 1 to m do 3 Compute segmentation predictions { gj ( x ) , x ∈ D } 4 end 5 for i← 0 to r − 1 do 6 M ( i+1 ) ← ∅ 7 Compute segmentation predictions { f ( i ) t ( x ) , x ∈ D } 8 for j ← 1 to m do 9 Compute the distances { d ( f ( i ) t ( x ) , gj ( x ) ) , x ∈ D } 10 Divide D into c subgroups according to f ( i ) t 11 Filter images by the content constraint 12 Select top-n3 images by solving Eq . ( 2 ) to formMj 13 M ( i+1 ) ←M ( i+1 ) ⋃ Mj 14 Reverse the roles of f ( i ) t and gj , and repeat Steps 10 to 13 15 end 16 Source weak human scores forM ( i+1 ) 17 Select top-n4 images with the lowest quality scores and collect pixel-level labels from humans to form S ( i+1 ) 18 S ← S ⋃ S ( i+1 ) ; 19 Fine-tune f ( i ) t on the combination of S and S ( 0 ) 20 end The labelled images in S give us a great opportunity to improve ft by learning from these failures . In order to be resistant to catastrophic forgetting ( McCloskey & Cohen , 1989 ) , the fine-tuning can also include labelled data previously used to train ft. We may iterate through the whole procedure of failure identification and model rectification several rounds , leading to a progressive two-stage framework for efficiently troubleshooting segmentation models with human-in-the-loop . When the iterative setting is enabled , the size of S is growing : S = ⋃r i=1 S ( i ) , where S ( i ) is the counterexample set created in the i-th fine-tuning round . Denoting the initial target model by f ( 0 ) t , we fine-tune f ( i−1 ) t on the combination of S accumulated in the previous i − 1 rounds and S ( 0 ) used for pre-training . We summarize the proposed framework in Algorithm 1 . | This work used a variety of existing segmentation algorithms to discover most "controversial" samples from massive online unlabeled images. Those representative controversial samples were believed to have the best chance to confuse the algorithm being trained and to expose its weakness. They are rated by annotators on a spectrum from bad to excellent, and segmentation masks are collected from human annotators for the “worst” images. Several clever measures were taken to reduce human labor. | SP:5fce6baf0f2dcde5b8519a5850484aa627f64f68 |
Efficiently Troubleshooting Image Segmentation Models with Human-In-The-Loop | 1 INTRODUCTION . Image segmentation ( i.e. , pixel-level image labelling ) has recently risen to explosive popularity , due in part to its profound impact on many high-stakes vision applications , such as autonomous driving and medical image analysis . While the performance of segmentation models , as measured by excessively reused test sets ( Everingham et al. , 2010 ; Lin et al. , 2014 ) , keeps improving ( Chen et al. , 2018a ; Badrinarayanan et al. , 2017 ; Yu et al. , 2018 ) , two scientific questions have arisen to capture the community ’ s curiosity , and motivate the current work : Q1 : Do “ top-performing ” segmentation models on existing benchmarks generalize to the real world with much richer variations ? Q2 : Can we identify and rectify the trained models ’ sparse but fatal mistakes , without incurring significant workload of human labelling ? The answer to the first question is conceptually clearer , by taking reference to a series of recent work on image classification ( Recht et al. , 2019 ; Hendrycks et al. , 2019 ) . A typical test set for image classification can only include a maximum of ten thousands of images because human labelling ( or verification of predicted labels ) is expensive and time-consuming . Considering the high dimensionality of image space and the “ human-level ” performance of existing methods , such test sets may only spot an extremely small subset of possible mistakes that the model will make , suggesting their insufficiency to cover hard examples that may be encountered in the real world ( Wang et al. , 2020 ) . The existence of natural adversarial examples ( Hendrycks et al. , 2019 ) also echos such hidden fragility of the classifiers to unseen examples , despite the impressive accuracy on existing benchmarks . While the above problem has not been studied in the context of image segmentation , we argue that it would only be much amplified for two main reasons . First , segmentation benchmarks require pixel-level dense annotation . Compared to classification databases , they are much more expensive , laborious , and error-prone to label1 , making existing segmentation datasets even more restricted in scale . Second , it is much harder for segmentation data to be class-balanced in the pixel level , making highly skewed class distributions notoriously common for this particular task ( Kervadec et al. , 2019 ; Bischke et al. , 2018 ) . Besides , the “ universal ” background class ( often set to cover the distracting or uninteresting classes ( Everingham et al. , 2010 ) ) adds additional complicacy to image segmentation ( Mostajabi et al. , 2015 ) . Thus , it remains questionable to what extent the impressive performance on existing benchmarks can be interpreted as ( or translated into ) real-world robustness . If “ top-performing ” segmentation models make sparse yet catastrophic mistakes that have not been spotted beforehand , they will fall short of the need by high-stakes applications . The answer to the second question constitutes the main body of our technical work . In order to identify sparse failures of existing segmentation models , it is necessary to expose them to a much larger corpus of real-world labelled images ( on the order millions or even billions ) . This is , however , implausible due to the expensiveness of dense labelling in image segmentation . The core question essentially boils down to : how to efficiently decide what to label from the massive unlabelled images , such that a small number of annotated images maximally expose corner-case defects , and can be leveraged to improve the models . In this paper , we introduce a two-stage framework with human-in-the-loop for efficiently troubleshooting image segmentation models ( see Figure 1 ) . The first stage automatically mines , from a large pool D of unlabelled images , a small image set M , which are the most informative in exposing weaknesses of the target model . Specifically , inspired by previous studies on model falsification as model comparison ( Wang & Simoncelli , 2008 ; Ma et al. , 2018 ; Wang et al. , 2020 ) , we let the target model compete with a set of state-of-the-art methods with different design methodologies , and sample images by MAximizing the Discrepancy ( MAD ) between the methods . To reduce the number of false positives , we propose a weakly labelling method of filteringM to obtain a smaller refined set S , subject to segmentation by human subjects . In the second stage , we fine-tune the target model to learn from the counterexamples in S without forgetting previously seen data . The two stages may be iterated , enabling progressive troubleshooting of image segmentation models . Experiments on PASCAL VOC ( Everingham et al. , 2010 ) demonstrate the feasibility of the proposed method to address this new challenging problem , where we successfully discover corner-case errors of a “ top-performing ” segmentation model ( Chen et al. , 2017 ) , and fix it for improved generalization in the wild . 2 RELATED WORK . MAD competition The proposed method takes inspiration from the MAD competition ( Wang & Simoncelli , 2008 ; Wang et al. , 2020 ) to efficiently spot model failures . Previous works focused on performance evaluation . We take one step further to also fix the model errors detected in the MAD competition . To the best of our knowledge , our work is the first to extend the MAD idea to image segmentation , where labeling efficiency is more desired since pixel-wise human annotation for image segmentation is much more time-consuming than image quality assessment ( Wang & Simoncelli , 2008 ) and image classification ( Wang et al. , 2020 ) tasks previously explored . 1According to Everingham et al . ( Everingham et al. , 2010 ) and our practice , it can easily take ten times as long to segment an object than to draw a bounding box around it . Differential testing Our method is also loosely related to the cross-disciplinary field of software/system testing , especially the differential testing technique ( McKeeman , 1998 ) . By providing the same tests to multiple software implementations , differential testing aims to find bug-exposing test samples that lead to different results . Programmers can then dig into these test cases for potential bug fixing . While debugging software is very different from troubleshooting machine learning algorithms , a handful of recent work explored this idea to find pitfalls of deep learning-based autonomous driving systems ( Pei et al. , 2017 ; Tian et al. , 2018 ; Zhang et al. , 2018 ) . Aiming to be fully automated without human intervention , these methods have to make strong assumptions such as the ground truth labels can be determined by majority vote2 or are unchanged under some synthetic image transformations3 ( e.g. , brightness and contrast change , or style transfer ) . Therefore , it is unclear how to generalize the results obtained in such noisy and often unrealistic settings , to the real world with both great content fidelity and diversity . Adversarial examples Introduced by Dalvi et al . ( Dalvi et al. , 2004 ) and reignited by Szegedy et al . ( Szegedy et al. , 2013 ) , most adversarial attacks add small synthetic perturbations to inputs of computational models that cause them to make incorrect decisions . In image classification , Hendrycks et al . ( Hendrycks et al. , 2019 ) identified a set of natural images that behave like synthetic adversarial examples , which possess inherent transferability to falsify different image classifiers with the same type of errors . The selected counterexamples by the proposed framework might be treated as a new type of natural adversarial examples , that force the two models to make distinct predictions , therefore capable of fooling at least one model . Similar as natural counterexamples focused in this work , synthetic adversarial examples pose security risks of deploying machine learning algorithms in real-world applications . A large body of research ( Madry et al. , 2018 ; Zhang et al. , 2019 ) delves deep into adversarial training , trying to defend against adversarial perturbations at the expensive cost of sacrificing the generalization on original test sets without perturbations ( Tsipras et al. , 2019 ; Zhang et al. , 2019 ; Schmidt et al. , 2018 ) . This seems to suggest a trade-off between generalization to real-world benign examples and robustness to adversarial attacks . Semantic segmentation with deep learning Fully convolutional network ( Long et al. , 2015 ) was among the first deep architectures adopted for high-quality segmentation . Skip connection ( Ronneberger et al. , 2015 ) , recurrent module ( Zheng et al. , 2015 ) , max index pooling ( Noh et al. , 2015 ; Badrinarayanan et al. , 2017 ) , dilated convolution ( Chen et al. , 2014 ; Yu & Koltun , 2016 ; Chen et al. , 2018a ) , and multi-scale training ( Chen et al. , 2016 ; 2018a ) are typical strategies to boost the segmentation performance . Conditional random fields ( Ladickỳ et al. , 2010 ) used to dominate image segmentation before the advent of deep learning were also combined with convolutional networks to model spatial relationships ( Zheng et al. , 2015 ) . We refer interested readers to ( Minaee et al. , 2020 ) for a comprehensive survey of this field . 3 PROPOSED METHOD . Suppose we have a target segmentation model ft : Rh×w 7→ { 1 , · · · , c } h×w , where h and w are the height and width of the input image , and c denotes the number of categories . Our goal is to efficiently identify and fix the failure cases of ft encountered in the real world , while minimizing human labelling effort in this process . We start by constructing a large image database D , whose collection may be guided by the keywords that represent the c categories . Rather than conducting large-scale subjective testing to obtain the ground truth segmentation map for each x ∈ D , we choose to create a small subset of imagesM ⊂ D , which are strong candidates for revealing corner-case behaviors of ft. To further reduce false positive examples inM , we describe a method to gather a weak label for each x ∈ M as an overall indicator of segmentation quality . Based on the labels , an even smaller set S ⊂M can be obtained for dense annotation by humans . Last , we fine-tune ft 2As per ( Hendrycks et al. , 2019 ) , machine learning algorithms with similar design philosophies tend to make common mistakes . 3In many areas of computer vision , methods trained on synthetic data can not generalize to realistic data , and specialized techniques such as domain adaptation ( Zhang et al. , 2017 ; Zhao et al. , 2019 ) have to be used to bridge the performance gap . on the combination of S and previously trained data , in an attempt to learn from the found failures without forgetting ( Li & Hoiem , 2017 ) . 3.1 FAILURE IDENTIFICATION . ConstructingM Inspired by model falsification methodologies from computational vision ( Wang & Simoncelli , 2008 ) and software engineering ( McKeeman , 1998 ) , we construct the setM = { xi } n2i=1 by sampling the most “ controversial ” images from the large-scale unlabelled database D = { xi } n1i=1 , where n2 n1 . Specifically , given the target model ft , we let it compete with a group of state-ofthe-art segmentation models { gj } mj=1 by maximizing the discrepancy ( Wang et al. , 2020 ) between ft and gj on D : x̂ ( j ) = argmax x∈D d ( ft ( x ) , gj ( x ) ) , j = 1 , . . . , m , ( 1 ) where d ( · ) is a distance metric to gauge the dissimilarity between two segmentation maps ( e.g. , negative pixel accuracy , or mean region intersection over union ( mIoU ) ) . x̂ ( j ) represents the most controversial image according to ft and gj , and therefore is the most informative in distinguishing between them . If the competing model gj performs at a high level , and differs from the target model ft in design , x̂ ( j ) is likely to be a failure of ft. To avoid identifying different instantiations of the same underlying root cause ( Pei et al. , 2017 ) and to encourage content diversity of the candidate images , we describe a “ contentaware ” method for constructing M. We first partition D into c overlapped subgroups { Dt , k } ck=1 based on ft ’ s predicted maps , where x ∈ Dt , k if at least one pixel in ft ( x ) belongs to the k-th category . After that , we add a content constraint by restricting the size of predicted pixels in the k-th category , i.e. , ∑ 1 [ ft ( x ) == k ] / ( h × w ) , within the range of [ pk , qk ] . This allows excluding images of exceedingly large ( or small ) object sizes , which may be of less practical relevance . Moreover , instead of focusing on the most controversial example defined in Eq . ( 1 ) , we look at top-n3 images in Dt , k with n3 largest distances computed by { x̂ ( j , k ) i } n3 i=1 = argmax { xi } n3 i=1∈Dt , k n3∑ i=1 d ( ft ( xi ) , gj ( xi ) ) , j = 1 , . . . , m , k = 1 , . . . , c. ( 2 ) We then repeat this procedure , but with the roles of ft and gj reversed . That is , we partition D into c subgroups { Dj , k } ck=1 according to gj , and solve the maximization problem over Dj , k . Finally , we gather all candidate images to arrive at the setM = { xi } n2i=1 , where n2 ≤ 2mcn3 n1.4 Constructing S Although images in the candidate setM have great potentials of being counterexamples of ft , some false positives may be included ( see Figure 2 ) , especially when gj is inferior to ft . In addition , no data screening is involved in the construction of D , increasing chances of including images that are out-of-domain ( e.g. , falling out of the c categories and/or containing inappropriate content ) . In view of these , we reduce false positives inM via a weakly labelling strategy . For each x ∈M , we ask human subjects to give a discrete score on an absolute category rating ( ACR ) scale to indicate the segmentation quality of ft ( x ) . The labels on the scale are “ bad ” , “ poor ” , “ fair ” , “ good ” , 4We have n2 ≤ 2mcn3 because the same images may be optimal in different problems specified in Eq . ( 2 ) . and “ excellent ” ( see Figure 8 ) . We then rank all images inM by the mean opinion scores , and choose top-n4 images with the smallest scores to form the counterexample set S = { xi } n4i=1 . Finally , we seek pixel-level segmentation results from human annotators for each image in S ( see Figure 9 ) . 3.2 MODEL RECTIFICATION Algorithm 1 : The proposed framework for efficiently troubleshooting segmentation models Input : An unlabelled image set D , a target model f ( 0 ) t and the dataset S ( 0 ) on which it is pre-trained , a group of competing models { gj } mj=1 , the maximum number r of fine-tuning rounds , hyper-parameters n3 , n4 Output : Improved f ( r ) t 1 S ← ∅ 2 for j ← 1 to m do 3 Compute segmentation predictions { gj ( x ) , x ∈ D } 4 end 5 for i← 0 to r − 1 do 6 M ( i+1 ) ← ∅ 7 Compute segmentation predictions { f ( i ) t ( x ) , x ∈ D } 8 for j ← 1 to m do 9 Compute the distances { d ( f ( i ) t ( x ) , gj ( x ) ) , x ∈ D } 10 Divide D into c subgroups according to f ( i ) t 11 Filter images by the content constraint 12 Select top-n3 images by solving Eq . ( 2 ) to formMj 13 M ( i+1 ) ←M ( i+1 ) ⋃ Mj 14 Reverse the roles of f ( i ) t and gj , and repeat Steps 10 to 13 15 end 16 Source weak human scores forM ( i+1 ) 17 Select top-n4 images with the lowest quality scores and collect pixel-level labels from humans to form S ( i+1 ) 18 S ← S ⋃ S ( i+1 ) ; 19 Fine-tune f ( i ) t on the combination of S and S ( 0 ) 20 end The labelled images in S give us a great opportunity to improve ft by learning from these failures . In order to be resistant to catastrophic forgetting ( McCloskey & Cohen , 1989 ) , the fine-tuning can also include labelled data previously used to train ft. We may iterate through the whole procedure of failure identification and model rectification several rounds , leading to a progressive two-stage framework for efficiently troubleshooting segmentation models with human-in-the-loop . When the iterative setting is enabled , the size of S is growing : S = ⋃r i=1 S ( i ) , where S ( i ) is the counterexample set created in the i-th fine-tuning round . Denoting the initial target model by f ( 0 ) t , we fine-tune f ( i−1 ) t on the combination of S accumulated in the previous i − 1 rounds and S ( 0 ) used for pre-training . We summarize the proposed framework in Algorithm 1 . | Annotating images for training of segmentation models is time consuming and it can be difficult to annotate enough examples to ensure good performance on the rare difficult examples that often occur when methods are applied to real world data. These cases are referred to as corner-cases. The paper therefore proposes a measure based on the discrepancy of a group of segmentation models to identify more valuable images to annotate and add to the training data in a iterative fashion. The approach is tested on the PASCAL VOC database. | SP:5fce6baf0f2dcde5b8519a5850484aa627f64f68 |
Efficiently Troubleshooting Image Segmentation Models with Human-In-The-Loop | 1 INTRODUCTION . Image segmentation ( i.e. , pixel-level image labelling ) has recently risen to explosive popularity , due in part to its profound impact on many high-stakes vision applications , such as autonomous driving and medical image analysis . While the performance of segmentation models , as measured by excessively reused test sets ( Everingham et al. , 2010 ; Lin et al. , 2014 ) , keeps improving ( Chen et al. , 2018a ; Badrinarayanan et al. , 2017 ; Yu et al. , 2018 ) , two scientific questions have arisen to capture the community ’ s curiosity , and motivate the current work : Q1 : Do “ top-performing ” segmentation models on existing benchmarks generalize to the real world with much richer variations ? Q2 : Can we identify and rectify the trained models ’ sparse but fatal mistakes , without incurring significant workload of human labelling ? The answer to the first question is conceptually clearer , by taking reference to a series of recent work on image classification ( Recht et al. , 2019 ; Hendrycks et al. , 2019 ) . A typical test set for image classification can only include a maximum of ten thousands of images because human labelling ( or verification of predicted labels ) is expensive and time-consuming . Considering the high dimensionality of image space and the “ human-level ” performance of existing methods , such test sets may only spot an extremely small subset of possible mistakes that the model will make , suggesting their insufficiency to cover hard examples that may be encountered in the real world ( Wang et al. , 2020 ) . The existence of natural adversarial examples ( Hendrycks et al. , 2019 ) also echos such hidden fragility of the classifiers to unseen examples , despite the impressive accuracy on existing benchmarks . While the above problem has not been studied in the context of image segmentation , we argue that it would only be much amplified for two main reasons . First , segmentation benchmarks require pixel-level dense annotation . Compared to classification databases , they are much more expensive , laborious , and error-prone to label1 , making existing segmentation datasets even more restricted in scale . Second , it is much harder for segmentation data to be class-balanced in the pixel level , making highly skewed class distributions notoriously common for this particular task ( Kervadec et al. , 2019 ; Bischke et al. , 2018 ) . Besides , the “ universal ” background class ( often set to cover the distracting or uninteresting classes ( Everingham et al. , 2010 ) ) adds additional complicacy to image segmentation ( Mostajabi et al. , 2015 ) . Thus , it remains questionable to what extent the impressive performance on existing benchmarks can be interpreted as ( or translated into ) real-world robustness . If “ top-performing ” segmentation models make sparse yet catastrophic mistakes that have not been spotted beforehand , they will fall short of the need by high-stakes applications . The answer to the second question constitutes the main body of our technical work . In order to identify sparse failures of existing segmentation models , it is necessary to expose them to a much larger corpus of real-world labelled images ( on the order millions or even billions ) . This is , however , implausible due to the expensiveness of dense labelling in image segmentation . The core question essentially boils down to : how to efficiently decide what to label from the massive unlabelled images , such that a small number of annotated images maximally expose corner-case defects , and can be leveraged to improve the models . In this paper , we introduce a two-stage framework with human-in-the-loop for efficiently troubleshooting image segmentation models ( see Figure 1 ) . The first stage automatically mines , from a large pool D of unlabelled images , a small image set M , which are the most informative in exposing weaknesses of the target model . Specifically , inspired by previous studies on model falsification as model comparison ( Wang & Simoncelli , 2008 ; Ma et al. , 2018 ; Wang et al. , 2020 ) , we let the target model compete with a set of state-of-the-art methods with different design methodologies , and sample images by MAximizing the Discrepancy ( MAD ) between the methods . To reduce the number of false positives , we propose a weakly labelling method of filteringM to obtain a smaller refined set S , subject to segmentation by human subjects . In the second stage , we fine-tune the target model to learn from the counterexamples in S without forgetting previously seen data . The two stages may be iterated , enabling progressive troubleshooting of image segmentation models . Experiments on PASCAL VOC ( Everingham et al. , 2010 ) demonstrate the feasibility of the proposed method to address this new challenging problem , where we successfully discover corner-case errors of a “ top-performing ” segmentation model ( Chen et al. , 2017 ) , and fix it for improved generalization in the wild . 2 RELATED WORK . MAD competition The proposed method takes inspiration from the MAD competition ( Wang & Simoncelli , 2008 ; Wang et al. , 2020 ) to efficiently spot model failures . Previous works focused on performance evaluation . We take one step further to also fix the model errors detected in the MAD competition . To the best of our knowledge , our work is the first to extend the MAD idea to image segmentation , where labeling efficiency is more desired since pixel-wise human annotation for image segmentation is much more time-consuming than image quality assessment ( Wang & Simoncelli , 2008 ) and image classification ( Wang et al. , 2020 ) tasks previously explored . 1According to Everingham et al . ( Everingham et al. , 2010 ) and our practice , it can easily take ten times as long to segment an object than to draw a bounding box around it . Differential testing Our method is also loosely related to the cross-disciplinary field of software/system testing , especially the differential testing technique ( McKeeman , 1998 ) . By providing the same tests to multiple software implementations , differential testing aims to find bug-exposing test samples that lead to different results . Programmers can then dig into these test cases for potential bug fixing . While debugging software is very different from troubleshooting machine learning algorithms , a handful of recent work explored this idea to find pitfalls of deep learning-based autonomous driving systems ( Pei et al. , 2017 ; Tian et al. , 2018 ; Zhang et al. , 2018 ) . Aiming to be fully automated without human intervention , these methods have to make strong assumptions such as the ground truth labels can be determined by majority vote2 or are unchanged under some synthetic image transformations3 ( e.g. , brightness and contrast change , or style transfer ) . Therefore , it is unclear how to generalize the results obtained in such noisy and often unrealistic settings , to the real world with both great content fidelity and diversity . Adversarial examples Introduced by Dalvi et al . ( Dalvi et al. , 2004 ) and reignited by Szegedy et al . ( Szegedy et al. , 2013 ) , most adversarial attacks add small synthetic perturbations to inputs of computational models that cause them to make incorrect decisions . In image classification , Hendrycks et al . ( Hendrycks et al. , 2019 ) identified a set of natural images that behave like synthetic adversarial examples , which possess inherent transferability to falsify different image classifiers with the same type of errors . The selected counterexamples by the proposed framework might be treated as a new type of natural adversarial examples , that force the two models to make distinct predictions , therefore capable of fooling at least one model . Similar as natural counterexamples focused in this work , synthetic adversarial examples pose security risks of deploying machine learning algorithms in real-world applications . A large body of research ( Madry et al. , 2018 ; Zhang et al. , 2019 ) delves deep into adversarial training , trying to defend against adversarial perturbations at the expensive cost of sacrificing the generalization on original test sets without perturbations ( Tsipras et al. , 2019 ; Zhang et al. , 2019 ; Schmidt et al. , 2018 ) . This seems to suggest a trade-off between generalization to real-world benign examples and robustness to adversarial attacks . Semantic segmentation with deep learning Fully convolutional network ( Long et al. , 2015 ) was among the first deep architectures adopted for high-quality segmentation . Skip connection ( Ronneberger et al. , 2015 ) , recurrent module ( Zheng et al. , 2015 ) , max index pooling ( Noh et al. , 2015 ; Badrinarayanan et al. , 2017 ) , dilated convolution ( Chen et al. , 2014 ; Yu & Koltun , 2016 ; Chen et al. , 2018a ) , and multi-scale training ( Chen et al. , 2016 ; 2018a ) are typical strategies to boost the segmentation performance . Conditional random fields ( Ladickỳ et al. , 2010 ) used to dominate image segmentation before the advent of deep learning were also combined with convolutional networks to model spatial relationships ( Zheng et al. , 2015 ) . We refer interested readers to ( Minaee et al. , 2020 ) for a comprehensive survey of this field . 3 PROPOSED METHOD . Suppose we have a target segmentation model ft : Rh×w 7→ { 1 , · · · , c } h×w , where h and w are the height and width of the input image , and c denotes the number of categories . Our goal is to efficiently identify and fix the failure cases of ft encountered in the real world , while minimizing human labelling effort in this process . We start by constructing a large image database D , whose collection may be guided by the keywords that represent the c categories . Rather than conducting large-scale subjective testing to obtain the ground truth segmentation map for each x ∈ D , we choose to create a small subset of imagesM ⊂ D , which are strong candidates for revealing corner-case behaviors of ft. To further reduce false positive examples inM , we describe a method to gather a weak label for each x ∈ M as an overall indicator of segmentation quality . Based on the labels , an even smaller set S ⊂M can be obtained for dense annotation by humans . Last , we fine-tune ft 2As per ( Hendrycks et al. , 2019 ) , machine learning algorithms with similar design philosophies tend to make common mistakes . 3In many areas of computer vision , methods trained on synthetic data can not generalize to realistic data , and specialized techniques such as domain adaptation ( Zhang et al. , 2017 ; Zhao et al. , 2019 ) have to be used to bridge the performance gap . on the combination of S and previously trained data , in an attempt to learn from the found failures without forgetting ( Li & Hoiem , 2017 ) . 3.1 FAILURE IDENTIFICATION . ConstructingM Inspired by model falsification methodologies from computational vision ( Wang & Simoncelli , 2008 ) and software engineering ( McKeeman , 1998 ) , we construct the setM = { xi } n2i=1 by sampling the most “ controversial ” images from the large-scale unlabelled database D = { xi } n1i=1 , where n2 n1 . Specifically , given the target model ft , we let it compete with a group of state-ofthe-art segmentation models { gj } mj=1 by maximizing the discrepancy ( Wang et al. , 2020 ) between ft and gj on D : x̂ ( j ) = argmax x∈D d ( ft ( x ) , gj ( x ) ) , j = 1 , . . . , m , ( 1 ) where d ( · ) is a distance metric to gauge the dissimilarity between two segmentation maps ( e.g. , negative pixel accuracy , or mean region intersection over union ( mIoU ) ) . x̂ ( j ) represents the most controversial image according to ft and gj , and therefore is the most informative in distinguishing between them . If the competing model gj performs at a high level , and differs from the target model ft in design , x̂ ( j ) is likely to be a failure of ft. To avoid identifying different instantiations of the same underlying root cause ( Pei et al. , 2017 ) and to encourage content diversity of the candidate images , we describe a “ contentaware ” method for constructing M. We first partition D into c overlapped subgroups { Dt , k } ck=1 based on ft ’ s predicted maps , where x ∈ Dt , k if at least one pixel in ft ( x ) belongs to the k-th category . After that , we add a content constraint by restricting the size of predicted pixels in the k-th category , i.e. , ∑ 1 [ ft ( x ) == k ] / ( h × w ) , within the range of [ pk , qk ] . This allows excluding images of exceedingly large ( or small ) object sizes , which may be of less practical relevance . Moreover , instead of focusing on the most controversial example defined in Eq . ( 1 ) , we look at top-n3 images in Dt , k with n3 largest distances computed by { x̂ ( j , k ) i } n3 i=1 = argmax { xi } n3 i=1∈Dt , k n3∑ i=1 d ( ft ( xi ) , gj ( xi ) ) , j = 1 , . . . , m , k = 1 , . . . , c. ( 2 ) We then repeat this procedure , but with the roles of ft and gj reversed . That is , we partition D into c subgroups { Dj , k } ck=1 according to gj , and solve the maximization problem over Dj , k . Finally , we gather all candidate images to arrive at the setM = { xi } n2i=1 , where n2 ≤ 2mcn3 n1.4 Constructing S Although images in the candidate setM have great potentials of being counterexamples of ft , some false positives may be included ( see Figure 2 ) , especially when gj is inferior to ft . In addition , no data screening is involved in the construction of D , increasing chances of including images that are out-of-domain ( e.g. , falling out of the c categories and/or containing inappropriate content ) . In view of these , we reduce false positives inM via a weakly labelling strategy . For each x ∈M , we ask human subjects to give a discrete score on an absolute category rating ( ACR ) scale to indicate the segmentation quality of ft ( x ) . The labels on the scale are “ bad ” , “ poor ” , “ fair ” , “ good ” , 4We have n2 ≤ 2mcn3 because the same images may be optimal in different problems specified in Eq . ( 2 ) . and “ excellent ” ( see Figure 8 ) . We then rank all images inM by the mean opinion scores , and choose top-n4 images with the smallest scores to form the counterexample set S = { xi } n4i=1 . Finally , we seek pixel-level segmentation results from human annotators for each image in S ( see Figure 9 ) . 3.2 MODEL RECTIFICATION Algorithm 1 : The proposed framework for efficiently troubleshooting segmentation models Input : An unlabelled image set D , a target model f ( 0 ) t and the dataset S ( 0 ) on which it is pre-trained , a group of competing models { gj } mj=1 , the maximum number r of fine-tuning rounds , hyper-parameters n3 , n4 Output : Improved f ( r ) t 1 S ← ∅ 2 for j ← 1 to m do 3 Compute segmentation predictions { gj ( x ) , x ∈ D } 4 end 5 for i← 0 to r − 1 do 6 M ( i+1 ) ← ∅ 7 Compute segmentation predictions { f ( i ) t ( x ) , x ∈ D } 8 for j ← 1 to m do 9 Compute the distances { d ( f ( i ) t ( x ) , gj ( x ) ) , x ∈ D } 10 Divide D into c subgroups according to f ( i ) t 11 Filter images by the content constraint 12 Select top-n3 images by solving Eq . ( 2 ) to formMj 13 M ( i+1 ) ←M ( i+1 ) ⋃ Mj 14 Reverse the roles of f ( i ) t and gj , and repeat Steps 10 to 13 15 end 16 Source weak human scores forM ( i+1 ) 17 Select top-n4 images with the lowest quality scores and collect pixel-level labels from humans to form S ( i+1 ) 18 S ← S ⋃ S ( i+1 ) ; 19 Fine-tune f ( i ) t on the combination of S and S ( 0 ) 20 end The labelled images in S give us a great opportunity to improve ft by learning from these failures . In order to be resistant to catastrophic forgetting ( McCloskey & Cohen , 1989 ) , the fine-tuning can also include labelled data previously used to train ft. We may iterate through the whole procedure of failure identification and model rectification several rounds , leading to a progressive two-stage framework for efficiently troubleshooting segmentation models with human-in-the-loop . When the iterative setting is enabled , the size of S is growing : S = ⋃r i=1 S ( i ) , where S ( i ) is the counterexample set created in the i-th fine-tuning round . Denoting the initial target model by f ( 0 ) t , we fine-tune f ( i−1 ) t on the combination of S accumulated in the previous i − 1 rounds and S ( 0 ) used for pre-training . We summarize the proposed framework in Algorithm 1 . | In this work, the authors seek to leverage external sources of data to improve the generalization of segmentation models. In particular, they seek to identify images which generate discordance among models, hypothesizing that they would be well-suited to improve model performance. Once selected, they leverage human annotators to first filter this image set and then segment the images, which are then used to retrain the model. They demonstrate improved performance relative to a batch of competing models which are not updated using this procedure. | SP:5fce6baf0f2dcde5b8519a5850484aa627f64f68 |
Disentangling 3D Prototypical Networks for Few-Shot Concept Learning | 1 INTRODUCTION . Humans can learn new concepts from just one or a few samples . Consider the example in Figure 1 . Assuming there is a person who has no prior knowledge about blue and carrot , by showing this person an image of a blue carrot and telling him “ this is an carrot with blue color ” , the person can easily generalize from this example to ( 1 ) recognizing carrots of varying colors , 3D poses and viewing conditions and under novel background scenes , ( 2 ) recognizing the color blue on different objects , ( 3 ) combine these two concepts with other concepts to form a novel object coloring he/she has never seen before , e.g. , red carrot or blue tomato and ( 4 ) using the newly learned concepts to answer questions regarding the visual scene . Motivated by this , we explore computational models that can achieve these four types of generalization for visual concept learning . We propose disentangling 3D prototypical networks ( D3DP-Nets ) , a model that learns to disentangle RGB-D images into objects , their 3D locations , sizes , 3D shapes and styles , and the background scene , as shown in Figure 2 . Our model can learn to detect objects from a few 3D object bounding box annotations and can further disentangle objects into different attributes through a self-supervised view prediction task . Specifically , D3DP-Nets uses differentiable unprojection and rendering operations to go back and forth between the input RGB-D ( 2.5D ) image and a 3D scene feature map . From the scene feature map , our model learns to detect objects and disentangles each object into a 3D shape code and an 1D style code through a shape/style disentangling antoencoder . We use adaptive instance normalization layers ( Huang & Belongie , 2017 ) to encourage shape/style disentanglement within each object . Our key intuition is to represent objects and their shapes in terms of 3D feature representations disentangled from style variability so that the model can correspond objects with similar shape by explicitly rotating and scaling their 3D shape representations during matching . Project page : https : //mihirp1998.github.io/project_pages/d3dp/ ∗Equal contribution †Work done while at Carnegie Mellon University With the disentangled representations , D3DP-Nets can recognize new concepts regarding object shapes , styles and spatial arrangements from a few human-supplied labels by training concept classifiers only on the relevant feature subspace . Our model learns object shapes on shape codes , object colors and textures on style codes , and object spatial arrangements on object 3D locations . We show in the supplementary how the features relevant for each linguistic concept can be inferred from a few contrasting examples . Thus the classifiers attend only to the essential property of the concept and ignore irrelevant visual features . This allows them to generalize with far fewer examples and can recognize novel attribute compositions not present in the training data . We test D3DP-Nets in few-shot concept learning , visual question answering ( VQA ) and scene generation . We train concept classifiers for object shapes , object colors/materials , and spatial relationships on our inferred disentangled feature spaces , and show they outperform current stateof-the-art ( Mao et al. , 2019 ; Hu et al. , 2016 ) , which use 2D representations . We show that a VQA modular network that incorporates our concept classifiers shows improved generalization over the state-of-the-art ( Mao et al. , 2019 ) with dramatically fewer examples . Last , we empirically show that D3DP-Nets generalize their view predictions to scenes with novel number , category and styles of objects , and compare against state-of-the-art view predictive architectures of Eslami et al . ( 2018 ) . The main contribution of this paper is to identify the importance of using disentangled 3D feature representations for few-shot concept learning . We show the disentangled 3D feature representations can be learned using self-supervised view prediction , and they are useful for detecting and classifying language concepts by training them over the relevant only feature subsets . The proposed model outperforms the current state-of-the-art in VQA in the low data regime and the proposed 3D disentangled representation outperforms similar 2D or 2.5D ones in few-shot concept classification . 2 RELATION TO PREVIOUS WORKS . Few-shot concept learning Few-shot learning methods attempt to learn a new concept from one or a few annotated examples at test time , yet , at training time , these models still require labelled datasets which annotate a group of images as “ belonging to the same category ” ( Koch et al. , 2015 ; Vinyals et al. , 2016b ) . Metric-based few-shot learning approaches ( Snell et al. , 2017 ; Qi et al. , 2018 ; Schwartz et al. , 2018 ; Vinyals et al. , 2016a ) aim at learning an embedding space in which objects of the same category are closer in the latent space than objects that belong to different categories . These models needs to be trained with several ( annotated ) image collections , where each collection contains images of the same object category . Works of Misra et al . ( 2017 ) ; Purushwalkam et al . ( 2019 ) ; Nikolaus et al . ( 2019 ) ; Tokmakov et al . ( 2019 ) compose attribute and nouns to detect novel attribute-noun combinations , but their feature extractors need to be pretrained on large annotated image collections , such as Imagenet , or require annotated data with various attribute compositions . The proposed model is pretrained by predicting views , without the need for annotations regarding object classes or attributes . Our concept classifiers are related to methods that classify concepts by computing distances to prototypes produced by averaging the ( 2D CNN ) features of few labelled examples ( Snell et al. , 2017 ; Qi et al. , 2018 ; Schwartz et al. , 2018 ) . The work of Prabhudesai et al . ( 2020 ) learns 3D prototypes in a self-supervised manner , but they do not disentangle their representation into style and shape codes . We compare against 2D and 3D few shot learning methods and outperform them by a significant margin . The novel feature of our work is that we learn concept prototypes over disentangled 3D shape and 1D style codes as opposed to entangled 3D or 2D CNN features . Learning neural scene representation Our work builds upon recent view-predictive scene representation learning literature ( Tung et al. , 2019 ; Sitzmann et al. , 2019 ; Eslami et al. , 2016 ) . Our scene encoders and decoders , the view prediction objective , and the 3D neural bottleneck and egostabilization of the 3D feature maps is similar to those proposed in geometry-aware neural networks of Tung et al . ( 2019 ) . Sitzmann et al . ( 2019 ) and Eslami et al . ( 2016 ) both encode multiview images of a scene and camera poses into a scene representation , in the form of 2D scene feature maps or an implicit function . Sitzmann et al . ( 2019 ) only considers single-object scenes and needs to train a separate model for each object class . We compare generalization of our view predictions against Eslami et al . ( 2016 ) and show we have dramatically better generalization across number , type and spatial arrangements of objects . Furthermore , the above approaches do not explicitly disentangle style/shape representations of objects . Zhu et al . ( 2018 ) focuses on synthesizing natural images of objects with a disentangled 3D representation , but it remains unclear how to use the learnt embeddings to detect object concepts . Different from most inverse graphics networks ( Tung et al. , 2017 ; Kanazawa et al. , 2018 ) that aim to reconstruct detailed 3D occupancy of the objects , our model aims to learn feature representations that can detect an object across pose and scale variability , and use them for concept learning . Our shape-style disentanglement uses adaptive instance normalization layers ( Huang et al. , 2018 ; Huang & Belongie , 2017 ) that have been valuable for disentangling shape and style in 2D images . Here , we use them in a 3D latent feature space . 3 DISENTANGLING 3D PROTOTYPICAL NETWORKS ( D3DP-NETS ) . The architecture of D3DP-Nets is illustrated in Figure 2 . D3DP-Nets consists of two main components : ( a ) an image-to-scene encoder-decoder , and ( b ) an object shape/style disentanglement encoder-decoder . Next , we describe these components in detail . 3.1 IMAGE-TO-SCENE ENCODER-DECODER . A 2D-to-3D scene differentiable encoder Esc maps an input RGB-D image to a 3D feature map M ∈ Rw×h×d×c of the scene , where w , h , d , c denote width , height , depth and number of channels , respectively . Every ( x , y , z ) grid location in the 3D feature map M holds a c-channel feature vector that describes the semantic and geometric properties of a corresponding 3D physical location in the 3D world scene . We output a binary 3D occupancy map Mocc ∈ { 0 , 1 } w×h×d from M using an occupancy decoder Docc . A differentiable neural renderer Dsc neurally renders a 3D feature map M to a 2D image and a depth map from a specific viewpoint . When the input to D3DP-Nets is a sequence of images as opposed to a single image , each image It in the sequence is encoded to a corresponding 3D per frame map Mt , the 3D rotation and translation of the camera with respect to the frame map of the initial frame I0 is computed and the scene map M is computed by first rotating and translating Mt to bring it to the same coordinate frame as M0 and then averaging with the map built thus far . We will assume camera motion is known and given for this cross frame fusion operation . D3DP-Nets are self-supervised by view prediction , predicting RGB images and occupancy grids for query viewpoints . We assume there is an agent that can move around in static scenes and observes them from multiple viewpoints . The agent is equipped with a depth sensor and knowledge of its egomotion ( proprioception ) provided by the simulator in simulated environments.We train the scene encoders and decoders jointly for RGB view prediction and occupancy prediction and errors are backpropagated end-to-end to the parameters of the network : Lview−pred =‖Dsc ( rotate ( M , vq ) ) − Iq‖1 + log ( 1 + exp ( −Oq ·Docc ( ( rotate ( M , vq ) ) , vq ) ) ) , ( 1 ) where Iq and Oq are the ground truth RGB image and occupancy map respectively , vq is the query view , and rotate ( M , vq ) is a trilinear resampling operation that rotates the content of a 3D feature map M to viewpoint vq . The RGB output is trained with a regression loss , and the occupancy is trained with a logistic classification loss . Occupancy labels are computed through raycasting , similar to Harley et al . ( 2020 ) . We provide more details on the architecture of our model in the supplementary material . We train a 3D object detector that takes as input the output of the scene feature map M and predicts 3D axis-aligned bounding boxes , similar to Harley et al . ( 2020 ) . This is supervised from ground-truth 3D bounding boxes without class labels . 3.2 OBJECT SHAPE/STYLE DISENTANGLEMENT . As the style of an image can be understood as a property which is shared across its spatial dimensions , previous works ( Huang et al. , 2018 ; Karras et al. , 2019 ) use adaptive instance normalization ( Huang & Belongie , 2017 ) as an inductive bias to do style transfer between a pair of images . D3DP-Nets uses this same inductive bias in its decoder to disentangle the style and 3D shape of an object . We believe that 3D shape is not analogous to 3D occupancy , but it is a blend of 3D occupancy and texture ( spatial arrangement of color intensities ) . Given a set of 3D object boxes { bo|o = 1 · · · |O| } where O is the set of objects in the scene , D3DP-Nets obtain corresponding object feature maps Mo = crop ( M , bo ) by cropping the scene feature map M using the 3D bounding box coordinates bo . We use ground-truth 3D boxes at training time and detected boxes at test time . Each object feature map is resized to a fixed resolution of 16 × 16 × 16 , and fed to an object-centric autoencoder whose encoding modules predict a 4D shape code zoshp = Eshp ( M o ) ∈ Rw×h×d×c and a 1D style code zosty = Esty ( M o ) ∈ Rc . A decoder D composes the two using adaptive instance normalization ( AIN ) layers ( Huang & Belongie , 2017 ) by adjusting the mean and variance of the 4D shape code based on the 1D style code : AIN ( z , γ , β ) = γ ( z−µ ( z ) σ ( z ) ) + β , where z is obtained by a 3D convolution on zshp , µ and σ are the channel-wise mean and standard deviation of z , and β and γ are extracted using single-layer perceptrons from zsty . The object encoders and decoders are trained with an autoencoding objective and a cycle-consistency objective which ensure that the shape and style code remain consistent after composing , decoding and encoding again ( see Figure 2 ( b ) ) : Ldis = 1 |O| |O|∑ o=1 ‖Mo −D ( Eshp ( Mo ) , Esty ( Mo ) ) ‖2︸ ︷︷ ︸ autoencoding loss + ∑ i∈O\o Lc−shp ( Mo , Mi ) + Lc−sty ( Mo , Mi ) ︸ ︷︷ ︸ cycle-consistency loss , ( 2 ) where Lc−shp ( Mo , Mi ) = ‖Eshp ( Mo ) −Eshp ( D ( Eshp ( Mo ) , Esty ( Mi ) ) ) ‖2 is the shape consistency loss and Lc−sty ( Mo , Mi ) = ‖Esty ( Mo ) −Esty ( D ( Eshp ( Mi ) , Esty ( Mo ) ) ) ‖2 is the style consistency loss . We further include a view prediction loss on the synthesized scene feature map M̄ , which is composed by replacing each object feature map Mo with its re-synthesized version D ( zoshp , zosty ) , resized to the original object size , as shown in Figure 2 ( c ) . The view prediction reads : Lview−pred−synth = ‖Dsc ( rotate ( M̄ , vt+1 ) ) − It+1‖1 . The total unsupervised optimization loss for D3DP-Nets reads : Luns = Lview−pred + Lview−pred−synth + Ldis . ( 3 ) | This paper describes an approach that learns a disentangled shape and style representation of objects in a self-supervised way from RGB-D images. The approach is based on various components, like a 3D feature volume, a bounding box detector, and a disentanglement network. Neural rendering (e.g. recomposing the various disentangled parts into an image) is used as the learning signal for self-supervision. Various applications of this representation are shown, examples are few-shot shape learning and Visual Question Answering. | SP:8f46cbd5fff3557fe870cebf1ba231309fceab14 |
Disentangling 3D Prototypical Networks for Few-Shot Concept Learning | 1 INTRODUCTION . Humans can learn new concepts from just one or a few samples . Consider the example in Figure 1 . Assuming there is a person who has no prior knowledge about blue and carrot , by showing this person an image of a blue carrot and telling him “ this is an carrot with blue color ” , the person can easily generalize from this example to ( 1 ) recognizing carrots of varying colors , 3D poses and viewing conditions and under novel background scenes , ( 2 ) recognizing the color blue on different objects , ( 3 ) combine these two concepts with other concepts to form a novel object coloring he/she has never seen before , e.g. , red carrot or blue tomato and ( 4 ) using the newly learned concepts to answer questions regarding the visual scene . Motivated by this , we explore computational models that can achieve these four types of generalization for visual concept learning . We propose disentangling 3D prototypical networks ( D3DP-Nets ) , a model that learns to disentangle RGB-D images into objects , their 3D locations , sizes , 3D shapes and styles , and the background scene , as shown in Figure 2 . Our model can learn to detect objects from a few 3D object bounding box annotations and can further disentangle objects into different attributes through a self-supervised view prediction task . Specifically , D3DP-Nets uses differentiable unprojection and rendering operations to go back and forth between the input RGB-D ( 2.5D ) image and a 3D scene feature map . From the scene feature map , our model learns to detect objects and disentangles each object into a 3D shape code and an 1D style code through a shape/style disentangling antoencoder . We use adaptive instance normalization layers ( Huang & Belongie , 2017 ) to encourage shape/style disentanglement within each object . Our key intuition is to represent objects and their shapes in terms of 3D feature representations disentangled from style variability so that the model can correspond objects with similar shape by explicitly rotating and scaling their 3D shape representations during matching . Project page : https : //mihirp1998.github.io/project_pages/d3dp/ ∗Equal contribution †Work done while at Carnegie Mellon University With the disentangled representations , D3DP-Nets can recognize new concepts regarding object shapes , styles and spatial arrangements from a few human-supplied labels by training concept classifiers only on the relevant feature subspace . Our model learns object shapes on shape codes , object colors and textures on style codes , and object spatial arrangements on object 3D locations . We show in the supplementary how the features relevant for each linguistic concept can be inferred from a few contrasting examples . Thus the classifiers attend only to the essential property of the concept and ignore irrelevant visual features . This allows them to generalize with far fewer examples and can recognize novel attribute compositions not present in the training data . We test D3DP-Nets in few-shot concept learning , visual question answering ( VQA ) and scene generation . We train concept classifiers for object shapes , object colors/materials , and spatial relationships on our inferred disentangled feature spaces , and show they outperform current stateof-the-art ( Mao et al. , 2019 ; Hu et al. , 2016 ) , which use 2D representations . We show that a VQA modular network that incorporates our concept classifiers shows improved generalization over the state-of-the-art ( Mao et al. , 2019 ) with dramatically fewer examples . Last , we empirically show that D3DP-Nets generalize their view predictions to scenes with novel number , category and styles of objects , and compare against state-of-the-art view predictive architectures of Eslami et al . ( 2018 ) . The main contribution of this paper is to identify the importance of using disentangled 3D feature representations for few-shot concept learning . We show the disentangled 3D feature representations can be learned using self-supervised view prediction , and they are useful for detecting and classifying language concepts by training them over the relevant only feature subsets . The proposed model outperforms the current state-of-the-art in VQA in the low data regime and the proposed 3D disentangled representation outperforms similar 2D or 2.5D ones in few-shot concept classification . 2 RELATION TO PREVIOUS WORKS . Few-shot concept learning Few-shot learning methods attempt to learn a new concept from one or a few annotated examples at test time , yet , at training time , these models still require labelled datasets which annotate a group of images as “ belonging to the same category ” ( Koch et al. , 2015 ; Vinyals et al. , 2016b ) . Metric-based few-shot learning approaches ( Snell et al. , 2017 ; Qi et al. , 2018 ; Schwartz et al. , 2018 ; Vinyals et al. , 2016a ) aim at learning an embedding space in which objects of the same category are closer in the latent space than objects that belong to different categories . These models needs to be trained with several ( annotated ) image collections , where each collection contains images of the same object category . Works of Misra et al . ( 2017 ) ; Purushwalkam et al . ( 2019 ) ; Nikolaus et al . ( 2019 ) ; Tokmakov et al . ( 2019 ) compose attribute and nouns to detect novel attribute-noun combinations , but their feature extractors need to be pretrained on large annotated image collections , such as Imagenet , or require annotated data with various attribute compositions . The proposed model is pretrained by predicting views , without the need for annotations regarding object classes or attributes . Our concept classifiers are related to methods that classify concepts by computing distances to prototypes produced by averaging the ( 2D CNN ) features of few labelled examples ( Snell et al. , 2017 ; Qi et al. , 2018 ; Schwartz et al. , 2018 ) . The work of Prabhudesai et al . ( 2020 ) learns 3D prototypes in a self-supervised manner , but they do not disentangle their representation into style and shape codes . We compare against 2D and 3D few shot learning methods and outperform them by a significant margin . The novel feature of our work is that we learn concept prototypes over disentangled 3D shape and 1D style codes as opposed to entangled 3D or 2D CNN features . Learning neural scene representation Our work builds upon recent view-predictive scene representation learning literature ( Tung et al. , 2019 ; Sitzmann et al. , 2019 ; Eslami et al. , 2016 ) . Our scene encoders and decoders , the view prediction objective , and the 3D neural bottleneck and egostabilization of the 3D feature maps is similar to those proposed in geometry-aware neural networks of Tung et al . ( 2019 ) . Sitzmann et al . ( 2019 ) and Eslami et al . ( 2016 ) both encode multiview images of a scene and camera poses into a scene representation , in the form of 2D scene feature maps or an implicit function . Sitzmann et al . ( 2019 ) only considers single-object scenes and needs to train a separate model for each object class . We compare generalization of our view predictions against Eslami et al . ( 2016 ) and show we have dramatically better generalization across number , type and spatial arrangements of objects . Furthermore , the above approaches do not explicitly disentangle style/shape representations of objects . Zhu et al . ( 2018 ) focuses on synthesizing natural images of objects with a disentangled 3D representation , but it remains unclear how to use the learnt embeddings to detect object concepts . Different from most inverse graphics networks ( Tung et al. , 2017 ; Kanazawa et al. , 2018 ) that aim to reconstruct detailed 3D occupancy of the objects , our model aims to learn feature representations that can detect an object across pose and scale variability , and use them for concept learning . Our shape-style disentanglement uses adaptive instance normalization layers ( Huang et al. , 2018 ; Huang & Belongie , 2017 ) that have been valuable for disentangling shape and style in 2D images . Here , we use them in a 3D latent feature space . 3 DISENTANGLING 3D PROTOTYPICAL NETWORKS ( D3DP-NETS ) . The architecture of D3DP-Nets is illustrated in Figure 2 . D3DP-Nets consists of two main components : ( a ) an image-to-scene encoder-decoder , and ( b ) an object shape/style disentanglement encoder-decoder . Next , we describe these components in detail . 3.1 IMAGE-TO-SCENE ENCODER-DECODER . A 2D-to-3D scene differentiable encoder Esc maps an input RGB-D image to a 3D feature map M ∈ Rw×h×d×c of the scene , where w , h , d , c denote width , height , depth and number of channels , respectively . Every ( x , y , z ) grid location in the 3D feature map M holds a c-channel feature vector that describes the semantic and geometric properties of a corresponding 3D physical location in the 3D world scene . We output a binary 3D occupancy map Mocc ∈ { 0 , 1 } w×h×d from M using an occupancy decoder Docc . A differentiable neural renderer Dsc neurally renders a 3D feature map M to a 2D image and a depth map from a specific viewpoint . When the input to D3DP-Nets is a sequence of images as opposed to a single image , each image It in the sequence is encoded to a corresponding 3D per frame map Mt , the 3D rotation and translation of the camera with respect to the frame map of the initial frame I0 is computed and the scene map M is computed by first rotating and translating Mt to bring it to the same coordinate frame as M0 and then averaging with the map built thus far . We will assume camera motion is known and given for this cross frame fusion operation . D3DP-Nets are self-supervised by view prediction , predicting RGB images and occupancy grids for query viewpoints . We assume there is an agent that can move around in static scenes and observes them from multiple viewpoints . The agent is equipped with a depth sensor and knowledge of its egomotion ( proprioception ) provided by the simulator in simulated environments.We train the scene encoders and decoders jointly for RGB view prediction and occupancy prediction and errors are backpropagated end-to-end to the parameters of the network : Lview−pred =‖Dsc ( rotate ( M , vq ) ) − Iq‖1 + log ( 1 + exp ( −Oq ·Docc ( ( rotate ( M , vq ) ) , vq ) ) ) , ( 1 ) where Iq and Oq are the ground truth RGB image and occupancy map respectively , vq is the query view , and rotate ( M , vq ) is a trilinear resampling operation that rotates the content of a 3D feature map M to viewpoint vq . The RGB output is trained with a regression loss , and the occupancy is trained with a logistic classification loss . Occupancy labels are computed through raycasting , similar to Harley et al . ( 2020 ) . We provide more details on the architecture of our model in the supplementary material . We train a 3D object detector that takes as input the output of the scene feature map M and predicts 3D axis-aligned bounding boxes , similar to Harley et al . ( 2020 ) . This is supervised from ground-truth 3D bounding boxes without class labels . 3.2 OBJECT SHAPE/STYLE DISENTANGLEMENT . As the style of an image can be understood as a property which is shared across its spatial dimensions , previous works ( Huang et al. , 2018 ; Karras et al. , 2019 ) use adaptive instance normalization ( Huang & Belongie , 2017 ) as an inductive bias to do style transfer between a pair of images . D3DP-Nets uses this same inductive bias in its decoder to disentangle the style and 3D shape of an object . We believe that 3D shape is not analogous to 3D occupancy , but it is a blend of 3D occupancy and texture ( spatial arrangement of color intensities ) . Given a set of 3D object boxes { bo|o = 1 · · · |O| } where O is the set of objects in the scene , D3DP-Nets obtain corresponding object feature maps Mo = crop ( M , bo ) by cropping the scene feature map M using the 3D bounding box coordinates bo . We use ground-truth 3D boxes at training time and detected boxes at test time . Each object feature map is resized to a fixed resolution of 16 × 16 × 16 , and fed to an object-centric autoencoder whose encoding modules predict a 4D shape code zoshp = Eshp ( M o ) ∈ Rw×h×d×c and a 1D style code zosty = Esty ( M o ) ∈ Rc . A decoder D composes the two using adaptive instance normalization ( AIN ) layers ( Huang & Belongie , 2017 ) by adjusting the mean and variance of the 4D shape code based on the 1D style code : AIN ( z , γ , β ) = γ ( z−µ ( z ) σ ( z ) ) + β , where z is obtained by a 3D convolution on zshp , µ and σ are the channel-wise mean and standard deviation of z , and β and γ are extracted using single-layer perceptrons from zsty . The object encoders and decoders are trained with an autoencoding objective and a cycle-consistency objective which ensure that the shape and style code remain consistent after composing , decoding and encoding again ( see Figure 2 ( b ) ) : Ldis = 1 |O| |O|∑ o=1 ‖Mo −D ( Eshp ( Mo ) , Esty ( Mo ) ) ‖2︸ ︷︷ ︸ autoencoding loss + ∑ i∈O\o Lc−shp ( Mo , Mi ) + Lc−sty ( Mo , Mi ) ︸ ︷︷ ︸ cycle-consistency loss , ( 2 ) where Lc−shp ( Mo , Mi ) = ‖Eshp ( Mo ) −Eshp ( D ( Eshp ( Mo ) , Esty ( Mi ) ) ) ‖2 is the shape consistency loss and Lc−sty ( Mo , Mi ) = ‖Esty ( Mo ) −Esty ( D ( Eshp ( Mi ) , Esty ( Mo ) ) ) ‖2 is the style consistency loss . We further include a view prediction loss on the synthesized scene feature map M̄ , which is composed by replacing each object feature map Mo with its re-synthesized version D ( zoshp , zosty ) , resized to the original object size , as shown in Figure 2 ( c ) . The view prediction reads : Lview−pred−synth = ‖Dsc ( rotate ( M̄ , vt+1 ) ) − It+1‖1 . The total unsupervised optimization loss for D3DP-Nets reads : Luns = Lview−pred + Lview−pred−synth + Ldis . ( 3 ) | The paper presents a framework that combines 1) multi-view prediction for 3D reconstruction from a single image and 2) content-style disentangled representation learning using instance-norm-based auto-encoders. It aims at learning disentangled 3D representation of input images. The authors show that these methods can be applied to few-shot recognition, visual question-answering (VQA), view prediction, and image generation from texts. | SP:8f46cbd5fff3557fe870cebf1ba231309fceab14 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.